This workflow corresponds to n8n.io template #5195 — we link there as the canonical source.
This workflow follows the Chainllm → Form Trigger 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 →
{
"id": "icW2uoM7g7pFZhsR",
"meta": {
"templateCredsSetupCompleted": true
},
"name": "AI-Powered Product Research & SEO Content Automation",
"tags": [
{
"id": "QXtLNWbsCSABOTNm",
"name": "Digital Marketing",
"createdAt": "2025-05-29T11:14:57.099Z",
"updatedAt": "2025-05-29T11:14:57.099Z"
}
],
"nodes": [
{
"id": "f3824049-9114-447c-8c3f-e3a08af34d12",
"name": "Google Search",
"type": "n8n-nodes-base.httpRequest",
"position": [
400,
-120
],
"parameters": {
"url": "https://www.googleapis.com/customsearch/v1",
"options": {},
"queryParametersUi": {
"parameter": [
{
"name": "key",
"value": "your key"
},
{
"name": "cx",
"value": "your cx"
},
{
"name": "q",
"value": "=intitle:\"{{ $json.title }}\" (pricing OR features OR buy OR software) -medium.com -quora.com -youtube.com -linkedin.com "
}
]
}
},
"typeVersion": 1
},
{
"id": "840baf66-d14c-4d2c-90f5-05ba174bcc15",
"name": "Extract Competitor Data",
"type": "n8n-nodes-base.function",
"position": [
680,
-100
],
"parameters": {
"functionCode": "let allTitles = [];\nlet allDescriptions = [];\nlet allKeywords = [];\n\nfor (const item of $json.items) {\n allTitles.push(item.title);\n allDescriptions.push(item.snippet);\n\n const keywords = item.title\n .toLowerCase()\n .replace(/[^a-zA-Z0-9 ]/g, '')\n .split(' ')\n .filter(w => w.length > 3);\n\n allKeywords.push(...keywords);\n}\n\n// Create unique keywords\nconst uniqueKeywords = [...new Set(allKeywords)];\n\nreturn [\n {\n json: {\n chatInput: `\nTitle List:\n${allTitles.join('\\n')}\n\nDescription List:\n${allDescriptions.join('\\n')}\n\nKeywords:\n${uniqueKeywords.join(', ')}\n `.trim()\n }\n }\n];\n"
},
"typeVersion": 1
},
{
"id": "0a2929a1-d6fc-4a37-b142-54b0e2135652",
"name": "Basic LLM Chain",
"type": "@n8n/n8n-nodes-langchain.chainLlm",
"position": [
920,
-100
],
"parameters": {
"messages": {
"messageValues": [
{
"message": "You are an expert SEO content writer and product copywriter. generate the following in one output: 1. SEO Meta Data: - Title: (exact product title, must be the same as product title below) - Description: A concise, persuasive meta description optimized for Google SEO best practices. Make sure it is between 120-160 characters, includes main keywords naturally, and encourages clicks. - Keywords: A list of relevant, highly ranked keywords related to the product. 2. Product Content: - Product Title: (exact same title as SEO Meta Data Title) - Product Description: A detailed, engaging product description of minimum 150 words that highlights the product\u2019s key features, benefits, and usage. Use natural language with relevant keywords but avoid keyword stuffing. Format the output exactly like this: --- SEO Meta Data: Title: ... Description: ... Keywords: ... Product Content: Product Title: ... Product Description: ... --- Ensure that the SEO Meta Data Title and Product Title are exactly the same string. Follow SEO best practices for titles, descriptions, and keyword usage to maximize Google ranking potential."
}
]
}
},
"typeVersion": 1.5
},
{
"id": "797456cf-d4a2-49b7-8134-d5ebbf062cc7",
"name": "Google Gemini Chat Model",
"type": "@n8n/n8n-nodes-langchain.lmChatGoogleGemini",
"position": [
940,
360
],
"parameters": {
"options": {},
"modelName": "models/gemini-2.0-flash"
},
"credentials": {
"googlePalmApi": {
"name": "<your credential>"
}
},
"typeVersion": 1
},
{
"id": "44d6ebd9-ad12-4838-aee0-9b8a4a847a6b",
"name": "Google Sheets",
"type": "n8n-nodes-base.googleSheets",
"position": [
1660,
-140
],
"parameters": {
"columns": {
"value": {},
"schema": [
{
"id": "type",
"type": "string",
"display": true,
"removed": false,
"required": false,
"displayName": "type",
"defaultMatch": false,
"canBeUsedToMatch": true
},
{
"id": "title",
"type": "string",
"display": true,
"removed": false,
"required": false,
"displayName": "title",
"defaultMatch": false,
"canBeUsedToMatch": true
},
{
"id": "description",
"type": "string",
"display": true,
"removed": false,
"required": false,
"displayName": "description",
"defaultMatch": false,
"canBeUsedToMatch": true
},
{
"id": "keywords",
"type": "string",
"display": true,
"removed": false,
"required": false,
"displayName": "keywords",
"defaultMatch": false,
"canBeUsedToMatch": true
},
{
"id": "product_title",
"type": "string",
"display": true,
"removed": false,
"required": false,
"displayName": "product_title",
"defaultMatch": false,
"canBeUsedToMatch": true
},
{
"id": "product_description",
"type": "string",
"display": true,
"removed": false,
"required": false,
"displayName": "product_description",
"defaultMatch": false,
"canBeUsedToMatch": true
}
],
"mappingMode": "autoMapInputData",
"matchingColumns": [
"text"
],
"attemptToConvertTypes": false,
"convertFieldsToString": false
},
"options": {},
"operation": "appendOrUpdate",
"sheetName": {
"__rl": true,
"mode": "url",
"value": ""
},
"documentId": {
"__rl": true,
"mode": "url",
"value": ""
},
"authentication": "serviceAccount"
},
"credentials": {
"googleApi": {
"name": "<your credential>"
}
},
"typeVersion": 4.5
},
{
"id": "571bb379-f061-42ae-b633-3e80467a0a3d",
"name": "On form submission",
"type": "n8n-nodes-base.formTrigger",
"position": [
-180,
-140
],
"parameters": {
"options": {},
"formTitle": "Product Research ",
"formFields": {
"values": [
{
"fieldLabel": "title",
"placeholder": "Enter product title",
"requiredField": true
}
]
}
},
"typeVersion": 2.2
},
{
"id": "0a4b670a-50b3-4a60-ae51-e3bb958f573a",
"name": "Edit Fields",
"type": "n8n-nodes-base.set",
"position": [
120,
-140
],
"parameters": {
"options": {},
"assignments": {
"assignments": [
{
"id": "39f794ce-8c11-4f72-b8d9-4ad0894d1e05",
"name": "title",
"type": "string",
"value": "={{ $json.title }}"
}
]
}
},
"typeVersion": 3.4
},
{
"id": "85ecfcba-215a-4dbc-8bcf-4fe32b95687a",
"name": "Sticky Note",
"type": "n8n-nodes-base.stickyNote",
"position": [
-1160,
-500
],
"parameters": {
"width": 640,
"height": 1340,
"content": "# \ud83d\ude80 AI-Powered Product Research & SEO Content Automation\n\nAn **AI-powered automation** that performs product research, extracts competitor insights, and generates SEO-optimized product content using Google Search and a large language model (LLM) like Google Gemini or OpenAI. The output is cleanly structured and saved into Google Sheets\u2014ready for publishing.\n### Workflow Steps:\n1. **On form submission** \n *The user provides the product title via a form.*\n\n2. **Edit Fields** \n *The product title is prepared for the Google search query.*\n\n3. **Google Search** \n *A search is made on Google for competitor products and relevant information.*\n\n4. **Extract Competitor Data** \n *Competitor data, such as titles, descriptions, and keywords, is extracted from the search results.*\n\n5. **Basic LLM Chain** \n *SEO metadata and product content are generated using LangChain\u2019s language model.*\n\n6. **Google Gemini Chat Model** \n *Google Gemini (PaLM) refines the generated content for quality and engagement.*\n\n7. **Code** \n *The content is split into SEO Meta Data and Product Content sections.*\n\n8. **Google Sheets** \n *All the generated content is stored in Google Sheets for easy access.*\n\n---\n\n## How This Flow Resolves Challenges:\n\n- **Automates Time-Consuming Tasks:** \n This workflow eliminates manual research and content writing by automating the gathering of competitor data and SEO content generation.\n \n- **Improves SEO Outcomes:** \n By leveraging AI models like LangChain and Google Gemini, the workflow ensures that SEO metadata and product content are optimized for search engines.\n\n- **Efficient Organization:** \n The workflow splits content into clear sections and stores everything in Google Sheets, making it easy to access and manage data.\n\n- **Reduces Human Error:** \n Automation reduces the chances of missing important steps in content generation, ensuring consistency and accuracy.\n\n- **Centralized Data Management:** \n Storing everything in Google Sheets makes tracking, updating, and managing generated content straightforward and efficient.\n"
},
"typeVersion": 1
},
{
"id": "7f656ef7-50ce-40bd-a38b-74f3b4556311",
"name": "Sticky Note1",
"type": "n8n-nodes-base.stickyNote",
"position": [
-240,
-300
],
"parameters": {
"height": 340,
"content": "### 1. **On form submission**\n- *Trigger*: Collects the product title entered by the user via the form. This is the starting point of the workflow, where the process is initiated.\n\n"
},
"typeVersion": 1
},
{
"id": "e6567de3-ed0d-4bcd-9f10-1e8abc374539",
"name": "Sticky Note2",
"type": "n8n-nodes-base.stickyNote",
"position": [
60,
-300
],
"parameters": {
"height": 340,
"content": "### 2. **Edit Fields**\n- *Action*: Formats the product title to fit the required query parameters for the Google search. This ensures the title is ready for the next step.\n"
},
"typeVersion": 1
},
{
"id": "2d75a14d-8d4b-4ea0-aad9-a3626e0caa1c",
"name": "Sticky Note3",
"type": "n8n-nodes-base.stickyNote",
"position": [
340,
-300
],
"parameters": {
"height": 340,
"content": "### 3. **Google Search**\n- *Action*: Executes a Google Custom Search API query to retrieve competitor data based on the product title. This helps in gathering insights from similar products or competitors.\n"
},
"typeVersion": 1
},
{
"id": "e3f73de9-6b55-45ee-aa31-b9ee4268d6fe",
"name": "Code Formatting",
"type": "n8n-nodes-base.code",
"position": [
1340,
-100
],
"parameters": {
"jsCode": "const inputText = $json.text; // Your combined text input\n\nfunction getFieldValue(text, field) {\n const regex = new RegExp(field + ':\\\\s*([\\\\s\\\\S]*?)(?=\\\\n\\\\S|$)', 'i');\n const match = text.match(regex);\n return match ? match[1].trim() : '';\n}\n\nfunction splitSections(text) {\n // Extract sections by titles\n const seoMetaMatch = text.match(/SEO Meta Data:\\n([\\s\\S]*?)\\n\\nProduct Content:/i);\n const productContentMatch = text.match(/Product Content:\\n([\\s\\S]*)/i);\n\n const seoMeta = seoMetaMatch ? seoMetaMatch[1].trim() : '';\n const productContent = productContentMatch ? productContentMatch[1].trim() : '';\n\n return [\n {\n json: {\n type: 'seo_meta_data',\n title: getFieldValue(seoMeta, 'Title'),\n description: getFieldValue(seoMeta, 'Description'),\n keywords: getFieldValue(seoMeta, 'Keywords'),\n product_title: '', // empty for SEO row\n product_description: '' // empty for SEO row\n }\n },\n {\n json: {\n type: 'product_content',\n title: '', // empty for Product row\n description: '',\n keywords: '',\n product_title: getFieldValue(productContent, 'Product Title'),\n product_description: getFieldValue(productContent, 'Product Description')\n }\n }\n ];\n}\n\nreturn splitSections($input.first().json.text);\n"
},
"typeVersion": 2
},
{
"id": "4811155c-a560-430c-b284-0730fc10b0c7",
"name": "Sticky Note4",
"type": "n8n-nodes-base.stickyNote",
"position": [
620,
-300
],
"parameters": {
"height": 340,
"content": "### 4. **Extract Competitor Data**\n- *Action*: Extracts key information (titles, descriptions, and keywords) from the search results. This data provides valuable insights into competitor strategies and product offerings.\n"
},
"typeVersion": 1
},
{
"id": "1f0f8a48-2d72-4695-85c0-9e4d260da954",
"name": "Sticky Note5",
"type": "n8n-nodes-base.stickyNote",
"position": [
900,
-300
],
"parameters": {
"width": 320,
"height": 340,
"content": "### 5. **Basic LLM Chain**\n- *Action*: Uses LangChain\u2019s language model to generate SEO metadata (title, description, keywords) and product content (description, title). The content is optimized for search engines.\n"
},
"typeVersion": 1
},
{
"id": "74c7341e-281e-4ec2-a24e-f4ea9d0df3a6",
"name": "Sticky Note6",
"type": "n8n-nodes-base.stickyNote",
"position": [
900,
160
],
"parameters": {
"width": 260,
"height": 320,
"content": "### 6. **Google Gemini Chat Model**\n- *Action*: Refines and improves the content generated in the previous step by using Google Gemini (PaLM) to enhance its quality and engagement.\n"
},
"typeVersion": 1
},
{
"id": "1dd0fee3-9c48-4748-b707-00abf0cd6475",
"name": "Sticky Note7",
"type": "n8n-nodes-base.stickyNote",
"position": [
1280,
-300
],
"parameters": {
"height": 340,
"content": "### 7. **Code Formating **\n- *Action*: Splits the generated content into two sections: SEO Meta Data and Product Content, organizing the output into clearly defined sections for easy use.\n\n"
},
"typeVersion": 1
},
{
"id": "7360db3c-7c8a-4a00-9bd3-a462df36df05",
"name": "Sticky Note8",
"type": "n8n-nodes-base.stickyNote",
"position": [
1600,
-300
],
"parameters": {
"height": 340,
"content": "### 8. **Google Sheets**\n- *Action*: Appends the final SEO metadata and product content into a Google Sheets document, making it easy to store, access, and track the generated information."
},
"typeVersion": 1
}
],
"active": false,
"settings": {
"executionOrder": "v1"
},
"versionId": "b27669ea-0c40-4b53-b972-ed79aedf17a7",
"connections": {
"Edit Fields": {
"main": [
[
{
"node": "Google Search",
"type": "main",
"index": 0
}
]
]
},
"Google Search": {
"main": [
[
{
"node": "Extract Competitor Data",
"type": "main",
"index": 0
}
]
]
},
"Basic LLM Chain": {
"main": [
[
{
"node": "Code Formatting",
"type": "main",
"index": 0
}
]
]
},
"Code Formatting": {
"main": [
[
{
"node": "Google Sheets",
"type": "main",
"index": 0
}
]
]
},
"On form submission": {
"main": [
[
{
"node": "Edit Fields",
"type": "main",
"index": 0
}
]
]
},
"Extract Competitor Data": {
"main": [
[
{
"node": "Basic LLM Chain",
"type": "main",
"index": 0
}
]
]
},
"Google Gemini Chat Model": {
"ai_languageModel": [
[
{
"node": "Basic LLM Chain",
"type": "ai_languageModel",
"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.
googleApigooglePalmApi
For the full experience including quality scoring and batch install features for each workflow upgrade to Pro
About this workflow
Skip the guesswork and manual effort — this n8n flow automates the entire process of researching your product's online competition and generating high-quality SEO content. Whether you're launching a new product or optimizing existing listings, this workflow leverages real-time…
Source: https://n8n.io/workflows/5195/ — 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.
Automate your lead intake, scoring, and outreach pipeline. This workflow collects leads from forms, enriches and scores them using Relevance AI, routes them by quality, and triggers the right follow-u
Sales teams and B2B marketers who spend hours researching leads manually. If you've looked at Clay but didn't want the $149/month price tag, this workflow does the same job as a one-time n8n template.
This workflow automates B2B lead research for Japanese companies. Submit a company name through a web form, and the workflow queries two free Japanese government APIs for corporate registry and busine
> Transform your content ideas into viral Facebook posts with AI-powered automation in just 30 minutes!
It uses the power of Google Gemini's multimodal capabilities to read the document, identify key fields, and organize the data into a structured format, saving it directly to a Google Sheet. Healthcare