ChatGPTCreativeWritingAI score · PendingAI-assisted edit · no obvious prompt-injection riskn8n.io

Build an n8n Form-to-Newsletter Workflow with GPT-4o, Email Approval, and SendGrid

Form input → GPT-4o generates Markdown newsletter → email preview approval → convert to HTML and send via SendGrid

Some experienceStepsWorkflowPromptTip
Who
Digital marketers, content creators, community managers, and small teams sending regular newsletters
You get
Collect brief requirements via n8n form, auto-generate a Markdown newsletter with subject line using GPT-4o, send a Gmail preview for human approval, then convert to HTML and distribute to subscribers via SendGrid
You need
n8n · gmail · google-sheets · openai · sendgrid

Constraints

Prerequisites: n8n instance with LangChain nodes, OpenAI API key, Google Cloud account (Sheets + Gmail OAuth enabled), SendGrid account with a verified sender identity. Subscriber list goes into the Workflow Configuration (Set node) as comma-separated emails. Google Sheet needs columns: topic, target, sender, admin_email. Approval email contains $execution.resumeUrl and expires in 24 hours. Form field labels in the source template are in Japanese; this does not affect functionality.

What they did

Template author korin built an end-to-end newsletter workflow in n8n: an n8n Form Trigger collects topic, target audience, sender name, and approval email; a Set node injects the subscriber list; form data is logged to Google Sheets; a LangChain Agent node calls GPT-4o with a Structured Output Parser enforcing JSON output (subject and body_markdown); after Markdown-to-HTML conversion, Gmail sends a preview with $execution.resumeUrl; a Wait node pauses execution until the link is clicked; finally SendGrid delivers the HTML newsletter to subscribers.

How it went

The author reports this template enables a "Human-in-the-Loop" AI newsletter generation and approval workflow (author_report). No specific delivery rates, quality scores, or runtime metrics are provided by the source.

Worth knowing

1. Form field labels in the source workflow.json are in Japanese; this does not affect functionality and can be changed as needed. 2. The approval resumeUrl expires in 24 hours (Wait node resumeAmount=24); re-trigger if expired. 3. SendGrid fromEmail must be a verified sender or messages will be rejected. 4. The source suggests the model can be swapped for Claude or a local LLM, and SendGrid/Gmail can be replaced with Mailchimp, Outlook, or AWS SES. 5. This site has not executed the workflow; node parameters are taken from workflow.json. Test in an isolated environment and verify API key scopes before production use.

n8n workflow template

Structure checked · Not run-tested

Use “Import from File” in n8n, or copy the JSON and paste it into the editor. Connect your own accounts, then try test data. The template is inactive by default.

Setup and test checklist

Credentials to connect

  • OpenAI GPT-4o Model node: connect OpenAI API credentials.
  • Send Approval Email node: connect Gmail OAuth2 credentials.

Configuration to replace

  • Source template is n8n public workflow #11032 (~17 nodes). Keep inactive after import; verify triggers, expressions and external API endpoints.
  • Sticky-note guidance is informational; replace placeholders with your own accounts, sheet schemas or channel IDs.

Test input and expected output

  • Manually run the main path once in a test workspace and confirm credentialed nodes authenticate without errors.
  • Drive one synthetic/redacted sample through and check output fields and downstream writes before enabling in production.

Template changes

  • Author credential bindings, webhookId and execution data are removed; the workflow is inactive. Nodes, connections and original prompts are preserved. Not run-tested in n8n.
  • No business-logic edits; verify keys, quotas and privacy compliance before use.

Template retrieved: 2026-10-24

