ChatGPTCreativeWritingAI score · 80/100AI-assisted edit · no obvious prompt-injection riskn8n.io

n8n AI SEO Content Optimization with SERP Analysis & Slack Approval

Input SEO draft → AI optimizes using history, SERP data, and knowledge base → structured JSON output → Slack human approval → save to Google Sheets

ExperiencedStepsWorkflowPrompt
Who
Marketing teams, content ops, or agencies that need to batch-optimize SEO content with version history
You get
Transforms existing drafts into structured SEO-optimized versions, with Slack approval and automatic save to Sheets including version numbers and metadata
You need
n8n · google-sheets · pinecone · serpapi · slack

Constraints

Prerequisites: n8n instance; OpenAI API key; Google Sheets OAuth2; SerpAPI key; Slack Bot Token with chat:write; Pinecone API key with existing index; a Google Sheet with a content_versions tab. Costs: pay-per-use for each API; OpenAI uses gpt-4o-mini. Limitations: template contains placeholders [Your Google Sheet ID], [Your Slack Channel ID], and a Pinecone index name that must be replaced. Save Approved Draft to Sheet has field mapping mismatches (tone←improvements, topic←title, context_used←content_id) — verify column names before running. Check Human Approval Status lacks a reject branch. AI Agent output triggers both Sheets save and Slack approval in parallel, creating risk of saving before approval. Not tested by this site.

What they did

Template author rahul08 built an n8n workflow template that receives content optimization requests via Chat Trigger, uses an AI Agent (GPT-4o-mini) calling Google Sheets, Pinecone vector store, and SerpAPI tools to gather context and competitor data, produces structured JSON output, then routes through Slack human approval before saving to Sheets and sending a success notification. The template includes complete node wiring, a JSON schema example, and 14-field Sheets mapping.

How it went

Source provides no actual runtime results or user feedback; n8n.io shows 308 views (author_report).

Worth knowing

1. Google Sheet ID, Slack Channel ID, and Pinecone index name in the template are placeholders and must be replaced. 2. The Pinecone node caches index name whatsappchatbot, which appears to be residual example data — replace with your actual index. 3. The system message is attributed to 'Vivek Patidar' while template author is rahul08, suggesting prompt reuse from another project. 4. Version incrementing logic described in system message as VER-00X format, but full implementation not shown in nodes — verify version control formulas in Sheets. 5. Save Approved Draft to Sheet has field mapping mismatches: tone←improvements, topic←title, context_used←content_id. 6. Check Human Approval Status only has approval branch configured, with no reject handling. 7. AI Agent output triggers both Sheets save and Slack approval in parallel, risking save before approval. 8. Not tested by this site; reproduction=not_tested.

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

  • After import, connect your own credentials on auth-required nodes; author secrets are not included.

