Back to Catalog

Build custom workflows automatically with GPT-4o, RAG, and web search

FranzFranz
28916 views
2/3/2026
Official Page

🚀 What the “Agent Builder” template does

Need to turn a one-line chat request into a fully-wired n8n workflow template—complete with AI agents, RAG, and web-search super-powers—without lifting a finger? That’s exactly what Agent Builder automates:

  1. Listens to any incoming chat message (via the Chat Trigger).
  2. Spins up an AI architect that analyses the request, searches the web, reads n8n docs from a Pinecone vector store, and designs the smallest possible set of nodes.
  3. Auto-generates a ready-to-import JSON template and hands it back as a downloadable file—plus all the supporting assets (embeddings, vector store etc.) so the next prompt is even smarter.

Think of it as your personal “workflow chef”: you shout the order, it shops for ingredients, cooks, plates, and serves the meal. All you do is eat.


🤗 Who will love this?

  • No-code builders / power users who don’t want to wrestle with AI node wiring.
  • Agencies & consultants delivering lots of bespoke automations.
  • Internal platform teams who need a “workflow self-service portal” for non-technical colleagues.

🧩 How it’s wired

| Sub-process | What happens inside | Key nodes | | -------------------------- | ------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------ | -------------------------------------------------------------------------------------- | | Web Crawler (optional) | Firecrawl scrapes docs.n8n.io (or any URL you drop in) and streams raw markdown back. | Set URL → HTTP Request (Extract) → Wait & Retry | | RAG Trainer | Splits the scraped docs, embeds them with OpenAI, and upserts vectors into Pinecone. | Recursive Text Splitter → Embeddings OpenAI → Train Pinecone | | Agent Builder | The star of the show – orchestrates GPT-4o (via OpenRouter), SerpAPI web-search, your Pinecone index and a Structured Output Parser to produce → validate → prettify the final n8n template. | Chat Trigger → AI Agent → OpenAI (validator) → Code (extract) → Convert to JSON file |

Every arrow in the drawn workflow is pre-connected, so the generated template always passes n8n’s import check.


🛠️ Getting set up (5 quick creds)

| Service | Credential type | | --------------------------------------------------- | ---------------------------------------------------------- | | OpenAI / Azure OpenAI – embeddings & validation | OpenAI API | | Pinecone – vector store | Pinecone API | | OpenRouter – GPT-4o LLM | OpenRouter API Key | | SerpAPI – web search | SerpAPI Key | | Firecrawl (only if you plan to crawl) | Generic Header AuthAuthorization: Bearer YOUR_KEY |

Each node already expects those creds; just create them once, select in the dropdown, hit Activate.


🏃‍♀️ What a typical run looks like

  1. User says: “Build me a workflow that monitors our support inbox, summarises new tickets with GPT and posts to Slack.”

  2. Chat Trigger captures the message.

  3. AI Agent:

    • queries Pinecone for relevant n8n docs,
    • fires a SerpAPI search for “n8n gmail trigger example”,
    • sketches an architecture (Gmail Trigger → GPT Model → Slack).
  4. The agent returns JSON ➜ OpenAI node double-checks field names, connections, type versions.

  5. A tiny JS Code node slices the JSON out of the chat blob and saves it as template.json ready for download.

  6. You download, import, and… done.


✏️ Customising

  • Switch the LLM – plug in Claude 3, Gemini 1.5, or a local model; just swap the OpenRouter Chat Model node.
  • Point the RAG at your own docs – change the crawl URL or feed PDFs via the Default Data Loader.
  • Hard-code preferred nodes – edit the “User node preferences” in the system message so the agent always chooses Notion for databases, etc.

🥡 Take-away notes

  • It's a prototype feel free to experiment with it to improve its capabilities.
  • Have fun building!

Build Custom Workflows Automatically with GPT-4o, RAG, and Web Search

This n8n workflow demonstrates how to leverage advanced AI capabilities, including Retrieval Augmented Generation (RAG) and web search, to automatically build custom n8n workflows based on a user's natural language request. It acts as an intelligent assistant that understands your automation needs and translates them into a functional n8n workflow.

