Skip to main content

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

Workflow preview

Workflow preview
100%
Build custom workflows automatically with GPT-4o, RAG, and web search preview
Open on n8n.io

Important notice

This workflow is provided as-is. Please review and test before using in production.

1. Workflow Overview

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 f...

Best for

  • Engineering automation workflows
  • AI Chatbot automation workflows
  • advanced n8n builders looking for reusable templates

Tools used

@n8n/n8n-nodes-langchain.chattrigger, @n8n/n8n-nodes-langchain.agent, @n8n/n8n-nodes-langchain.embeddingsopenai, @n8n/n8n-nodes-langchain.documentdefaultdataloader, n8n-nodes-base.manualtrigger, n8n-nodes-base.httprequest, n8n-nodes-base.if, n8n-nodes-base.wait

Source and attribution

This workflow is cataloged by N8N Workflows and links back to its original n8n.io source page by Franz.

Original n8n.io source

1.1 Workflow description

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

🚀 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!

1.2 Logical Blocks

This catalog entry is organized from the workflow JSON. The node-level section below shows the executable blocks available for review before importing the template.

2. Block-by-Block Analysis

Block 1 - When chat message received

Type / Role
@n8n/n8n-nodes-langchain.chatTrigger - chatTrigger
Config choices
Version 1.1

Block 2 - AI Agent

Type / Role
@n8n/n8n-nodes-langchain.agent - agent
Config choices
Version 1.9

Block 3 - Embeddings OpenAI2

Type / Role
@n8n/n8n-nodes-langchain.embeddingsOpenAi - embeddingsOpenAi
Config choices
Version 1.2

Block 4 - Default Data Loader1

Type / Role
@n8n/n8n-nodes-langchain.documentDefaultDataLoader - documentDefaultDataLoader
Config choices
Version 1

Block 5 - When clicking ‘Test workflow’

Type / Role
n8n-nodes-base.manualTrigger - manualTrigger
Config choices
Version 1

Block 6 - Extract

Type / Role
n8n-nodes-base.httpRequest - httpRequest
Config choices
Version 4.2

Block 7 - If

Type / Role
n8n-nodes-base.if - if
Config choices
Version 2.2

Block 8 - Get Results

Type / Role
n8n-nodes-base.httpRequest - httpRequest
Config choices
Version 4.2

Block 9 - 30 Secs

Type / Role
n8n-nodes-base.wait - wait
Config choices
Version 1.1

Block 10 - 10 Seconds

Type / Role
n8n-nodes-base.wait - wait
Config choices
Version 1.1

Block 11 - SerpAPI

Type / Role
@n8n/n8n-nodes-langchain.toolSerpApi - toolSerpApi
Config choices
Version 1

Block 12 - Pinecone Vector Store

Type / Role
@n8n/n8n-nodes-langchain.vectorStorePinecone - vectorStorePinecone
Config choices
Version 1.1

Block 13 - Train Pinecone Vector Store

Type / Role
@n8n/n8n-nodes-langchain.vectorStorePinecone - vectorStorePinecone
Config choices
Version 1.1

Block 14 - OpenRouter Chat Model

Type / Role
@n8n/n8n-nodes-langchain.lmChatOpenRouter - lmChatOpenRouter
Config choices
Version 1

Block 15 - Embeddings OpenAI

Type / Role
@n8n/n8n-nodes-langchain.embeddingsOpenAi - embeddingsOpenAi
Config choices
Version 1.2

Block 16 - OpenAI

Type / Role
@n8n/n8n-nodes-langchain.openAi - openAi
Config choices
Version 1.8

Block 17 - Code

Type / Role
n8n-nodes-base.code - code
Config choices
Version 2

Block 18 - Web Crawler Logic

Type / Role
n8n-nodes-base.stickyNote - stickyNote
Config choices
Version 1

Block 19 - RAG Trainer Logic

Type / Role
n8n-nodes-base.stickyNote - stickyNote
Config choices
Version 1

Block 20 - Agent Builder Logic

Type / Role
n8n-nodes-base.stickyNote - stickyNote
Config choices
Version 1

Block 21 - Configure Firecrawl

Type / Role
n8n-nodes-base.stickyNote - stickyNote
Config choices
Version 1

Block 22 - Configure Pinecone

Type / Role
n8n-nodes-base.stickyNote - stickyNote
Config choices
Version 1

Block 23 - Configure OpenAI API

Type / Role
n8n-nodes-base.stickyNote - stickyNote
Config choices
Version 1

Block 24 - Configure OpenRouter GPT-4o

Type / Role
n8n-nodes-base.stickyNote - stickyNote
Config choices
Version 1

Showing the first 24 of 33 workflow blocks. Download the JSON for the full node graph.

3. Summary Table

Workflow Build custom workflows automatically with GPT-4o, RAG, and web search
Complexity advanced
Nodes 33
Categories Engineering, AI Chatbot
Author Franz
Published 18 Jun 2025

4. Reproducing the Workflow from Scratch

  1. 1. Download the workflow JSON

    Use the JSON export at /data/workflows/5024/5024.json as the source template for this automation.

  2. 2. Import the template into n8n

    Open n8n, import the downloaded JSON, and review each node before activating the workflow.

  3. 3. Configure credentials and variables

    Replace placeholder credentials, API keys, webhook URLs, account IDs, and environment-specific values with your own settings.

  4. 4. Test with sample data

    Run the workflow manually or in a staging workspace, inspect node output, and confirm downstream systems receive the expected data.

  5. 5. Activate and monitor

    Enable the workflow only after testing, then monitor executions, errors, and rate limits during the first production runs.

5. General Notes & Resources

Review imported nodes carefully before activation. This catalog entry is intended to help you inspect the workflow structure, understand required services, and find related templates faster.

Node names, credentials, schedules, webhook paths, and external service limits may need adjustment for your workspace.

Frequently asked questions

What does Build custom workflows automatically with GPT-4o, RAG, and web search do?

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 f...

What do I need before importing this workflow?

Review the workflow JSON, configure any required credentials in n8n, and test the automation in a safe workspace before using it in production.

Can I customize this workflow?

Yes. Use the block-by-block analysis and the downloadable JSON to inspect each node, then adjust credentials, prompts, schedules, filters, or destinations for your Engineering, AI Chatbot use case.