Back to Catalog

๐Ÿค– Build an interactive AI agent with chat interface and multiple tools

Lucas PeyrinLucas Peyrin
50139 views
2/3/2026
Official Page

How it works

This template is a complete, hands-on tutorial that lets you build and interact with your very first AI Agent.

Think of an AI Agent as a standard AI chatbot with superpowers. The agent doesn't just talk; it can use tools to perform actions and find information in real-time. This workflow is designed to show you exactly how that works.

  1. The Chat Interface (Chat Trigger): This is your window to the agent. It's a fully styled, public-facing chat window where you can have a conversation.
  2. The Brain (AI Agent Node): This is the core of the operation. It takes your message, understands your intent, and intelligently decides which "superpower" (or tool) it needs to use to answer your request. The agent's personality and instructions are defined in its extensive system prompt.
  3. The Tools (Tool Nodes): These are the agent's superpowers. We've included a variety of useful and fun tools to showcase its capabilities:
    • Get a random joke.
    • Search Wikipedia for a summary of any topic.
    • Calculate a future date.
    • Generate a secure password.
    • Calculate a monthly loan payment.
    • Fetch the latest articles from the n8n blog.
  4. The Memory (Memory Node): This gives the agent a short-term memory, allowing it to remember the last few messages in your conversation for better context.

When you send a message, the agent's brain analyzes it, picks the right tool for the job, executes it, and then formulates a helpful response based on the tool's output.

Set up steps

Setup time: ~3 minutes