What it does

This workflow orchestrates several AI and utility nodes to achieve its goal:

  1. Triggers on Chat Message: The workflow starts when a chat message is received, initiating the process.
  2. Initial AI Agent Processing: An AI Agent (likely powered by GPT-4o) receives the user's request. This agent is configured with several tools to assist in understanding and generating the workflow.
  3. Web Search (SerpAPI): If the AI Agent determines that external information is needed to fulfill the request (e.g., to understand a specific integration or concept), it uses SerpAPI to perform a Google search.
  4. Retrieval Augmented Generation (RAG) with Pinecone: The workflow uses a Pinecone Vector Store and OpenAI Embeddings to perform RAG. This suggests that there's a pre-existing knowledge base (likely about n8n nodes and their usage) that the AI can query to get relevant context for building the workflow.
    • Text Splitting: A Recursive Character Text Splitter prepares the documents for embedding and storage in Pinecone.
    • Default Data Loader: A Default Data Loader is used to load data into the RAG system.
    • OpenAI Embeddings: OpenAI is used to generate embeddings for the text, enabling semantic search in the Pinecone vector store.
  5. Language Model Interaction (OpenRouter/OpenAI): The AI Agent interacts with a language model (either OpenRouter Chat Model or OpenAI) to process the information gathered from RAG and web search and generate the n8n workflow JSON.
  6. Code Execution: A Code node is included, which might be used for custom logic, data manipulation, or to finalize the generated workflow JSON before output.
  7. HTTP Request: An HTTP Request node is present, potentially for interacting with an external service or API to deploy or validate the generated workflow.
  8. Conditional Logic (If): An If node allows for conditional branching based on the outcome of previous steps, enabling dynamic responses or actions.
  9. Data Transformation (Edit Fields): An Edit Fields (Set) node is used to manipulate or set data fields within the workflow, likely to format the output or prepare data for subsequent nodes.
  10. File Conversion: A "Convert to File" node is included, which might be used to convert the generated workflow JSON into a file format for download or storage.
  11. Wait: A Wait node is present, which can introduce a delay in the workflow execution, useful for rate limiting or waiting for external processes.

Prerequisites/Requirements

  • n8n Instance: A running n8n instance (cloud or self-hosted).
  • OpenAI API Key: For the OpenAI Embeddings and potentially the OpenAI Language Model.
  • Pinecone Account and API Key: For the Pinecone Vector Store.
  • SerpAPI API Key: For performing Google searches.
  • OpenRouter API Key (Optional): If using the OpenRouter Chat Model instead of OpenAI.
  • LangChain Nodes: Ensure the @n8n/n8n-nodes-langchain package is installed in your n8n instance.

