Automate Keyword Research with Google Autocomplete in n8n

Discover how this n8n workflow automates keyword expansion by leveraging Google’s autocomplete data for any input keyword. Save hours of manual research with automated A-Z query generation and controlled API requests to avoid Google blocks.
chatTrigger
httpRequest
code
+4
Learn how to Build this Workflow with AI:
Workflow Identifier: 1584
NODES in Use: code, httpRequest, splitInBatches, wait, respondToWebhook, chatTrigger, stickyNote

Press CTRL+F5 if the workflow didn't load.

Visit through Desktop for Best experience

1. Opening Problem Statement

Meet Sarah, a digital marketer who spends countless hours every week researching keywords to optimize her company’s blog content. She needs to discover relevant search terms people actually use on Google but doing this manually means she types her core keyword plus one letter at a time (a to z) to get autocomplete suggestions. This process is repetitive and time-consuming, often taking her 3-4 hours each week. Worse, she sometimes misses valuable keyword ideas because she can’t keep up with the volume or forgets to try every letter combination. Sarah needs a way to automate this tedious keyword expansion task efficiently without risking IP blocks from Google’s autocomplete API.

2. What This Automation Does

This n8n workflow intelligently automates comprehensive keyword research by:

  • Accepting any input keyword from a chat trigger (like typing into a chat app or form).
  • Generating 26 queries combining the base keyword with each letter of the alphabet (a-z), e.g., “n8n a”, “n8n b”… “n8n z”.
  • Looping over these queries in controlled batches of 10 to avoid API rate limits or blocks from Google.
  • Calling Google’s autocomplete API for each query to fetch popular search suggestions.
  • Aggregating all autocomplete results into a single, consolidated list of keyword suggestions.
  • Returning the final keyword list instantly via webhook for integration, or optionally exporting via email, file storage, or other means.

The workflow saves several hours per week by eliminating manual query entry, increases keyword discovery completeness, and reduces human error related to missing search patterns.

3. Prerequisites ⚙️

  • n8n account with workflow creation access.
  • Langchain Chat Trigger node enabled to input the initial keyword.
  • Internet access to call Google autocomplete public API.
  • No special API keys required since this calls Google autocomplete anonymously.

4. Step-by-Step Guide

Step 1: Set Up Chat Trigger Node to Capture Keyword

Navigate to Node Creation > Langchain Chat Trigger. Name it Get Keyword. This node waits for you to input the base keyword, for example, “n8n”.
You should see a ready state showing this node is waiting for input.
Common mistake: Forgetting to activate or deploy this node before testing will block your workflow from receiving input.

Step 2: Generate A-Z Keyword Queries Using Code Node

Add a Code node named Generate A-Z Queries. Set type to JavaScript and enter this code exactly:

const keyword = $input.first().json.chatInput;
const alphabet = "abcdefghijklmnopqrstuvwxyz".split("");

return alphabet.map(letter => ({
  json: { query: `${keyword} ${letter}` }
}));

>This script takes your input keyword and creates 26 queries by appending letters a-z.
Expect the output: an array with queries like “n8n a”, “n8n b” etc.
Common mistake: Not referencing the correct input field name (chatInput) will result in empty queries.

Step 3: Batch Queries with SplitInBatches Node

Insert a SplitInBatches node named Loop Over Items. Set batch size to 10.
This slows processing down so Google won’t block your requests for excessive frequency.
You’ll see input items processed in chunks, visible in node output tabs.
Common mistake: Setting batch size too high may cause API blocks or HTTP errors.

Step 4: Call Google Autocomplete API with HTTP Request Node

Add an HTTP Request node named Google Autocomplete. Configure as follows:
– Method: GET
– URL: https://suggestqueries.google.com/complete/search?client=firefox&hl=en&oe=utf-8&q={{ $json.query }}

This queries Google autocomplete and returns JSON suggestions.
Common mistake: Forgetting to add the query parameter dynamically with {{$json.query}}.

To change language, you can modify the &hl=en value to another language code (e.g., fr, es).

Step 5: Add a Wait Node to Avoid API Blocking

Add a Wait node named Wait 1s. Set wait duration to 1 second.
This pauses execution between batches to avoid Google denying your requests.
You will see a small delay when the workflow runs which is expected.
Common mistake: Not adding a wait node here might cause rapid-fire HTTP requests and get your IP blocked by Google.

Step 6: Use Code Node to Extract Autocomplete Keywords

Insert another Code node named Code. Use this JavaScript to parse results:

const data = JSON.parse($json.data);
return {
  json: {
    keywords: data[1]
  }
};

>This extracts the keyword suggestions list from Google’s response.
Common mistake: Forgetting to parse JSON or improper index access results in errors or empty outputs.

Step 7: Merge All Keyword Lists Into One

Add a final Code node named Extract Keywords with this code:

let mergedKeywords = [];

for (const item of $input.all()) {
  mergedKeywords.push(...item.json.keywords);
}

return { json: { keywords: mergedKeywords } };

>This creates a single array from all batches.
You should see a combined list of 100+ keywords.

