This workflow corresponds to n8n.io template #6664 — we link there as the canonical source.
This workflow follows the Gmail → OpenAI 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 →
{
"nodes": [
{
"name": "Manual Trigger",
"type": "n8n-nodes-base.manualTrigger",
"notes": {
"text": "### 1. Start Workflow\n\nThis `Manual Trigger` node is used for easy testing of your product research.\n\n**To trigger the workflow manually:** Click the 'Execute Workflow' button in the top right.\n\n**For automation:** You could connect this to a `Webhook` (if you build a simple form for product descriptions) or a `Google Sheets` node (to read new product requests from a spreadsheet).",
"position": "right"
},
"position": [
240,
300
],
"parameters": {},
"typeVersion": 1
},
{
"name": "Set Product Description",
"type": "n8n-nodes-base.set",
"notes": {
"text": "### 2. Define Product Description\n\nThis `Set` node defines the product you're looking for using natural language.\n\n**How to use:**\n* **For testing:** Directly edit the 'Value' field with a detailed description of the product you want to find.\n* **For automation:** This could come from a previous node (e.g., a form submission via a `Webhook` or a cell in a `Google Sheet`) using an expression like `{{ $json.yourInputFieldName }}`.",
"position": "right"
},
"position": [
460,
300
],
"parameters": {
"values": [
{
"name": "productDescription",
"value": "Lightweight, durable hiking backpack for multi-day trips (30-40L), good ventilation, comfortable for long hikes."
}
],
"options": {}
},
"typeVersion": 2
},
{
"name": "AI: Generate Search Queries",
"type": "n8n-nodes-base.openAi",
"notes": {
"text": "### 3. AI: Generate Search Queries\n\nThis `OpenAI` node takes your natural language `productDescription` and uses AI to generate effective search queries.\n\n**Setup:**\n1. **OpenAI Credential:** Click on 'Credentials' and select 'New Credential'. Provide your OpenAI API Key (starts with `sk-`). Save it.\n2. **Model:** You can change `gpt-3.5-turbo` to `gpt-4o` for potentially better query generation (but higher cost).\n3. **Prompt:** The system prompt guides the AI to generate concise search queries suitable for a search engine.\n\n**Output:** The AI will output a string with queries separated by newlines.",
"position": "right"
},
"position": [
700,
300
],
"parameters": {
"model": "gpt-3.5-turbo",
"options": {},
"messages": [
{
"role": "system",
"content": "You are a search query optimizer. Given a product description, generate 3-5 concise and effective Google search queries to find that product. Output each query on a new line. Do not add any conversational text or numbering."
},
{
"role": "user",
"content": "Generate search queries for: {{ $json.productDescription }}"
}
]
},
"typeVersion": 1
},
{
"name": "Split Queries",
"type": "n8n-nodes-base.function",
"notes": {
"text": "### 4. Split Queries\n\nThis `Function` node takes the multi-line string of search queries generated by the AI and splits them into separate items. Each item will then be processed individually by the next node.\n\n**Output:** If the AI generated 3 queries, this node will output 3 separate items, each with a `query` field (e.g., `{{ $json.query }}`).\n\n**No configuration needed here**, it automatically processes the AI output.",
"position": "right"
},
"position": [
940,
300
],
"parameters": {
"options": {},
"function": "const queriesString = items[0].json.choices[0].message.content;\nconst queries = queriesString.split('\\n').filter(q => q.trim() !== '');\n\nconst outputItems = queries.map(query => ({ json: { query: query.trim() } }));\n\nreturn outputItems;"
},
"typeVersion": 1
},
{
"name": "Google Custom Search (CSE)",
"type": "n8n-nodes-base.googleCustomSearch",
"notes": {
"text": "### 5. Google Custom Search (CSE) - The Core!\n\nThis `Google Custom Search` node performs the actual web search using your configured Google Custom Search Engine.\n\n**Setup (CRITICAL!):**\n1. **Google API Credential:** Click 'Credentials' and select 'New Credential'. Choose 'Google API'. You'll need the **API Key** you generated in the Google Cloud Console (Step 1 in the overall setup).\n2. **Search Engine ID:** This is the ID you obtained from `cse.google.com` (Step 1 in the overall setup).\n3. **Query:** This field is pre-filled with `={{ $json.query }}`, pulling each query generated by the AI and splitting it.\n4. **Num:** (Optional) Limits the number of results per query. Default is 10; set to 5 for a more concise output.\n\n**Output:** This node will output search results, including `title`, `link`, and `snippet` for each result.",
"position": "right"
},
"position": [
1180,
300
],
"parameters": {
"query": "={{ $json.query }}",
"options": {
"num": 5
},
"operation": "search",
"searchEngineId": "YOUR_SEARCH_ENGINE_ID"
},
"credentials": {
"googleApi": {
"name": "<your credential>"
}
},
"typeVersion": 1
},
{
"name": "Combine Search Results",
"type": "n8n-nodes-base.set",
"notes": {
"text": "### 6. Combine Search Results\n\nThis `Set` node gathers all the search results from the multiple CSE queries into a single, combined item.\n\n**How it works:** `{{ $('Google Custom Search (CSE)').all() }}` is an advanced expression that collects *all* items from *all* executions of the 'Google Custom Search (CSE)' node into one array. This is essential for feeding all results to the AI for summarization.",
"position": "right"
},
"position": [
1420,
300
],
"parameters": {
"mode": "json",
"value": "={{ $('Google Custom Search (CSE)').all() }}",
"options": {}
},
"typeVersion": 2
},
{
"name": "AI: Summarize Products & Prices",
"type": "n8n-nodes-base.openAi",
"notes": {
"text": "### 7. AI: Summarize Products & Prices\n\nThis `OpenAI` node analyzes all the combined search results and synthesizes them into a readable report.\n\n**Purpose:** The AI will try to identify product types, common features, and potential places to buy, based on the `title`, `snippet`, and `link` data from the search results.\n\n**Input:** The 'User' prompt feeds all the search result data to the AI.\n\n**Output:** The AI-generated summary report.",
"position": "right"
},
"position": [
1660,
300
],
"parameters": {
"model": "gpt-3.5-turbo",
"options": {},
"messages": [
{
"role": "system",
"content": "You are a product research assistant. Analyze the provided search results (titles, snippets, links) for a product. Identify common themes, product types, key features, and suggest where the user might find the best prices (e.g., mention specific retailers or general price comparison sites if they appear in results). Structure your output as a concise report with bullet points for key findings and a list of top 3-5 relevant links."
},
{
"role": "user",
"content": "Based on the following search results for '{{ $node[\"Set Product Description\"].json.productDescription }}':\n\n{{ $json.map(item => `Title: ${item.title}\\nSnippet: ${item.snippet}\\nLink: ${item.link}`).join('\\n---\\n') }}"
}
]
},
"credentials": {
"openAiApi": {
"name": "<your credential>"
}
},
"typeVersion": 1
},
{
"name": "Send Report Email",
"type": "n8n-nodes-base.gmail",
"notes": {
"text": "### 8. Send Report Email\n\nThis `Gmail` node sends the final AI-generated product research report to your inbox.\n\n**Setup:**\n1. **Gmail Credential:** Select your existing Gmail API credential.\n2. **From Email:** Enter your Gmail address (this must be the same account you authenticated).\n3. **To Email:** **IMPORTANT: Change `YOUR_RECIPIENT_EMAIL@example.com` to your actual email address!**\n4. **Subject:** Includes the product description for easy reference.\n5. **Text:** The email body contains the summary generated by the AI.\n\n**After setting up, click 'Execute Workflow' (from the 'Manual Trigger' node) to receive your product research report!**",
"position": "right"
},
"position": [
1900,
300
],
"parameters": {
"text": "Hello!\n\nHere's your AI-powered product research report from n8n for:\n\"{{ $node[\"Set Product Description\"].json.productDescription }}\"\n\n---\n\n{{ $node[\"AI: Summarize Products & Prices\"].json.choices[0].message.content }}\n\n---\n\n*This report was generated automatically by n8n. Please use the provided links to explore products and prices further.*",
"options": {},
"subject": "AI Shopping Assistant: Product Research Report for \"{{ $node[\"Set Product Description\"].json.productDescription }}\"",
"toEmail": "user@example.com",
"fromEmail": "user@example.com"
},
"credentials": {
"gmailApi": {
"name": "<your credential>"
}
},
"typeVersion": 2
}
],
"version": 1,
"connections": {
"Split Queries": {
"main": [
[
{
"node": "Google Custom Search (CSE)",
"type": "main"
}
]
]
},
"Manual Trigger": {
"main": [
[
{
"node": "Set Product Description",
"type": "main"
}
]
]
},
"Combine Search Results": {
"main": [
[
{
"node": "AI: Summarize Products & Prices",
"type": "main"
}
]
]
},
"Set Product Description": {
"main": [
[
{
"node": "AI: Generate Search Queries",
"type": "main"
}
]
]
},
"Google Custom Search (CSE)": {
"main": [
[
{
"node": "Combine Search Results",
"type": "main"
}
]
]
},
"AI: Generate Search Queries": {
"main": [
[
{
"node": "Split Queries",
"type": "main"
}
]
]
},
"AI: Summarize Products & Prices": {
"main": [
[
{
"node": "Send Report Email",
"type": "main"
}
]
]
}
}
}
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.
gmailApigoogleApiopenAiApi
For the full experience including quality scoring and batch install features for each workflow upgrade to Pro
About this workflow
**How it works ** This intelligent workflow acts as your personal shopping assistant, helping you quickly research products and find potential purchasing options based on your detailed descriptions. It automatically: Takes your natural language product description (e.g., "a…
Source: https://n8n.io/workflows/6664/ — 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.
Marketing agencies, digital agencies, and freelancers who need to streamline their client onboarding process and create consistent, professional documentation for new clients. Perfect for teams handli
Content Teams, Researchers, and Administrators who need to automatically process voice memos, meeting recordings, or interview audio into structured, searchable documents.
This workflow auto-generates a personalized research report on any prospect who books a call with you—using their LinkedIn profile and advanced web research.
Lead Research & Qualification - Phase 1. Uses httpRequest, openAi, googleSheets, gmail. Event-driven trigger; 22 nodes.
Submit one or more Apple Podcast episode URLs via the built-in n8n form The workflow queries the iTunes API to retrieve each podcast's public RSS feed, then parses the XML to locate the matching episo