Setup/Usage

  1. Import the Workflow: Download the JSON provided and import it into your n8n instance.
  2. Configure Credentials:
    • For the Embeddings OpenAI and OpenAI nodes, configure your OpenAI API credentials.
    • For the Pinecone Vector Store node, configure your Pinecone API credentials (API Key and Environment) and specify the index name.
    • For the SerpApi (Google Search) node, configure your SerpAPI API Key.
    • If using the OpenRouter Chat Model, configure your OpenRouter API Key.
  3. Configure AI Agent: Review and adjust the settings of the AI Agent node, including the prompt, model, and any specific instructions for workflow generation. Ensure it knows how to interpret user requests into n8n workflow structures.
  4. Activate the Workflow: Once all credentials are set and configurations are reviewed, activate the workflow.
  5. Trigger the Workflow: Send a chat message to the Chat Trigger node with your request for an n8n workflow (e.g., "Create a workflow that listens for a new email and posts its content to Slack"). The AI Agent will then attempt to generate the workflow JSON.
  6. Review and Deploy: The output of the AI Agent will be the generated n8n workflow JSON. You can then review this JSON and manually import it as a new workflow in n8n, or extend the current workflow to automatically deploy it (e.g., via n8n's API).

Related Templates

Track competitor SEO keywords with Decodo + GPT-4.1-mini + Google Sheets

This workflow automates competitor keyword research using OpenAI LLM and Decodo for intelligent web scraping. Who this is for SEO specialists, content strategists, and growth marketers who want to automate keyword research and competitive intelligence. Marketing analysts managing multiple clients or websites who need consistent SEO tracking without manual data pulls. Agencies or automation engineers using Google Sheets as an SEO data dashboard for keyword monitoring and reporting. What problem this workflow solves Tracking competitor keywords manually is slow and inconsistent. Most SEO tools provide limited API access or lack contextual keyword analysis. This workflow solves that by: Automatically scraping any competitor’s webpage with Decodo. Using OpenAI GPT-4.1-mini to interpret keyword intent, density, and semantic focus. Storing structured keyword insights directly in Google Sheets for ongoing tracking and trend analysis. What this workflow does Trigger — Manually start the workflow or schedule it to run periodically. Input Setup — Define the website URL and target country (e.g., https://dev.to, france). Data Scraping (Decodo) — Fetch competitor web content and metadata. Keyword Analysis (OpenAI GPT-4.1-mini) Extract primary and secondary keywords. Identify focus topics and semantic entities. Generate a keyword density summary and SEO strength score. Recommend optimization and internal linking opportunities. Data Structuring — Clean and convert GPT output into JSON format. Data Storage (Google Sheets) — Append structured keyword data to a Google Sheet for long-term tracking. Setup Prerequisites If you are new to Decode, please signup on this link visit.decodo.com n8n account with workflow editor access Decodo API credentials OpenAI API key Google Sheets account connected via OAuth2 Make sure to install the Decodo Community node. Create a Google Sheet Add columns for: primarykeywords, seostrengthscore, keyworddensity_summary, etc. Share with your n8n Google account. Connect Credentials Add credentials for: Decodo API credentials - You need to register, login and obtain the Basic Authentication Token via Decodo Dashboard OpenAI API (for GPT-4o-mini) Google Sheets OAuth2 Configure Input Fields Edit the “Set Input Fields” node to set your target site and region. Run the Workflow Click Execute Workflow in n8n. View structured results in your connected Google Sheet. How to customize this workflow Track Multiple Competitors → Use a Google Sheet or CSV list of URLs; loop through them using the Split In Batches node. Add Language Detection → Add a Gemini or GPT node before keyword analysis to detect content language and adjust prompts. Enhance the SEO Report → Expand the GPT prompt to include backlink insights, metadata optimization, or readability checks. Integrate Visualization → Connect your Google Sheet to Looker Studio for SEO performance dashboards. Schedule Auto-Runs → Use the Cron Node to run weekly or monthly for competitor keyword refreshes. Summary This workflow automates competitor keyword research using: Decodo for intelligent web scraping OpenAI GPT-4.1-mini for keyword and SEO analysis Google Sheets for live tracking and reporting It’s a complete AI-powered SEO intelligence pipeline ideal for teams that want actionable insights on keyword gaps, optimization opportunities, and content focus trends, without relying on expensive SEO SaaS tools.

Ranjan DailataBy Ranjan Dailata
161

Generate song lyrics and music from text prompts using OpenAI and Fal.ai Minimax

Spark your creativity instantly in any chat—turn a simple prompt like "heartbreak ballad" into original, full-length lyrics and a professional AI-generated music track, all without leaving your conversation. 📋 What This Template Does This chat-triggered workflow harnesses AI to generate detailed, genre-matched song lyrics (at least 600 characters) from user messages, then queues them for music synthesis via Fal.ai's minimax-music model. It polls asynchronously until the track is ready, delivering lyrics and audio URL back in chat. Crafts original, structured lyrics with verses, choruses, and bridges using OpenAI Submits to Fal.ai for melody, instrumentation, and vocals aligned to the style Handles long-running generations with smart looping and status checks Returns complete song package (lyrics + audio link) for seamless sharing 🔧 Prerequisites n8n account (self-hosted or cloud with chat integration enabled) OpenAI account with API access for GPT models Fal.ai account for AI music generation 🔑 Required Credentials OpenAI API Setup Go to platform.openai.com → API keys (sidebar) Click "Create new secret key" → Name it (e.g., "n8n Songwriter") Copy the key and add to n8n as "OpenAI API" credential type Test by sending a simple chat completion request Fal.ai HTTP Header Auth Setup Sign up at fal.ai → Dashboard → API Keys Generate a new API key → Copy it In n8n, create "HTTP Header Auth" credential: Name="Fal.ai", Header Name="Authorization", Header Value="Key [Your API Key]" Test with a simple GET to their queue endpoint (e.g., /status) ⚙️ Configuration Steps Import the workflow JSON into your n8n instance Assign OpenAI API credentials to the "OpenAI Chat Model" node Assign Fal.ai HTTP Header Auth to the "Generate Music Track", "Check Generation Status", and "Fetch Final Result" nodes Activate the workflow—chat trigger will appear in your n8n chat interface Test by messaging: "Create an upbeat pop song about road trips" 🎯 Use Cases Content Creators: YouTubers generating custom jingles for videos on the fly, streamlining production from idea to audio export Educators: Music teachers using chat prompts to create era-specific folk tunes for classroom discussions, fostering interactive learning Gift Personalization: Friends crafting anniversary R&B tracks from shared memories via quick chats, delivering emotional audio surprises Artist Brainstorming: Songwriters prototyping hip-hop beats in real-time during sessions, accelerating collaboration and iteration ⚠️ Troubleshooting Invalid JSON from AI Agent: Ensure the system prompt stresses valid JSON; test the agent standalone with a sample query Music Generation Fails (401/403): Verify Fal.ai API key has minimax-music access; check usage quotas in dashboard Status Polling Loops Indefinitely: Bump wait time to 45-60s for complex tracks; inspect fal.ai queue logs for bottlenecks Lyrics Under 600 Characters: Tweak agent prompt to enforce fuller structures like [V1][C][V2][B][C]; verify output length in executions

Daniel NkenchoBy Daniel Nkencho
601

Auto-reply & create Linear tickets from Gmail with GPT-5, gotoHuman & human review

This workflow automatically classifies every new email from your linked mailbox, drafts a personalized reply, and creates Linear tickets for bugs or feature requests. It uses a human-in-the-loop with gotoHuman and continuously improves itself by learning from approved examples. How it works The workflow triggers on every new email from your linked mailbox. Self-learning Email Classifier: an AI model categorizes the email into defined categories (e.g., Bug Report, Feature Request, Sales Opportunity, etc.). It fetches previously approved classification examples from gotoHuman to refine decisions. Self-learning Email Writer: the AI drafts a reply to the email. It learns over time by using previously approved replies from gotoHuman, with per-classification context to tailor tone and style (e.g., different style for sales vs. bug reports). Human Review in gotoHuman: review the classification and the drafted reply. Drafts can be edited or retried. Approved values are used to train the self-learning agents. Send approved Reply: the approved response is sent as a reply to the email thread. Create ticket: if the classification is Bug or Feature Request, a ticket is created by another AI agent in Linear. Human Review in gotoHuman: How to set up Most importantly, install the gotoHuman node before importing this template! (Just add the node to a blank canvas before importing) Set up credentials for gotoHuman, OpenAI, your email provider (e.g. Gmail), and Linear. In gotoHuman, select and create the pre-built review template "Support email agent" or import the ID: 6fzuCJlFYJtlu9mGYcVT. Select this template in the gotoHuman node. In the "gotoHuman: Fetch approved examples" http nodes you need to add your formId. It is the ID of the review template that you just created/imported in gotoHuman. Requirements gotoHuman (human supervision, memory for self-learning) OpenAI (classification, drafting) Gmail or your preferred email provider (for email trigger+replies) Linear (ticketing) How to customize Expand or refine the categories used by the classifier. Update the prompt to reflect your own taxonomy. Filter fetched training data from gotoHuman by reviewer so the writer adapts to their personalized tone and preferences. Add more context to the AI email writer (calendar events, FAQs, product docs) to improve reply quality.

gotoHumanBy gotoHuman
353