Common mistake: Using only one batch’s keywords instead of combining all will limit your results.

Step 8: Output Results via Webhook Response Node

Add a Respond to Webhook node named Return Keywords.
Connect it to your merged keywords output.
When triggered, the workflow will return the full list of autocomplete suggestions as JSON.

Common mistake: Not connecting this final node properly will result in no visible output to your trigger client.

5. Customizations ✏️

  • Change Language of Autocomplete Results: In the Google Autocomplete HTTP node, modify &hl=en parameter to your desired language code, such as fr for French.
    This customizes the autocomplete suggestions according to geographic or linguistic requirements.
  • Adjust Batch Size for Faster or Safer Queries: In the Loop Over Items node, change the batch size to control the number of simultaneous API requests.
    Larger batch sizes reduce total runtime but increase chance of blocking.
  • Export Results to Other Services: Add nodes like Email Send, Google Sheets, or Webhook to forward the keyword list automatically.
    Refer to the sticky note instructions in the workflow for export suggestions.

6. Troubleshooting 🔧

Problem: “HTTP Error 429 – Too Many Requests”

Cause: Google is blocking your IP due to rapid queries.
Solution: Increase the wait time in the Wait 1s node to 2 or more seconds, reduce batch size in Loop Over Items.

Problem: “Empty or Malformed Keyword List”

Cause: Incorrect JSON parsing or response format changed.
Solution: In the Code node processing Google’s response, verify the JSON.parse() line matches the structure returned.
Test API response manually if needed.

7. Pre-Production Checklist ✅

  • Verify your Get Keyword node triggers correctly with sample input.
  • Test Google Autocomplete HTTP request manually for expected JSON results.
  • Check batch processing in Loop Over Items outputs proper chunking.
  • Ensure Wait 1s node is enabled to prevent blocking.
  • Confirm final merged keyword list contains >100 entries after running for a sample keyword.
  • Backup your workflow configuration before deployment.

8. Deployment Guide

Once ready, activate the workflow in n8n.
You can trigger the workflow by sending a keyword to the Langchain Chat Trigger endpoint.
Monitor execution logs in n8n’s UI to spot errors or API limits.
Use this automated keyword list to fuel content creation, SEO strategies, or paid ad campaigns.

9. FAQs

  • Q: Can I use other input methods besides Langchain Chat Trigger?
    A: Yes, you can replace the trigger with a webhook, Google Sheets read, or messaging integrations like Telegram.
  • Q: Does this consume Google API credits?
    A: No, Google autocomplete is publicly accessible without API keys, but be mindful of rate limits.
  • Q: Is the keyword data safe?
    A: Yes, data is processed within your n8n instance only unless you explicitly export it.

10. Conclusion

By following this guide, you have built a powerful n8n workflow that automates exhaustive keyword research by combining your core keyword with every letter of the alphabet and querying Google’s autocomplete API efficiently. This saves hours of manual work weekly, increases the depth of your keyword strategy, and returns actionable insights in real-time. Next, consider automating keyword export to Google Sheets, integrating with content management systems, or using the keyword list to trigger automated ad campaigns. With this workflow, keyword research becomes efficient and scalable.

Related Workflows

Automate Viral UGC Video Creation Using n8n + Degaus (Beginner-Friendly Guide)

Learn how to automate viral UGC video creation using n8n, AI prompts, and Degaus. This beginner-friendly guide shows how to import, configure, and run the workflow without technical complexity.
Form Trigger
Google Sheets
Gmail
+37
Free

AI SEO Blog Writer Automation in n8n (Beginner Guide)

A complete beginner guide to building an AI-powered SEO blog writer automation using n8n.
AI Agent
Google Sheets
httpRequest
+5
Free

Automate CrowdStrike Alerts with VirusTotal, Jira & Slack

This workflow automates processing of CrowdStrike detections by enriching threat data via VirusTotal, creating Jira tickets for incident tracking, and notifying teams on Slack for quick response. Save hours daily by transforming complex threat data into actionable alerts effortlessly.
scheduleTrigger
httpRequest
jira
+5
Free

Automate Telegram Invoices to Notion with AI Summaries & Reports

Save hours on financial tracking by automating invoice extraction from Telegram photos to Notion using Google Gemini AI. This workflow extracts data, records transactions, and generates detailed spending reports with charts sent on schedule via Telegram.
lmChatGoogleGemini
telegramTrigger
notion
+9
Free

Automate Email Replies with n8n and AI-Powered Summarization

Save hours managing your inbox with this n8n workflow that uses IMAP email triggers, AI summarization, and vector search to draft concise replies requiring minimal review. Automate business email processing efficiently with AI guidance and Gmail integration.
emailReadImap
vectorStoreQdrant
emailSend
+12
Free

Automate Email Campaigns Using n8n with Gmail & Google Sheets

This n8n workflow automates personalized email outreach campaigns by integrating Gmail and Google Sheets, saving hours of manual follow-up work and reducing errors in email sequences. It ensures timely follow-ups based on previous email interactions, optimizing communication efficiency.
googleSheets
gmail
code
+5
Free