This workflow corresponds to n8n.io template #6115 — we link there as the canonical source.
This workflow follows the Agent → Google Sheets recipe pattern — see all workflows that pair these two integrations.
The workflow JSON
Copy or download the full n8n JSON below. Paste it into a new n8n workflow, add your credentials, activate. Full import guide →
{
"meta": {
"templateCredsSetupCompleted": true
},
"nodes": [
{
"id": "63865e5c-9e83-49ad-8d51-02391ee9e36c",
"name": "When clicking \u2018Execute workflow\u2019",
"type": "n8n-nodes-base.manualTrigger",
"position": [
-1728,
464
],
"parameters": {},
"typeVersion": 1
},
{
"id": "e935f831-25e0-4325-b0a4-72dd632c6c46",
"name": "Fetch Google Search Results JSON",
"type": "n8n-nodes-base.httpRequest",
"onError": "continueErrorOutput",
"position": [
-816,
480
],
"parameters": {
"url": "https://api.brightdata.com/request",
"method": "POST",
"options": {
"batching": {
"batch": {}
},
"redirect": {
"redirect": {}
}
},
"sendBody": true,
"sendQuery": true,
"sendHeaders": true,
"authentication": "genericCredentialType",
"bodyParameters": {
"parameters": [
{
"name": "zone",
"value": "serp_api1"
},
{
"name": "url",
"value": "=https://www.google.com/search?q={{ $json.search_term .replaceAll(\" \", \"+\")}}&start=0&brd_json=1"
},
{
"name": "country",
"value": "={{ $json['country code'] }}"
},
{
"name": "format",
"value": "raw"
}
]
},
"genericAuthType": "httpHeaderAuth",
"queryParameters": {
"parameters": [
{
"name": "async",
"value": "true"
}
]
},
"headerParameters": {
"parameters": [
{
"name": "Accept",
"value": "application/json"
}
]
}
},
"credentials": {
"httpHeaderAuth": {
"name": "<your credential>"
}
},
"typeVersion": 4.2,
"alwaysOutputData": true
},
{
"id": "ee4881f0-9148-493e-825e-ce2dde83fbae",
"name": "Get Keywords",
"type": "n8n-nodes-base.googleSheets",
"position": [
-1520,
464
],
"parameters": {
"options": {},
"sheetName": {
"__rl": true,
"mode": "list",
"value": "gid=0",
"cachedResultUrl": "https://docs.google.com/spreadsheets/d/1QU9rwawCZLiYW8nlYYRMj-9OvAUNZoe2gP49KbozQqw/edit#gid=0",
"cachedResultName": "Keywords to Track"
},
"documentId": {
"__rl": true,
"mode": "list",
"value": "1QU9rwawCZLiYW8nlYYRMj-9OvAUNZoe2gP49KbozQqw",
"cachedResultUrl": "https://docs.google.com/spreadsheets/d/1QU9rwawCZLiYW8nlYYRMj-9OvAUNZoe2gP49KbozQqw/edit?usp=drivesdk",
"cachedResultName": "Position Tracking for Keyword + Dashboard "
}
},
"credentials": {
"googleSheetsOAuth2Api": {
"name": "<your credential>"
}
},
"typeVersion": 4.6
},
{
"id": "69fff95a-24de-4331-89a8-14d4ea25c066",
"name": "Loop Over Items",
"type": "n8n-nodes-base.splitInBatches",
"position": [
-1280,
464
],
"parameters": {
"options": {}
},
"typeVersion": 3
},
{
"id": "9b6c4df9-90af-431a-9d85-54ea38c49155",
"name": "Google Gemini Chat Model",
"type": "@n8n/n8n-nodes-langchain.lmChatGoogleGemini",
"position": [
-400,
624
],
"parameters": {
"options": {}
},
"credentials": {
"googlePalmApi": {
"name": "<your credential>"
}
},
"typeVersion": 1
},
{
"id": "4f164104-6881-4636-b238-d75c7d52f866",
"name": "Generate New title and metadescriptins",
"type": "@n8n/n8n-nodes-langchain.agent",
"position": [
-400,
464
],
"parameters": {
"text": "=You are an advanced SEO strategist and content optimization engine.\n\nYour task is to:\n1. Analyze the list of top-ranking page titles and meta descriptions for a given keyword.\n2. Infer common SEO patterns, content structure, and user search intent.\n3. Use these insights to generate a highly optimized new **Title** and **Meta Description** that:\n - Aligns with the dominant SERP format\n - Matches search intent\n - Stands out enough to drive clicks (CTR-optimized)\n - Includes the target keyword naturally\n - Sounds trustworthy, relevant, and modern\n\n---\n\n### Input Keyword:\n{{ $('set keyword').item.json.search_term }}\n### Top SERP Results (Titles + Descriptions):\n{{ $json.titlesDescriptions }}\n\n### \"People Also Ask\" Questions:\n{{ $json.paaQuestions }}\n\n---\n\n### Output Format:\n{\n \"intent\": \"[Label the dominant search intent. Examples: Listicle, How-to, Informational, Commercial, Review, Product Page, Case Study, etc.]\",\n \"dominant_patterns\": {\n \"title_structure\": \"[Respond only with the generalized pattern using placeholders. No full sentences. No explanations.]\",\n \"meta_structure\": \"[Respond only with the generalized meta pattern using placeholders. No full sentences. No explanations.]\"\n},\n \"optimized_title\": \"[SEO-optimized title for the keyword]\",\n \"optimized_meta\": \"[Well-written meta description under 160 characters]\",\n \"cta\": \"[Optional call-to-action if helpful]\"\n}\n",
"options": {},
"promptType": "define",
"hasOutputParser": true
},
"typeVersion": 2
},
{
"id": "d150f732-b580-430b-9a2d-d225b73839f9",
"name": "Structured Output Parser1",
"type": "@n8n/n8n-nodes-langchain.outputParserStructured",
"position": [
-192,
656
],
"parameters": {
"jsonSchemaExample": "{\n \"intent\": \"[Label the dominant search intent. Examples: Listicle, How-to, Informational, Commercial, Review, Product Page, Case Study, etc.]\",\n \"dominant_patterns\": {\n \"title_structure\": \"[Respond only with the generalized pattern using placeholders. No full sentences. No explanations.]\",\n \"meta_structure\": \"[Respond only with the generalized meta pattern using placeholders. No full sentences. No explanations.]\"\n},\n \"optimized_title\": \"[SEO-optimized title for the keyword]\",\n \"optimized_meta\": \"[Well-written meta description under 160 characters]\",\n \"cta\": \"[Optional call-to-action if helpful]\"\n}"
},
"typeVersion": 1.3
},
{
"id": "8529bfb4-a3cb-4bc1-b83e-a6ed777bf1a8",
"name": "meta structure",
"type": "n8n-nodes-base.set",
"position": [
-80,
464
],
"parameters": {
"options": {},
"assignments": {
"assignments": [
{
"id": "660979bb-be4d-4551-b15a-1963b9c1b4d1",
"name": "Keyword",
"type": "string",
"value": "={{ $('Loop Over Items').item.json.search_term }}"
},
{
"id": "334b8afd-d8ae-4b75-8f03-3f9315870268",
"name": "intent",
"type": "string",
"value": "={{ $json.output.intent }}"
},
{
"id": "b2f9402c-7f22-4081-b5ac-494c6a3f9869",
"name": "dominant_patterns - meta_structure",
"type": "string",
"value": "={{ $json.output.dominant_patterns.meta_structure }}"
},
{
"id": "018ce0e2-5af2-40df-adc5-2ab1d8977d05",
"name": "dominant_patterns - title_structure",
"type": "string",
"value": "={{ $json.output.dominant_patterns.title_structure }}"
},
{
"id": "6890732d-c773-4254-bb3d-2acdcab32ef2",
"name": "optimized_title",
"type": "string",
"value": "={{ $json.output.optimized_title }}"
},
{
"id": "99ef63dc-c8e3-48e5-8d29-9c7019b019b2",
"name": "optimized_meta",
"type": "string",
"value": "={{ $json.output.optimized_meta }}"
},
{
"id": "d4768bd4-23c0-4bf1-8e88-51c21e314cf9",
"name": "cta",
"type": "string",
"value": "={{ $json.output.cta }}"
}
]
}
},
"typeVersion": 3.4
},
{
"id": "b1271960-96c0-48a4-9bd6-07325b0ea5e1",
"name": "Create new meta and Structure",
"type": "n8n-nodes-base.googleSheets",
"position": [
112,
464
],
"parameters": {
"columns": {
"value": {},
"schema": [
{
"id": "Keyword",
"type": "string",
"display": true,
"removed": false,
"required": false,
"displayName": "Keyword",
"defaultMatch": false,
"canBeUsedToMatch": true
},
{
"id": "country code",
"type": "string",
"display": true,
"removed": false,
"required": false,
"displayName": "country code",
"defaultMatch": false,
"canBeUsedToMatch": true
},
{
"id": "domain",
"type": "string",
"display": true,
"required": false,
"displayName": "domain",
"defaultMatch": false,
"canBeUsedToMatch": true
},
{
"id": "page",
"type": "string",
"display": true,
"required": false,
"displayName": "page",
"defaultMatch": false,
"canBeUsedToMatch": true
},
{
"id": "Position",
"type": "string",
"display": true,
"required": false,
"displayName": "Position",
"defaultMatch": false,
"canBeUsedToMatch": true
},
{
"id": "intent",
"type": "string",
"display": true,
"removed": false,
"required": false,
"displayName": "intent",
"defaultMatch": false,
"canBeUsedToMatch": true
},
{
"id": "dominant_patterns - meta_structure",
"type": "string",
"display": true,
"removed": false,
"required": false,
"displayName": "dominant_patterns - meta_structure",
"defaultMatch": false,
"canBeUsedToMatch": true
},
{
"id": "dominant_patterns - title_structure",
"type": "string",
"display": true,
"removed": false,
"required": false,
"displayName": "dominant_patterns - title_structure",
"defaultMatch": false,
"canBeUsedToMatch": true
},
{
"id": "optimized_title",
"type": "string",
"display": true,
"removed": false,
"required": false,
"displayName": "optimized_title",
"defaultMatch": false,
"canBeUsedToMatch": true
},
{
"id": "optimized_meta",
"type": "string",
"display": true,
"removed": false,
"required": false,
"displayName": "optimized_meta",
"defaultMatch": false,
"canBeUsedToMatch": true
},
{
"id": "CTA",
"type": "string",
"display": true,
"removed": false,
"required": false,
"displayName": "CTA",
"defaultMatch": false,
"canBeUsedToMatch": true
},
{
"id": "cta",
"type": "string",
"display": true,
"removed": false,
"required": false,
"displayName": "cta",
"defaultMatch": false,
"canBeUsedToMatch": true
}
],
"mappingMode": "autoMapInputData",
"matchingColumns": [
"Keyword"
],
"attemptToConvertTypes": false,
"convertFieldsToString": false
},
"options": {},
"operation": "appendOrUpdate",
"sheetName": {
"__rl": true,
"mode": "list",
"value": "gid=0",
"cachedResultUrl": "https://docs.google.com/spreadsheets/d/1QU9rwawCZLiYW8nlYYRMj-9OvAUNZoe2gP49KbozQqw/edit#gid=0",
"cachedResultName": "Keywords to Track"
},
"documentId": {
"__rl": true,
"mode": "list",
"value": "1QU9rwawCZLiYW8nlYYRMj-9OvAUNZoe2gP49KbozQqw",
"cachedResultUrl": "https://docs.google.com/spreadsheets/d/1QU9rwawCZLiYW8nlYYRMj-9OvAUNZoe2gP49KbozQqw/edit?usp=drivesdk",
"cachedResultName": "Position Tracking for Keyword + Dashboard "
}
},
"credentials": {
"googleSheetsOAuth2Api": {
"name": "<your credential>"
}
},
"typeVersion": 4.6
},
{
"id": "70796069-27d9-4076-8936-e5ec75ab42e8",
"name": "Sticky Note",
"type": "n8n-nodes-base.stickyNote",
"position": [
-608,
384
],
"parameters": {
"width": 980,
"height": 504,
"content": "## Analyze title and meta description formats for top 10 pages"
},
"typeVersion": 1
},
{
"id": "ad89de82-a005-4851-8c40-102b83f3c912",
"name": "Sticky Note4",
"type": "n8n-nodes-base.stickyNote",
"position": [
-1584,
384
],
"parameters": {
"width": 200,
"height": 320,
"content": "- Make a copy of this [G sheet](https://docs.google.com/spreadsheets/d/1QU9rwawCZLiYW8nlYYRMj-9OvAUNZoe2gP49KbozQqw/edit?usp=sharing)\n\n- Add your desired keywords"
},
"typeVersion": 1
},
{
"id": "571a1981-a9f3-4b66-8c9f-3d4779425df6",
"name": "Sticky Note5",
"type": "n8n-nodes-base.stickyNote",
"position": [
-1344,
288
],
"parameters": {
"color": 5,
"width": 200,
"height": 340,
"content": "- We loop over each item one at a time"
},
"typeVersion": 1
},
{
"id": "5b39d950-56e9-4069-81f0-8a061a56795d",
"name": "set keyword",
"type": "n8n-nodes-base.set",
"position": [
-1008,
480
],
"parameters": {
"options": {},
"assignments": {
"assignments": [
{
"id": "cee3c6fe-dc44-43b2-9243-a1f1a62f9fa1",
"name": "search_term",
"type": "string",
"value": "={{ $json.Keyword }}"
},
{
"id": "3c58a493-6d15-4b90-bc5a-154d6f6d6474",
"name": "country code",
"type": "string",
"value": "={{ $json['country code'] }}"
}
]
}
},
"typeVersion": 3.4
},
{
"id": "72f54c66-32df-45a4-8b1d-84a02cc7c4b8",
"name": "Sticky Note6",
"type": "n8n-nodes-base.stickyNote",
"position": [
-1024,
400
],
"parameters": {
"color": 4,
"width": 340,
"height": 320,
"content": "- Map keyword and country code \n- Update the Zone name to match your zone on Bright Data\n- Run the scraper"
},
"typeVersion": 1
},
{
"id": "49eb27cd-0ced-498d-a85e-92c0928847a4",
"name": "Map out keyword",
"type": "n8n-nodes-base.set",
"position": [
-576,
464
],
"parameters": {
"options": {},
"assignments": {
"assignments": [
{
"id": "4a5b9b7c-184e-4269-bee1-36684b1c99fc",
"name": "titlesDescriptions",
"type": "array",
"value": "={{ $json.organic.map(item => ({ title: item.title, description: item.description })) }}"
},
{
"id": "27ae3f27-d185-4ef0-8aaa-7e65c87fa6f2",
"name": "paaQuestions",
"type": "array",
"value": "={{ $json.people_also_ask.map(item => item.question )}}"
},
{
"id": "cd6102fa-8c47-44ca-b302-53b52dcaeb4f",
"name": "search_term",
"type": "string",
"value": "={{ $('set keyword').item.json.search_term }}"
}
]
}
},
"typeVersion": 3.4
},
{
"id": "ae34e2d9-17ec-4013-a1cc-1ed7b1adfcae",
"name": "No Operation, do nothing1",
"type": "n8n-nodes-base.noOp",
"position": [
-784,
784
],
"parameters": {},
"typeVersion": 1
}
],
"connections": {
"set keyword": {
"main": [
[
{
"node": "Fetch Google Search Results JSON",
"type": "main",
"index": 0
}
]
]
},
"Get Keywords": {
"main": [
[
{
"node": "Loop Over Items",
"type": "main",
"index": 0
}
]
]
},
"meta structure": {
"main": [
[
{
"node": "Create new meta and Structure",
"type": "main",
"index": 0
}
]
]
},
"Loop Over Items": {
"main": [
[],
[
{
"node": "set keyword",
"type": "main",
"index": 0
},
{
"node": "Loop Over Items",
"type": "main",
"index": 0
}
]
]
},
"Map out keyword": {
"main": [
[
{
"node": "Generate New title and metadescriptins",
"type": "main",
"index": 0
}
]
]
},
"Google Gemini Chat Model": {
"ai_languageModel": [
[
{
"node": "Generate New title and metadescriptins",
"type": "ai_languageModel",
"index": 0
}
]
]
},
"Structured Output Parser1": {
"ai_outputParser": [
[
{
"node": "Generate New title and metadescriptins",
"type": "ai_outputParser",
"index": 0
}
]
]
},
"Fetch Google Search Results JSON": {
"main": [
[
{
"node": "Map out keyword",
"type": "main",
"index": 0
}
],
[
{
"node": "No Operation, do nothing1",
"type": "main",
"index": 0
}
]
]
},
"When clicking \u2018Execute workflow\u2019": {
"main": [
[
{
"node": "Get Keywords",
"type": "main",
"index": 0
}
]
]
},
"Generate New title and metadescriptins": {
"main": [
[
{
"node": "meta structure",
"type": "main",
"index": 0
}
]
]
}
}
}
Credentials you'll need
Each integration node will prompt for credentials when you import. We strip credential IDs before publishing — you'll add your own.
googlePalmApigoogleSheetsOAuth2ApihttpHeaderAuth
For the full experience including quality scoring and batch install features for each workflow upgrade to Pro
About this workflow
This workflow contains community nodes that are only compatible with the self-hosted version of n8n.
Source: https://n8n.io/workflows/6115/ — original creator credit. Request a take-down →
Related workflows
Workflows that share integrations, category, or trigger type with this one. All free to copy and import.
This automation is designed to help you generate AI-powered music tracks, cover art, and fully rendered music videos — all triggered from a simple Telegram chat and managed via Google Sheets.
This Shopify AI automation is an advanced n8n-powered workflow that transforms Shopify product collections into SEO-optimized blog articles with images, while maintaining full visibility and control t
LinkedIn URL → Scrape → Match → Screen → Decide, all automated
This workflow contains community nodes that are only compatible with the self-hosted version of n8n.
This workflow is a fully automated YouTube Shorts production pipeline. It takes the structured output from a video digestion workflow (transcript, key moments, metadata) and produces finished, rendere