Steps

  1. Configure credentials and environment

    Set up credentials for OpenAI, Google (Sheets & Gmail), and SendGrid in n8n. Ensure your n8n version supports LangChain nodes.

  2. Set the subscriber list

    Open the Workflow Configuration node (Set node). Replace the subscriber_list placeholder with your comma-separated subscriber emails. Keep includeOtherFields as true to pass through form data.

  3. Configure Google Sheets logging

    Create a Google Sheet with columns for topic, target, sender, and admin_email. In the Store Form Responses node, enter your Document ID and Sheet Name; leave mappingMode as autoMapInputData.

  4. Configure the AI content generation node

    The Generate Newsletter Content node uses define mode, connected to OpenAI GPT-4o Model and JSON Output Parser. Verify the text parameter passes topic, target, and sender variables; the options.systemMessage is the system prompt requiring JSON output with subject and body_markdown only.

    Execution prompt · Source text。Generate Newsletter Content node text parameter (user message input)

    =トピック: {{ $json.topic }}
    ターゲット読者層: {{ $json.target }}
    送信者名: {{ $json.sender }}

    Execution prompt · Source text。Generate Newsletter Content node options.systemMessage parameter

    あなたはプロのメールマーケターです。入力されたトピックとターゲット読者層に基づいて、魅力的なメルマガを作成してください。
    
    タスク:
    1. ターゲット読者層に響く件名を作成する
    2. トピックに基づいた本文をMarkdown形式で作成する
    3. HTMLタグは使用せず、Markdownのみを使用する
    4. 本文は読みやすく、価値のある情報を提供する内容にする
    5. JSONフォーマットで出力する(subject と body_markdown のみ)
    
    注意事項:
    - 余計な会話や説明は含めない
    - JSONのみを出力する
    - Markdownは見出し、リスト、強調などを適切に使用する

    Execution prompt · Source text。JSON Output Parser node inputSchema parameter

    {
    	"type": "object",
    	"properties": {
    		"subject": {
    			"type": "string",
    			"description": "Email subject line that captures attention"
    		},
    		"body_markdown": {
    			"type": "string",
    			"description": "Newsletter body content in Markdown format"
    		}
    	}
    }
  5. Configure approval email and wait node

    The Convert Markdown to HTML node transforms body_markdown to HTML. The Send Approval Email node (Gmail) sends a preview with an approval link using $execution.resumeUrl to admin_email. The Wait for Approval node uses webhook resume mode with resumeAmount set to 24 hours.

    Execution prompt · Source text。Send Approval Email node message parameter (HTML email body)

    =<h2>メルマガ承認依頼</h2>
    <p>以下の内容で承認をお願いします。</p>
    
    <h3>件名プレビュー:</h3>
    <p><strong>{{ $json.subject }}</strong></p>
    
    <h3>本文プレビュー:</h3>
    <div style="border: 1px solid #ccc; padding: 15px; margin: 10px 0;">
    {{ $json.data }}
    </div>
    
    <h3>送信者情報:</h3>
    <p>送信者名: {{ $('Workflow Configuration').first().json.sender }}</p>
    <p>ターゲット: {{ $('Workflow Configuration').first().json.target }}</p>
    
    <hr>
    <p><a href="{{ $execution.resumeUrl }}" style="background-color: #4CAF50; color: white; padding: 10px 20px; text-decoration: none; border-radius: 5px; display: inline-block;">✅ 承認して配信する</a></p>
    <p><small>※このリンクは24時間有効です。クリックすると即座に配信が開始されます。</small></p>
  6. Configure SendGrid delivery and test

    In the Send Newsletter to Subscribers node, replace fromEmail with your SendGrid verified sender address. subject, toEmail, fromName, and contentValue reference upstream nodes via expressions. Click Test Workflow, fill out the Form Trigger URL, check your email for the approval draft, and click the link to complete the flow.

Prompt you can copy

Setup guidance · Editorial suggestion。Hand to setup assistant; confirm inputs and permissions first

This block is the prompt. Ads are never placed here.

You are an n8n workflow setup assistant. The user wants to replicate an AI newsletter generation and approval workflow. Help them:
1. Confirm they have OpenAI, Google Cloud, and SendGrid credentials ready;
2. Configure the Set node subscriber list, Google Sheets document ID, and SendGrid sender email in order;
3. If they want to change the AI tone, guide them to edit the systemMessage in the Generate Newsletter Content node;
4. When testing, remind them to check spam folders and note the 24-hour expiry on the approval link.
Do not perform sends on their behalf; only provide configuration guidance.

Check credentials first, then configure placeholders in node order

Source

Create AI newsletters with GPT-4o, human approval workflow, and SendGrid · korin · n8n.io · 2025-11-20

Comments & feedback

Tried this method? Share results, problems or improvements. Comments appear after moderation. Please avoid sensitive information.

Loading…

    Related