This template is nearly ready to go out of the box. You just need to provide the AI's "brain."

  1. Configure Credentials: This workflow requires an API key for an AI model. Make sure you have credentials set up in your n8n instance for either Google AI (Gemini) or OpenAI.
  2. Choose Your AI Brain (LLM):
    • By default, the workflow uses the Google Gemini node. If you have Google AI credentials, you're all set!
    • If you prefer to use OpenAI, simply disable the Gemini node and enable the OpenAI node. You only need one active LLM node. Make sure it is connected to the Agent parent node.
  3. Explore the Tools: Take a moment to look at the different tool nodes connected to the Your First AI Agent node. This is where the agent gets its abilities! You can add, remove, or modify these to create your own custom agent.
  4. Activate and Test!
    • Activate the workflow.
    • Open the public URL for the Example Chat Window node (you can copy it from the node's panel).
    • Start chatting! Try asking it things like:
      • "Tell me a joke."
      • "What is n8n?"
      • "Generate a 16-character password for me."
      • "What are the latest posts on the n8n blog?"
      • "What is the monthly payment for a $300,000 loan at 5% interest over 30 years?"

Build an Interactive AI Agent with Chat Interface and Multiple Tools

This n8n workflow demonstrates how to create a conversational AI agent that can interact with users, maintain chat history, and utilize various tools to answer questions and perform tasks. It provides a flexible framework for building intelligent assistants with a chat interface.

What it does

This workflow sets up a robust AI agent with the following capabilities:

  1. Listens for Chat Messages: The workflow is triggered by incoming chat messages, acting as the user's interface to the AI agent.
  2. Manages Conversational Memory: It maintains a short-term memory of the conversation, allowing the AI to understand context and respond coherently based on previous interactions.
  3. Utilizes a Language Model: The agent leverages a powerful language model (either OpenAI Chat or Google Gemini Chat) to process user input and generate responses.
  4. Integrates Multiple Tools: The AI agent is equipped with several tools to extend its capabilities:
    • Code Tool: Allows the AI to execute code, potentially for calculations, data manipulation, or interacting with other systems.
    • Wikipedia Tool: Enables the AI to search and retrieve information from Wikipedia, providing factual answers to a wide range of queries.
  5. Generates Intelligent Responses: Based on the user's message, chat history, and available tools, the AI agent formulates and sends back a relevant and helpful response.

Prerequisites/Requirements

To use this workflow, you will need:

  • n8n Instance: A running instance of n8n.
  • OpenAI API Key or Google Gemini API Key: Depending on which language model you choose to use. You will need to create credentials in n8n for your chosen API.
  • LangChain Nodes: Ensure you have the @n8n/n8n-nodes-langchain package installed in your n8n instance.

Setup/Usage

  1. Import the Workflow:
    • Copy the provided JSON code.
    • In your n8n instance, go to "Workflows" and click "New".
    • Click the "Import from JSON" button (top right) and paste the workflow JSON.
  2. Configure Credentials:
    • Locate the "OpenAI Chat Model" node or "Google Gemini Chat Model" node (depending on your preference).
    • Click on the node and configure the "Credential" field with your OpenAI or Google Gemini API key. If you don't have one configured, click "Create New" and follow the prompts.
  3. Activate the Workflow:
    • Once the credentials are set, save the workflow.
    • Toggle the workflow to "Active" (top right corner).
  4. Interact with the Agent:
    • The "When chat message received" node acts as the trigger. You can interact with this agent through n8n's chat interface (e.g., in the "Chat" section of your n8n instance if available, or by sending messages to a configured chat service if the trigger is connected to one).
    • Send messages to the agent, and it will respond using its configured language model and tools.

Example Interactions:

  • "What is the capital of France?" (Wikipedia Tool)
  • "Calculate 123 * 456" (Code Tool)
  • "Tell me a fun fact about cats." (OpenAI/Gemini Chat Model)
  • "Who was the 16th president of the United States?" (Wikipedia Tool)

Related Templates

Daily cash flow reports with Google Sheets, Slack & Email for finance teams

Simplify financial oversight with this automated n8n workflow. Triggered daily, it fetches cash flow and expense data from a Google Sheet, analyzes inflows and outflows, validates records, and generates a comprehensive daily report. The workflow sends multi-channel notifications via email and Slack, ensuring finance professionals stay updated with real-time financial insights. ๐Ÿ’ธ๐Ÿ“ง Key Features Daily automation keeps cash flow tracking current. Analyzes inflows and outflows for actionable insights. Multi-channel alerts enhance team visibility. Logs maintain a detailed record in Google Sheets. Workflow Process The Every Day node triggers a daily check at a set time. Get Cash Flow Data retrieves financial data from a Google Sheet. Analyze Inflows & Outflows processes the data to identify trends and totals. Validate Records ensures all entries are complete and accurate. If records are valid, it branches to: Sends Email Daily Report to finance team members. Send Slack Alert to notify the team instantly. Logs to Sheet appends the summary data to a Google Sheet for tracking. Setup Instructions Import the workflow into n8n and configure Google Sheets OAuth2 for data access. Set the daily trigger time (e.g., 9:00 AM IST) in the "Every Day" node. Test the workflow by adding sample cash flow data and verifying reports. Adjust analysis parameters as needed for specific financial metrics. Prerequisites Google Sheets OAuth2 credentials Gmail API Key for email reports Slack Bot Token (with chat:write permissions) Structured financial data in a Google Sheet Google Sheet Structure: Create a sheet with columns: Date Cash Inflow Cash Outflow Category Notes Updated At Modification Options Customize the "Analyze Inflows & Outflows" node to include custom financial ratios. Adjust the "Validate Records" filter to flag anomalies or missing data. Modify email and Slack templates with branded formatting. Integrate with accounting tools (e.g., Xero) for live data feeds. Set different trigger times to align with your financial review schedule. Discover more workflows โ€“ Get in touch with us

Oneclick AI SquadBy Oneclick AI Squad
619

Automated job scraping with SerpAPI, Gemini AI filter & email notifications

๐Ÿ›œ Daily Notification on Specific Latest Job Offers ๐Ÿ›œ ๐ŸŒŸ Overview: Never miss a job offer again! This n8n workflow automates daily job scraping from LinkedIn, Indeed, Welcome to the Jungle, and more, using Google Dorks and SerpAPI. It filters offers with a Gemini AI agent, stores them in Google Sheets, and sends a sleek HTML newsletter to your inbox or subscribersโ€”all manageable from your phone! ๐Ÿ’ผ Use Cases: Students hunting for M&A, valuation, or transaction services internships (6+ months). Career switchers seeking automated, curated job alerts. Content creators building a job newsletter to monetize their audience. โš™๏ธ How It Works: Scrape: Uses SerpAPI with a tailored Google Dork to fetch fresh job listings daily from top platforms. Filter: A Gemini AI agent validates offers to ensure they match corporate finance criteria. Store: Saves new offers in Google Sheets, marking duplicates to avoid spam. Notify: Generates an email/newsletter notification and sends it via Outlook ๐Ÿ› ๏ธ Setup Instructions: Import the JSON workflow into n8n. Add credentials: SerpAPI (API key), Google Sheets (OAuth2), Microsoft Outlook (OAuth2) Customize the Google Dork in the "Edit Fields" node for specific job criteria. Schedule to run daily at 7 AM. Test and tweak the AI prompt for precision. ๐Ÿ”‘ Required Credentials & Nodes: Credentials: SerpAPI, Google Sheets OAuth2, Microsoft Outlook OAuth2 Nodes: Schedule Trigger, HTTP Request, Google Sheets, AI Agent (Gemini), Microsoft Outlook ๐Ÿ”— Creator: Louis Delahaye | n8n.io/creators/louisdl ๐ŸŽฅ YouTube @cash-routine My AI Agency : https://agence-alain.fr

LouisBy Louis
65

Seo blog content automation with GPT-4o-mini and human approval in Google Docs

Overview This n8n workflow automates the entire content creation process for SEO blog posts, from topic submission and AI drafting to human approval, revision, and final storage in Google Docs. It ensures high-quality, SEO-optimized content is generated efficiently while keeping a human in the loop for quality control. Prerequisites To use this workflow, you need the following accounts and credentials: Google Sheets Account: To manage the content tracker. The sheet must contain columns for Topic, Reference URL, Title, Status, and Link to document. OpenAI API Key (for GPT-4o-mini): To power the initial content drafting and subsequent revisions. Gmail Account: To send the content for human approval and wait for feedback. Google Docs Account: To create and store the final approved blog posts. How It Works The workflow operates in four main stages: Topic Submission, AI Content Creation, Human Approval & Revision Loop, and Final Publishing. Stage 1: Topic Submission and Tracking This stage captures a new blog topic and adds it to the content tracker. On form submission (Form Trigger): The workflow is initiated when a user submits a Topic and an optional Reference link through the form. Append row in sheet (Google Sheets): The new topic and reference link are added as a new row in your content tracker sheet. Get Topic from Google Sheets: The workflow fetches the newly added row, including the system-generated row_number for tracking updates. Stage 2: AI Content Creation (Initial Draft) The workflow uses an expert AI agent to generate the first draft of the blog post. Copywriter AI Agent: Acting as an expert SEO content strategist, the agent receives the topic and reference URL. The agent improves the provided topic into an SEO-optimized title. It writes a complete, conversational, SEO-friendly blog post (800โ€“1200 words) using proper Markdown headings and lists. OpenAI Chat Model (GPT-4o-mini): Powers the agent's generation. Structured Output Parser: Ensures the output is in a JSON format with separate title and content keys. Set Data: The AI-generated title and content are mapped to workflow variables (Topic Title, Content) for easy use in subsequent nodes. Stage 3: Human Approval and Revision Loop This is the critical quality control step where a human reviews the draft and decides on the next action. Send Content for Approval (Gmail): The generated title and content are sent via email to the approver (<your email>). This uses a custom form that allows the user to choose Yes (Approve), No (Request Revision), or Cancel. The form also includes a Content Feedback textarea. Approval Result (Switch): The workflow pauses until the approver submits the form, and then directs the flow based on their choice. If "Yes" (Approved): Proceeds to the final publishing stage. The Update Topic Status on Google Sheets node is executed, setting the Status to Approved and logging the new Title. If "No" (Revision Requested): Proceeds to the revision loop. Copywriter Revision Agent: This agent takes the original content, the topic title, and the user's Content Feedback. It is instructed to incorporate the feedback, preserving the existing structure and tone, and outputs a revised blog post. The flow loops back through the Set Data node and then returns to the Send Content for Approval node for a new review. If "Cancel": Stops the workflow, and the Update Topic Status on Google Sheets node is executed. Stage 4: Final Publishing Once approved, the content is stored in Google Docs and the tracker is updated. Create Blog file (Google Docs): A new Google Doc is created using the approved Topic Title. Add blog content in file (Google Docs): The final Content (in Markdown format) is inserted into the newly created document. Update sheet with blog post link (Google Sheets): The final tracker update logs the Link to document and the Published date. Customization Tip Recommend using AI humanazier and AI detector tools before approval to make the SEO score better.

Priyanka RanaBy Priyanka Rana
528