by n8n Team
This workflow is designed for dynamic and intelligent conversational capabilities. It incorporates OpenAI's GPT-4o model for natural language understanding and generation. Additional tools include SerpAPI and Wikipedia for enriched, data-driven responses. The workflow is triggered manually, and utilizes a 'Window Buffer Memory' to maintain the context of the last 20 interactions for better conversational continuity. All these components are orchestrated through n8n nodes, ensuring seamless interconnectivity. To use this template, you need to be on n8n version 1.50.0 or later.
by Davide
This workflow implements an AI-powered WhatsApp booking assistant for a hair salon. The system allows customers to book, reschedule, or cancel appointments automatically via text or voice messages on WhatsApp. The workflow supports both text and voice messages. An AI agent manages the conversation logic, determines the user's intent, and calls the appropriate tools to perform actions such as checking availability, creating appointments, rescheduling bookings, or canceling events. The system also includes guardrails to filter unsafe or irrelevant inputs and escalation mechanisms to notify the team when a request falls outside supported tasks. Key Advantages 1. ✅ 24/7 Automated Appointment Booking Customers can book, reschedule, or cancel appointments at any time through WhatsApp without requiring manual staff intervention. 2. ✅ Multi-Modal Communication (Text + Voice) The workflow supports both text messages and voice messages. Audio messages are automatically transcribed and processed by the AI assistant. 3. ✅ Intelligent AI Assistant An AI agent manages the conversation, understands user intent, and automatically performs actions such as checking calendar availability or creating appointments. 4. ✅ Real-Time Calendar Integration The assistant connects directly to Google Calendar to: check available time slots create new bookings update existing appointments cancel reservations This ensures real-time accuracy. 5. ✅ Automatic Client Management Customer information such as phone number, name, and service type is stored and updated in Google Sheets, creating a lightweight CRM database. 6. ✅ Conversation Memory The system stores chat history in PostgreSQL, allowing the AI assistant to maintain context during conversations and deliver a more natural experience. 7. ✅ Smart Error Handling and Escalation If the AI cannot handle a request (for example, a question unrelated to appointments), the workflow automatically: notifies the team via email escalates the conversation for human assistance. 8. ✅ Secure and Controlled AI Responses Guardrails are implemented to prevent irrelevant or unsafe responses, ensuring that the assistant follows defined policies and tasks. 9. ✅ Omnichannel Architecture The workflow is designed to work with: WhatsApp messages chatbot interface (chat trigger) This allows the same logic to power multiple communication channels. 10. ✅ Scalable Automation The system is fully automated and can handle multiple simultaneous conversations, reducing operational workload and improving customer service efficiency. How it works Input Handling (WhatsApp & Chat): It listens for incoming messages from either a WhatsApp Trigger or a Chat Trigger. WhatsApp: It processes both text messages and voice notes. If a voice note is received, it automatically downloads the audio, transcribes it using OpenAI (Whisper), and converts it into text for the AI to process. The user's phone number (for WhatsApp) or session ID (for Chat) is stored as a sessionId to maintain conversation context. Guardrails (Security & Policy): Before the message reaches the main AI agent, it passes through a Guardrails node (using Google Gemini). This acts as a safety filter to check for jailbreak attempts or inappropriate content, ensuring the conversation stays within company policies. AI Agent (The Virtual Assistant): The cleaned-up message is sent to the AI Agent ("Virtual Assistant"). The agent is prompted to act as "Emma" and follows strict instructions: Identify User: It first uses the New client tool to check a Google Sheet to see if the user is already registered. Manage Appointments: Based on the user's request (book, reschedule, cancel), it intelligently calls specific tools in the correct order. Date Logic: It is aware of the current date and time to calculate correct future dates (e.g., interpreting "this Thursday"). Tool Execution (Actions): The agent has access to several tools to perform actions: Google Sheets (New client, Add client): To check if a client exists and add new clients to a spreadsheet. Google Calendar (Get events, Create event, Update event, Delete event): To check availability and manage appointments. The Get events tool is configured to look for slots in the next 30 days. Gmail (Send Email): To notify the team if a user asks for something outside the scope (e.g., pricing, product questions). WhatsApp HITL / Chat HITL (Escalation): To hand over the conversation to a human agent for complex requests. Response Delivery: The AI agent's text response is routed back to the user. On WhatsApp: It intelligently handles the response format. If the original message was text, it sends a text reply. If the original message was a voice note, it uses OpenAI's TTS to convert the text reply into an audio message and sends that back. Setup steps To get this workflow running, you need to configure the following credentials and nodes: Configure Credentials: Google Calendar OAuth2: Connect your Google account (used in Calendar nodes). Google Sheets OAuth2: Connect your Google account to access the spreadsheet. Gmail OAuth2: Connect your Google account to send notification emails from xxx@xxx.com. WhatsApp API: Connect your WhatsApp Business API credentials (Phone Number ID). OpenAI API (OpenRouter): Provide your API key for audio transcription and text-to-speech. Google Gemini API: Provide your API keys for the main AI model (Google Gemini Chat Model) and the Guardrails model (Google Gemini Chat Model1). Postgres: Configure the connection to your Postgres database for chat memory. Configure Google Sheets: Create a Google Sheet. Update the Document ID in the New client and Add client nodes with your sheet's ID. Ensure the sheet has columns for Phone Number, Client, and Service. Configure Google Calendar: Verify that the calendar ID in the Calendar nodes is correct and accessible. Configure WhatsApp Triggers & Actions: The WhatsApp Trigger node needs to be connected to your WhatsApp Business App. The Send message and Send audio nodes must have the correct Phone Number ID for your WhatsApp Business number. Update Email Recipient: In the Send Email tool (for escalations), change the sendTo email address from xxx@xxx.com to the actual email of the team that should receive these notifications. Review AI Prompts: Open the "Virtual Assistant" (AI Agent) node and review the system message. Update the salon name ("Cuts & Styles"), stylist name ("Alex Carter"), and address to match your business. Check the "Guardrails" node to adjust the safety threshold if necessary. 👉 Subscribe to my new YouTube channel. Here I’ll share videos and Shorts with practical tutorials and FREE templates for n8n. Need help customizing? Contact me for consulting and support or add me on Linkedin.
by Samir Saci
Tags: Productivity, Education, Learning, Language Context I’m a Supply Chain Data Scientist from Paris who lived six years in China — and yes, learning Mandarin while working full-time was tough. Learning Mandarin as an adult can be very difficult, especially if you have a full-time job. With AI, you can now have a Chinese tutor available 24/7 on your phone — no excuses left! It is with this spirit that I designed this workflow to support fellow Mandarin learners with a Chinese Teacher powered by GPT-4o. >Boost your language skills with AI using N8N! 📬 For business inquiries, you can add me on LinkedIn Who is this template for? This workflow template is designed for language learners and educators who need support to learn a vocabulary list in Mandarin (or any other language) using Open AI GPT-4o, an AI agent and a Telegram Bot to interact with users. For the vocabulary list, you can use another template shared in my profile 🉑 Generate Anki Flash Cards for Language Learning with Google Translate and GPT-4o to generate the Google Sheet needed in this workflow. How does it work? The workflow loads a vocabulary list stored in your Google Sheet. The bot will: 📥 Load your vocabulary list from Google Sheets 🧠 Generate multiple-choice questions with GPT-4o ✅ Evaluate your answer and give instant feedback 🔁 Loop to the next word until you're fluent These fields will be automatically added to a Google Sheet, ready to be loaded in Anki to create flash cards. What do I need to start? This workflow does not require any advanced programming skills. Prerequisite A Google Drive Account with a folder including a Google Sheet filled with the vocabulary list you want to learn. API Credentials: Open AI API for the chat model, Google Drive API and Google Sheets API activated with OAuth2 credentials A Telegram Bot with its token recorded in the Telegram Node Credentials A Google Sheet** with two columns (initialText: words in your own language, translatedText: words in the target language) Next Steps Follow the sticky notes to set up the parameters inside each node and get ready to pump your learning skills. 🎥 Watch My Tutorial 🚀 Curious how N8N can supercharge learning or supply chain? 📬 Let’s connect on LinkedIn Notes This workflow can be used for any language. In the AI Agent prompt, you just need to replace Chinese with your language. This workflow has been created with N8N 1.82.1 Submitted: March 23th, 2025
by Shiva
This workflow enables users to submit food images to a Telegram bot, which uses OpenAI’s GPT-4 Vision to identify the item and estimate its caloric value. The results are stored in Google Sheets and sent back to the user. What it does: Triggers on a photo sent via Telegram. Acknowledges the user with a sticky note message. Downloads the image file securely using Telegram's API. Sends the image to GPT-4 Vision with a prompt: “Describe this food and estimate its calories.” Logs the GPT response to a Google Sheet (with timestamp). Replies to the user with the result (e.g., food name and estimated calories). Use cases: Personal food tracking Nutrition logging via chat Meal journaling for fitness or health Requirements: Telegram Bot Token (via credentials) OpenAI GPT-4 Vision access Google Sheets credential with access to the target sheet Notes: You can extend this template to calculate daily totals, categorize meals (breakfast/lunch/dinner), or even integrate with calorie goals. The sticky note node confirms receipt to enhance UX. Ideal for wellness apps, chat-based food journals, or AI-powered health bots.
by Robert Breen
This guide walks you through building an intelligent AI Agent in n8n that routes tasks to the appropriate sub-agent using the new @n8n/n8n-nodes-langchain agent framework. You’ll create a Manager Agent that evaluates user input and delegates it to either an Email Agent or a Data Agent—each with its own role, memory, and OpenAI model. This is perfect for use cases where you want a single entry point but intelligent branching behind the scenes. 🔧 Step 1: Set Up the Manager Agent Start by dragging in an Agent node and name it something like ManagerAgent. This agent will act as the “brain” of your system, analyzing the user's input and determining whether it should be handled by the email-writing sub-agent or the data-summary sub-agent. Open the node’s settings and paste the following into the System Message: You are an AI Manager that delegates tasks to specialized agents. Your job is to analyze the user's message and decide whether it requires: An EmailAgent for writing outreach, follow-up, or templated emails, or A DataAgent for tasks involving data summaries, metrics, or analysis. Send the instructions to the sub agents. This instruction gives the Manager Agent clarity on what roles exist and what types of tasks belong to each one. 🧠 Step 2: Add Memory to the Manager Agent Drag in a Memory (BufferWindow) node and label it Manager Memory. Connect it to the ai_memory input of the Manager Agent. This ensures the agent can remember recent inputs and outputs from the user and agents during the conversation. No extra configuration is needed in this memory node—just connect it to the agent. 🔌 Step 3: Connect a Language Model to the Manager Agent Next, add a Language Model node and choose OpenAI Chat Model. Select a model like gpt-4o-mini or gpt-4, depending on what you have access to. Under Credentials, connect your OpenAI API key. If you haven’t created this credential yet: Click "OpenAI API" under Credentials. Choose "Create New". Paste your OpenAI API key (found at https://platform.openai.com/account/api-keys). Save it and return to the workflow. Once the model is set, connect it to the ai_languageModel input of the Manager Agent. ✉️ Step 4: Create the Email Agent Tool Now you’ll create a specialized sub-agent that only writes emails. Add an Agent Tool node and call it EmailAgent. In the tool’s settings, describe its job clearly. For example: Writes professional, friendly, or action-oriented emails based on instructions. Then scroll down to the System Message section and enter the following: You are a professional Email Writing Assistant. You write polished, effective emails for tasks such as outreach, follow-ups, and client communication. Follow the instruction provided exactly and return only the email content. Use a warm, business-appropriate tone. For the text input field, use the expression: {{ $fromAI('Prompt__User_Message_', ``, 'string') }} This allows the Email Agent to receive exactly what the Manager Agent wants it to handle. Add another Memory node and link it to this tool to help it maintain short-term context. Then add a second Language Model node, configured just like the first one (you can even clone it), and connect it to the EmailAgent. Finally, connect this entire EmailAgent setup back to the ManagerAgent by attaching it to its ai_tool input. 📊 Step 5: Create the Data Agent Tool Repeat the same steps, but this time for data summaries and analysis. Add another Agent Tool node and name it DataAgent. In the Tool Description, write something like: Responds to instructions requiring metrics, summaries, or data analysis explanations. For its input text field, you can use: {{json.query}} If desired, provide a system message that gives the agent more detailed instruction on how to behave: You are a helpful Data Analyst. Summarize trends, explain metrics, and break down data clearly based on user instructions. As with the EmailAgent, you’ll also need: A dedicated Memory node A dedicated Language Model node A connection to the ai_tool input of the Manager Agent Now the Manager Agent has two tools it can delegate to: one for communication and one for insights. 🧪 Step 6: Test Your AI Agent System Deploy the workflow and start testing by sending prompts like: > “Write a cold outreach email to a software company.” The ManagerAgent should route that to the EmailAgent. Then try: > “Summarize how our lead volume changed last month.” The DataAgent should receive that task. If routing isn’t working as expected, double-check your system messages and input bindings in each agent tool. ✅ You’re Done! You now have a modular, multi-agent AI system powered by n8n. The Manager Agent delegates intelligently, each sub-agent is optimized for its role, and all of them benefit from context memory. For more advanced setups, you can chain tools, add additional memory types, or use retrieval (RAG) tools for external document support.
by Robert Breen
A step-by-step demo that shows how to pull your Outlook calendar events for the week and ask GPT-4o to write a short summary. Along the way you’ll practice basic data-transform nodes (Code, Filter, Aggregate) and see where to attach the required API credentials. 1️⃣ Manual Trigger — Run Workflow | Why | Lets you click “Execute” in the n8n editor so you can test each change. | | --- | --- | 2️⃣ Get Outlook Events — Get many events Node type: Microsoft Outlook → Event → Get All Fields selected: subject, start API setup (inside this node): Click Credentials ▸ Microsoft Outlook OAuth2 API If you haven’t connected before: Choose “Microsoft Outlook OAuth2 API” → “Create New”. Sign in and grant the Calendars.Read permission. Save the credential (e.g., “Microsoft Outlook account”). Output: A list of events with the raw ISO start time. > Teaching moment: Outlook returns a full dateTime string. We’ll normalize it next so it’s easy to filter. 3️⃣ Normalize Dates — Convert to Date Format // Code node contents return $input.all().map(item => { const startDateTime = new Date(item.json.start.dateTime); const formattedDate = startDateTime.toISOString().split('T')[0]; // YYYY-MM-DD return { json: { ...item.json, startDateFormatted: formattedDate } }; }); 4️⃣ Filter the Events Down to This Week After we’ve normalised the start date-time into a simple YYYY-MM-DD string, we drop in a Filter node. Add one rule for every day you want to keep—for example 2025-08-07 or 2025-08-08. Rows that match any of those dates will continue through the workflow; everything else is quietly discarded. Why we’re doing this: we only want to summarise tomorrow’s and the following day’s meetings, not the entire calendar. 5️⃣ Roll All Subjects Into a Single Item Next comes an Aggregate node. Tell it to aggregate the subject field and choose the option “Only aggregated fields.” The result is one clean item whose subject property is now a tidy list of every meeting title. It’s far easier (and cheaper) to pass one prompt to GPT than dozens of small ones. 6️⃣ Turn That List Into Plain Text Insert a small Code node right after the aggregation: return [{ json: { text: items .map(item => JSON.stringify(item.json)) .join('\n') } }]; Need a Hand? I’m always happy to chat automation, n8n, or Outlook API quirks. Robert Breen – Automation Consultant & n8n Instructor 📧 robert@ynteractive.com | LinkedIn
by Sarfaraz Muhammad Sajib
This workflow allows interactive conversation with the content of an XML file using OpenAI and LangChain. It fetches an XML feed from a specified URL, parses the XML, and enables an AI agent to respond to user queries based on the XML's structure and data. What It Does: Triggered via webhook or manual execution. Sets and fetches an external XML feed URL. Parses the XML into a readable format. Connects OpenAI GPT via LangChain for intelligent chat. AI agent answers questions like extracting nodes, attributes, or structure from the XML.
by Wyeth
Let a user load multiple files with a Form node, and process the binary data. A very important workflow for many tools. This is a learning example of several core concepts that are hard to grasp in n8n: $binary data Loop and $runIndex Split Out The Save File deomonstrates how to access the binary data correctly, but could be swapped to POST the files to an AI, for example.
by MRJ
Modular Hazard Analysis Workflow : Free Version Business Value Proposition Accelerates ISO 26262 compliance for automotive/industrial systems by automating safety analysis while maintaining rigorous audit standards. :chart_with_upwards_trend: Key Benefits Time Instant report generation vs. weeks of documentation for HAZOP Risk Mitigation Pre-validated templates reduce human error Quick guide Input a systems_description file to the workflow Provide an OPENAI_API_KEY to the chat model. You can also replace the chat model with the model of your interest. :play_or_pause_button: Running the Workflow Refer to the github repo to understand in detail about how the workflow can be used :email: Contact For collaboration proposals or security issues, contact me by Email. :warning: Validation & Limitations AI-Assisted Analysis Considerations | Advantage | Mitigation Strategy | Implementation Example | |-----------|---------------------|------------------------| | Rapid hazard identification | Human validation layer | Manual review nodes in workflow | | Consistent S/E/C scoring | Rule-based validation | ASIL-D → Redundancy check | | Edge case coverage | Cross-reference with historical data | Integration with incident databases |
by Yang
Who is this for? This workflow is ideal for sales teams, marketers, and virtual assistants who manage outbound campaigns and want to improve their cold outreach personalization. It helps automate the research and writing process for each lead, saving time while improving quality. What problem is this workflow solving? Cold outreach often lacks personalization because manually reviewing each lead's website takes time. This workflow eliminates that bottleneck by using AI to auto-generate personalized icebreakers, summaries, and outreach emails based on a lead’s website—without human research. What this workflow does This n8n workflow runs on a schedule and pulls leads from Airtable who don't yet have an "Ice breaker" field filled out. For each lead, it does the following: Trigger: Scheduled daily via the Run Daily to Process New Leads node. Search Airtable: Finds leads in Airtable where the Ice breaker field is empty using the Search Cold Leads Without Icebreaker node. Split in Batches: Iterates through each lead one by one using Loop Through Each Lead. Rate Limiting: Waits briefly before each request using Wait Before Making Request to avoid rate limits. Scrape Website: Sends each lead’s website to Dumpling AI's /scrape endpoint via the Scrape Lead Website with Dumpling AI HTTP request. Generate AI Copy: Sends the scraped content to GPT-4o using the Generate Icebreaker, Summary & Email (GPT-4o) node. It asks the LLM to create: A short personalized icebreaker A 2–3 line website summary A short email body for cold outreach Save Results: Updates the original Airtable record with the generated content using the Save AI Output Back to Airtable node. Sticky Note: Provides an overview of the workflow and usage instructions for future editors or collaborators. This loop continues for all leads found, updating Airtable with fresh AI-generated outreach content. Integration Requirements Airtable (Personal Access Token) Dumpling AI API Key (Header Auth) OpenAI (GPT-4o)
by Tushar Mishra
This n8n workflow automatically fetches the latest CVE data at scheduled intervals, extracts relevant security details, and creates a corresponding Security Incident in ServiceNow for each new vulnerability. Schedule Trigger – Runs at predefined intervals. Jina Fetch – Retrieves the latest CVE feed. Information Extractor (OpenAI Chat Model) – Processes and extracts key details from the CVE data. Split Out – Separates each CVE entry for individual processing. Create Incident – Generates a ServiceNow Security Incident with the extracted CVE details. Ideal for security teams to ensure timely tracking and remediation of new vulnerabilities without manual monitoring.
by Lorena
This workflow is triggered when a new deal is created in HubSpot. Then, it processes the deal based on its value and stage. The first branching follows three cases: If the deal is closed and won, a message is sent in a Slack channel, so that the whole team can celebrate the success. If a presentation has been scheduled for the deal, then a Google Slides presentation template is created. If the deal is closed and lost, the deal’s details are added to an Airtable table. From here, you can analyze the data to get insights into what and why certain deals don’t get closed. The second branching follows two cases: If the deal is for a new business and has a value above 500, a high-priority ticket assigned to an experienced team member is created in HubSpot If the deal is for an existing business and has a value below 500, a low-priority ticket is created.