Configuration to replace

  • Source template is n8n public workflow #10832 (~20 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 trigger and input parameters

    After importing the template into n8n, set up the Chat Trigger node as the entry point. Open the Set Input Parameters (Edit Fields) node and set test values for topic, content (content ID), intent (e.g., optimize), and parameter (optional optimization goals and focus keywords). Save and trigger the workflow via chat or manual execution.

  2. Connect data sources and credentials

    Configure these 5 credentials in n8n's credential manager: OpenAI API, Google Sheets OAuth2, SerpAPI, Slack OAuth, Pinecone API. Then update node parameters: in Retrieve Context from Google Sheets, replace documentId with your Sheet ID and confirm sheet name is content_versions; in Query Company Knowledge Base, confirm pineconeIndex points to your index (template cache shows whatsappchatbot — replace it), and verify OpenAI Embeddings for Vector Search is connected with dimensions=512; SerpAPI Competitor Analysis can use defaults or be adjusted as needed. Short-Term Memory uses a custom sessionKey to maintain conversation continuity.

  3. Configure AI optimization agent and structured output

    The AI Content Optimization Agent node is already connected to GPT-4o-mini, Sheets tool, Pinecone tool, SerpAPI tool, Short-Term Memory, and Structured Output Parser. Verify two prompt configurations: the User Prompt (text field) receives current input variables and calls Sheets content; the System Message (options.systemMessage) defines optimization rules, SERP data usage, and versioning logic. The Enforce JSON Output Structure node provides an output schema example containing optimized_draft (title, meta_description, sections, word_count, keywords_used, improvements) and metadata (content_id, version_no, version_id, timestamp). Adjust fields by modifying the node's jsonSchemaExample if needed.

    Execution prompt · Source text。AI Content Optimization Agent node text field (User Prompt)

    =Topic: {{ $json.topic }}
    Intent: {{ $json.intent }}
    Content ID: {{ $json.content }}
    Optimization Goal: {{ $json.parameter.goal || 'Improve SEO, tone, and readability' }}
    Focus Keywords: {{ $json.parameter.focus_keywords ? $json.parameter.focus_keywords.join(', ') : 'N/A' }}
    
    Context (from Sheets or memory): {{ $json.context || $memory || 'No context found' }}
    
    Using the content retrieved from Sheets, optimize the article to follow the tone and outline guidelines. 
    Ensure it aligns with the optimization goal while maintaining factual accuracy and original intent.
    Return the optimized article in structured JSON format.

    Execution prompt · Source text。AI Content Optimization Agent node options.systemMessage field

    =You are "Optimization Agent", a senior content optimizer AI inside an n8n automation system built by Vivek Patidar.
    
    Your job:
    Improve the provided draft WITHOUT rewriting it from scratch by using:
    1. The existing draft text from the workflow input
    2. Historical versions from Google Sheets ("content_versions")
    3. SERP intelligence from SerpAPI (competitors, headings, snippets, PAA, related searches)
    4. Brief or metadata passed from the previous stage
    
    You must produce a refined, SEO-optimized, well-structured and factually consistent version of the draft.
    
    --------------------------------
    📎 HOW TO USE SERP DATA
    --------------------------------
    You receive SERP data via upstream tools (SerpAPI). Use it to:
    
    - Identify missing topical sections compared to competitors.
    - Enhance keyword coverage and semantic depth.
    - Improve H2/H3 section clarity and completeness.
    - Strengthen meta description using competitor insight.
    - Suggest improvements based on PAA questions (People Also Ask).
    - Add missing angles/topics found across rankings.
    - Improve EEAT signals (expertise, trustworthiness) when relevant.
    - DO NOT output any raw SERP JSON.
    
    SERP data should influence optimization decisions, but never override the original meaning of the draft.
    
    --------------------------------
    📝 OPTIMIZATION RULES
    --------------------------------
    1. **Never rewrite from scratch.** Always keep the core meaning and structure.
    2. **Preserve tone** from the original draft or brief.
    3. **Preserve factual accuracy** – no hallucinations.
    4. **Only improve**, refine, reorganize, expand, clarify, or SEO-enhance.
    5. **Use keywords naturally**, avoid keyword stuffing.
    6. **If brief or previous versions exist**, align with them.
    7. **If SERP data suggests missed content**, incorporate it softly into relevant sections.
    8. **If the draft is messy**, reorganize into sections while preserving original paragraphs as much as possible.
    9. **Never expose intermediate reasoning** or tool data.
    
    --------------------------------
    🧾 VERSIONING LOGIC
    --------------------------------
    Use Google Sheets context to determine versioning:
    
    - If content_id already exists:
      - Increment version_no (ex: 2 → 3)
      - Create new version_id as "VER-00X"_
  4. Configure Slack approval workflow

    The Request Human Approval via Slack node uses the sendAndWait operation to send the optimized title, meta description, and metadata to a specified channel. Team members can approve or reject in Slack. The Check Human Approval Status node checks whether $json.data.approved is true; if true, it sends a success notification. Note: this IF node only has the approval branch configured (true→success), with no handling path for rejection — the workflow will have no subsequent action if rejected. Replace channelId from [Your Slack Channel ID] with the actual channel ID.

  5. Configure Sheets save and version management

    The Save Approved Draft to Sheet node performs appendOrUpdate using content_id as the matching column. Source field mappings are: topic←title, meta_title←title, meta_desc←meta_description, keywords←keywords_used, tone←improvements, word_count←word_count, section←sections, timestamp←timestamp, content_id←content_id, version_id←version_id, version_no←version_no, context_used←content_id. Note that tone is actually mapped to improvements and context_used to content_id, creating semantic mismatches — verify your Sheet column names match these mappings before running. Additionally, this node shares the same main output from the AI Agent as Request Human Approval via Slack, creating a parallel trigger that risks saving before approval; consider rewiring to serial based on your business needs.

  6. Test and deploy

    Run the full workflow manually once to verify: SERP data returns correctly, Pinecone retrieval hits relevant content, AI output conforms to JSON schema, Slack approval messages are delivered, and Sheets field mappings are correct. Once confirmed, activate the Chat Trigger to enable on-demand content optimization via chat interface.

Prompt you can copy

Setup guidance · Editorial suggestion。Give to setup assistant; confirm inputs and permissions, and flag known structural limitations

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

You are an assistant familiar with n8n and SEO workflow setup. The user wants to replicate n8n template #10832 (AI SEO content optimization + SERP analysis + Slack approval). First confirm whether the user has prepared: OpenAI API key, Google Sheets OAuth2, SerpAPI key, Slack Bot Token, and Pinecone API key. Then guide them to replace template placeholders (Sheet ID, Slack Channel ID, Pinecone index name), paying special attention to field mapping mismatches in Save Approved Draft to Sheet (tone←improvements, etc.). Check whether the AI Agent's User Prompt and System Message need business-specific adjustments. Warn the user that Check Human Approval Status lacks a reject branch, and that parallel triggering from the AI Agent creates risk of saving before approval. Finally suggest manual testing before activating the trigger.

This prompt starts a setup conversation, not a node execution instruction. Actual execution prompts are in step 3 prompts.

Source

AI-powered SEO content optimization with SERP analysis & Slack approval workflow · rahul08 · n8n.io · 2025-11-14

Comments & feedback

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

Loading…

    Related