by Jesse Davids
Workflow Documentation Description: This workflow is designed to optimize prompts by enhancing user inputs for clarity and specificity using AI. The workflow takes a user-provided prompt as input and uses a Natural Language Processing (NLP) model to refine and improve the prompt. The optimized prompt is then sent back to the user, ready for use in further workflows or processes. Setup: This workflow is suitable for users who want to improve their prompts for better communication and understanding in their workflows. The workflow utilizes an AI Agent powered by an OpenAI Chat Model to enhance user prompts. Expected Outcomes: Users can provide vague or imprecise prompts as input to the workflow. The AI Agent will refine and optimize the prompt, adding clarity and specific details. The optimized prompt will be delivered back to the user via Telegram or can be input for the next nodes. Extra Information: A. A Telegram node is used to deliver the optimized prompt back to the user. B. Ensure you have the necessary credentials set up for Telegram and OpenAI accounts. C. Customize the workflow's settings, such as the AI model used for prompt optimization, to suit your requirements. D. Activate the workflow once all configurations are set to start optimizing prompts efficiently.
by Oneclick AI Squad
An intelligent WhatsApp-based chatbot designed for restaurants to automate customer interactions related to table bookings, menu inquiries, opening hours, services, and offers. Built using the n8n automation platform and powered by an AI language model, this solution streamlines communication, boosts efficiency, and improves customer satisfaction. Objectives Automate replies to common customer queries on WhatsApp Handle table booking requests with confirmation Provide menu item details, pricing, and dietary information Share restaurant timing, location, and service availability Promote offers and handle promotional queries Operate 24/7 without manual intervention Store bookings and conversations for reporting and analytics Workflow Summary Step 1: Message Reception Node: WhatsApp Trigger (Webhook or API-based) Function: Listens for incoming customer messages. Step 2: Intent Recognition Node: AI Query Processor (e.g., OpenAI API) Function: Detects customer intent (e.g., booking, menu, timing). Step 3: Conditional Routing Node: Switch or IF Node Function: Routes flow based on detected intent: General information (menu, timing, services) Table booking Step 4A: Respond to General Info Queries Node: AI Response or Static Reply Node Function: Returns relevant information (menu, timing, address, etc.). Step 4B: Process Booking Requests Nodes: Collect Booking Details** (via chatbot interactions) Store Booking Info** (to DB or Google Sheets) Send Booking Confirmation** (to customer) Step 5: Context Management Node: Set/Update Customer Data Function: Maintains conversation state and tracks follow-up messages. Database or Google Sheet Columns for Table Booking | Column Name | Description | | ----------------- | ----------------------------------------------- | | reservation\_id | Unique reservation identifier | | guest\_name | Full name of the guest | | contact\_number | Customer’s WhatsApp or mobile number | | email | (Optional) Email address | | booking\_date | Reservation date (YYYY-MM-DD format) | | booking\_time | Reservation time (HH\:MM format) | | party\_size | Number of guests | | table\_id | (Optional) Table number or identifier | | special\_requests | Allergies, seating preferences, etc. | | status | Booking status: Confirmed / Cancelled / Pending | | created\_at | Timestamp when booking was made | | updated\_at | Timestamp when booking was last modified | Prerequisites Verified WhatsApp Business Account with API access n8n instance (Cloud or self-hosted) Access to an AI service (e.g., OpenAI, Claude) Google Sheets, Airtable, MySQL, or other DB integration Setup Instructions Connect WhatsApp API using webhook or third-party WhatsApp provider (e.g., 360Dialog, Twilio). Integrate AI using HTTP Request or OpenAI node for response generation. Create Data Store (Google Sheet, Airtable, or MySQL) with defined booking columns. Design Workflow in n8n with intent detection, conditional logic, and response nodes. Test End-to-End by sending different WhatsApp queries and checking logs and stored data. Example Conversation Customer: “Can I book a table for 2 people tomorrow at 8 PM?” Bot: “Sure. Please provide your name and contact number to confirm the reservation for 2 people at 8:00 PM tomorrow.” \[Booking details are saved, and a confirmation is sent.] Benefits Fully automated customer interaction Supports real-time table reservations Accurate and quick responses Scales without increasing staff effort Operates 24/7 Centralized booking data for analytics Analytics and Reporting Track key performance metrics such as: Number of bookings per day/week Average response time Customer satisfaction scores (via feedback node) Popular menu items or query types Booking conversion rates Security and Compliance End-to-end encrypted WhatsApp messages Role-based access to sensitive data Compliance with data protection regulations (e.g., GDPR) Secure API integrations and storage solutions Conclusion This WhatsApp chatbot serves as a reliable, AI-powered digital front desk for restaurants. Built using n8n and scalable components, it automates customer support, manages bookings, and enhances operational efficiency while offering a seamless customer experience.
by Praveena
Purpose The purpose of this automation is to help context switch from office to some side projects or passion gigs so you can be free of distracting thoughts and re-set your perspective. Benefits Anyone who works full time and also does something on the side (perhaps a side gig/being a mom/just follow your passion project) What you need N8N (lol) Any LLM API Key (I used OpenAI 4.1) IPhone (automations and shortcuts) Template Setup Setup LLM API key. Import template file to new workflow. On Iphone create a new shortcut as per video. Create automation steps. Resources Youtube
by Thomas Janssen
Build an AI Agent which accesses two MCP Servers: a RAG MCP Server and a Search Engine API MCP Server. This workflow contains community nodes that are only compatible with the self-hosted version of n8n. Tutorial Click here to watch the full tutorial on YouTube! How it works We build an AI Agent which has access to two MCP servers: An MCP Server with a RAG database (click here for the RAG MCP Server An MCP Server which can access a Search Engine, so the AI Agent also has access to data about more current events Installation In order to use the MCP Client, you also have to use MCP Server Template. Open the MCP Client "MCP Client: RAG" node and update the SSE Endpoint to the MCP Server workflow Install the "n8n-nodes-mcp" community node via settings > community nodes ONLY FOR SELF-HOSTING: In Docker, click on your n8n container. Navigate to "Exec" and execute the below command to allow community nodes: N8N_COMMUNITY_PACKAGES_ALLOW_TOOL_USAGE=true Navigate to Bright Data and create a new "Web Unlocker API" with the name "mcp_unlocker". Open the "MCP Client" and add the following credentials: How to use it Run the Chat node and start asking questions More detailed instructions Missed a step? Find more detailed instructions here: Personal Newsfeed With Bright Data and n8n What is Retrievel Augmented Generation (RAG)? Large Language Models (LLM's) are trained on data until a specific cutoff date. Imagine a model is trained in December 2023 based data until September 2023. This means the model doesn't have any knowledge about events which happened in 2024. So if you ask the LLM who was the Formula 1 World Champion of 2024, it doesn't know the answer. The solution? Retrieval Augmented Generation. When using Retrieval Augmented Generation, a user's question is being sent to a semantic database. The LLM will use the information retrieved from the semantic database to answer the user's question. What is Model Context Protocol (MCP)? MCP is a communication protocol which is used by AI agents to call tools hosted on external servers. When an MCP client communicates with an MCP server, the server will provide an overview of all its tools, prompts and resources. The MCP server can then choose which tools to execute (based on the user's request) and execute the tools. An MCP client can communicate with multiple MCP servers, which can all host multiple tools.
by ibrhdotme
Learning something new? Endlessly searching to find the best resources? This workflow finds top community-recommended learning resources on any topic from Hacker News, delivered to your inbox. How it works User submits a topic they want to learn via a simple form. The workflow searches for relevant "Ask HN" posts on Hacker News and extracts top-level comments. An LLM analyzes the comments and identifies the best learning resources. A personalized email is sent to the user with a Markdown formatted list of top recommendations, categorized by resource type (e.g., book, course, article) and difficulty level. Set up steps Add your Google Gemini API credentials. You'll need to create a project and enable the Generative Language API. Add your SMTP credentials for sending emails. Customize the Form and email subject (optional) Activate the workflow Screenshots for Workflow, Form and Email Built on Day-03 as part of the #100DaysOfAgenticAi Fork it, tweak it, have fun!
by Yang
Who is this for? This workflow is perfect for customer support teams, sales departments, or solopreneurs who receive frequent email enquiries and want to automate the initial response process using AI. If you spend too much time answering similar questions, this system helps respond faster and more intelligently—without writing a single line of code. What problem is this workflow solving? Manually responding to repeated customer enquiries slows productivity and increases delay. This workflow classifies if an incoming email is a real enquiry, analyzes the content with a LangChain-powered agent, fetches helpful context using Dumpling AI, and sends a personalized reply using Gmail—all within minutes. What this workflow does Listens for new incoming Gmail messages using the Gmail Trigger node. Classifies whether the email is an enquiry using a GPT-4o classification prompt. Uses a Filter node to continue only if the email was classified as an enquiry. Passes the email content to a LangChain Agent, enhanced with memory, AI tools, and Dumpling AI to search for relevant information. The agent constructs a smart, relevant response, then sends it to the original sender via Gmail. Setup Connect Gmail Use the Gmail Trigger node to connect to the Gmail account that receives enquiries. Make sure Gmail OAuth2 credentials are authenticated. Configure Dumpling AI Agent Sign up at Dumpling AI. Create an agent trained to search your help docs, site content, or FAQs. Copy your Dumpling agent ID and API key. Paste it in the Dumpling AI Agent – Search for Relevant Info HTTP Request node. Set Up LangChain Agent No extra setup needed beyond connecting OpenAI credentials. GPT-4o is used for classification and reply generation. Enable Gmail Reply Node The final Send Email Response via Gmail node will send the AI-generated reply back to the same thread. How to customize this workflow to your needs Change the classification prompt to include other email types like “support”, “complaint”, or “sales”. Add additional logic if you want to CC someone or forward certain types of enquiries. Add a Notion or Google Sheets node to log the conversation for analytics. Replace Gmail with Outlook or another email provider by switching the nodes. Improve context by adding more AI tools like database queries or preloaded FAQs.
by Yang
Who is this for? This workflow is built for newsletter writers, marketers, content creators, or anyone who curates and summarizes web articles. It’s especially helpful for virtual assistants and founders who need to quickly turn web content into digestible, branded newsletters using AI. What problem is this workflow solving? Manually reading, summarizing, and formatting multiple articles into a newsletter takes time and focus. This workflow automates the process using Dumpling AI for crawling, GPT-4o for summarization, and Gmail for delivery—so you can go from raw URLs to a polished email in minutes. What this workflow does Starts manually (can also be scheduled) Reads a list of article URLs from Google Sheets Sends URLs to Dumpling AI to crawl and extract content Splits each article into a single item for processing Uses a Code node to clean and structure article data Uses an Edit Fields node to merge articles into one JSON block GPT-4o summarizes and generates HTML content for the newsletter Sends the formatted newsletter via Gmail Setup Google Sheets Create a sheet with a column (A) for article URLs Update the Read URLs from Google Sheet node to use your Sheet ID and tab name Connect your Google account in the credentials Dumpling AI Sign up at https://app.dumplingai.com Create an agent for web crawling under /crawl Add your Dumpling API key in the HTTP headers of the Crawl Content with Dumpling AI node Split Node Breaks apart the array of articles from Dumpling AI so each article is processed individually Code Node Structures each article as JSON with title, url, and cleaned text content Edit Fields Node Gathers all structured articles back into a single JSON array to prepare for AI summarization OpenAI (GPT-4o) Processes the article list and returns a formatted subject line and HTML newsletter content Gmail Connect your Gmail account to send the AI-generated newsletter to your inbox or team Update the recipient field in the Send HTML Email via Gmail node How to customize this workflow to your needs Replace the manual trigger with a Schedule node to send newsletters weekly Modify the GPT-4o prompt to change tone (e.g., more professional, funny, casual) Add filtering logic to skip low-value articles Connect Slack, Airtable, or Notion for internal team usage Change Gmail to SendGrid or Outlook if preferred Final Notes This workflow uses: Dumpling AI** /crawl endpoint to extract article content Split, **Code, and Edit Fields nodes to format multi-article input GPT-4o** for summarization and HTML formatting Gmail** for delivery This setup eliminates manual steps and delivers fast, consistent newsletters powered by AI.
by Jihene
AI-Agent Code Review for GitHub Pull Requests Description: This n8n workflow automates the process of reviewing code changes in GitHub pull requests using an OpenAI-powered agent. It connects your GitHub repo, extracts modified files, analyzes diffs, and uses an AI agent to generate a code review based on your internal code best practices (fed from a Google Sheet). It ends by posting the review as a comment on the PR and tagging it with a visual label like ✅ Reviewed by AI. 🔧 What It Does Triggered on PR creation Extracts code diffs from the PR Formats and feeds them into an OpenAI prompt Enriches the prompt using a Google Sheet of Swift best practices Posts an AI-generated review as a comment on the PR Applies a PR label to visually mark reviewed PRs ✅ Prerequisites Before deploying this workflow, ensure you have the following: n8n Instance (Self-hosted or Cloud) GitHub Repository with PR activity OpenAI API Key** for GPT-4o, GPT-4-turbo, or GPT-3.5 GitHub OAuth App** (or PAT) connected to n8n to post comments and access PR diffs (Optional) Google Sheets API credentials if using the code best practices lookup node. ⚙️ Setup Instructions 1. Import the Workflow in n8n, click on Workflows → Import from file or JSON Paste or upload the JSON code of this template 2. Configure Triggers and Connections 🔁 GitHub Trigger Node**: PR Trigger Repository**: Select the GitHub repo(s) to monitor Events**: Set to pull_request Auth**: Use GitHub OAuth2 credentials 📥 HTTP Request Node: Get file's Diffs from PR No authentication needed; it uses dynamic path from trigger 🧠 OpenAI Model Node**: OpenAI Chat Model Model**: Select gpt-4o, gpt-4-turbo, or gpt-3.5-turbo Credential**: Provide your OpenAI API Key 🧑💻 Code Review Agent Node : Code Review Agent Connected to OpenAI and optionally to tools like Google Sheets 💬 GitHub Comment Poster Uses GitHub API to post review comments back on PR Node: GitHub Robot Credential: Use the agent Github account (OAuth or PAT) Repo : Pick your owen Github Repository 🏷️ PR Labeler (optional) Adds label ReviewedByAI after successful comment Node: Add Label to PR Label : you ca customize the label text of your owen tag. 📊 Google Sheet Best Practices config (optional) Connects to a Google Sheet for coding guideline lookups, we can replace Google sheet by another tool or data base First prepare your best practices list with the clear description and the code bad/good examples Add al the best practices in your Google Sheet Configure* the Code *Best Practices node** in the template : Credential : Use your Google Sheet account by OAuth2 URL : Add your Google Sheet document URL Sheet : Add the name of the best practices sheet
by AlQaisi
Template for Kids' Story in Arabic The n8n template for creating kids' stories in Arabic offers a versatile platform for storytellers to captivate young audiences with educational and interactive tales. It allows for customization to suit various use cases and can be set up effortlessly. Check this example: https://t.me/st0ries95 Use Cases Educational Platforms: Educational platforms can automate the creation and distribution of educational stories in Arabic for children using this template. By incorporating visual and auditory elements into the storytelling process, educational platforms can enhance learning experiences and engage young learners effectively. Children's Libraries: Children's libraries can utilize this template to curate and share a diverse collection of Arabic stories with young readers. The automated generation of visual content and audio files enhances the storytelling experience, encouraging children to immerse themselves in new worlds and characters through captivating narratives. Language Learning Apps: Language learning apps focused on Arabic can integrate this template to offer culturally rich storytelling experiences for children learning the language. By translating stories into Arabic and supplementing them with visual and auditory components, these apps can facilitate language acquisition in an enjoyable and interactive manner. Configuration Guide for Nodes OpenAI Chat Model Nodes: Functionality**: Allows interaction with the OpenAI GPT-4 Turbo model. Purpose**: Enables communication with advanced chat capabilities. Create a Prompt for DALL-E Node: Customization**: Tailor prompts for generating relevant visual content. Summarization**: Define prompts for visual content generation without text. Generate an Image for the Story Node: Resource Type**: Specifies image as the resource. Prompt Setup**: Configures prompt for textless image creation within the visual content. Generate Audio for the Story Node: Resource Type**: Chooses audio as the resource. Input Definition**: Sets input text for audio file generation. Translate the Story to Arabic Node: Chunking Mode Selection**: Allows advanced chunking mode choice. Summarization Configuration**: Sets method and prompts for story translation into Arabic. Send the Story To Channel Node: Channel ID**: Specifies the channel ID for sending the story text. Text Configuration**: Sets up the text to be sent to the channel. By following these node descriptions, users can effectively configure the n8n template for kids' stories in Arabic, tailoring it to specific use cases for a seamless and engaging storytelling experience for young audiences.
by Yulia
This n8n workflow demonstrates how to create an agent using LangChain and SQLite. The agent can understand natural language queries and interact with a SQLite database to provide accurate answers. 💪 🚀 Setup Run the top part of the workflow once. It downloads the example SQLite database, extracts from a ZIP file and saves locally (chinook.db). 🗣️ Chatting with Your Data Send a message in a chat window. Locally saved SQLite database loads automatically. User's chat input is combined with the binary data. The LangChain Agend node gets both data and begins to work. The AI Agent will process the user's message, perform necessary SQL queries, and generate a response based on the database information. 🗄️ 🌟 Example Queries Try these sample queries to see the AI Agent in action: "Please describe the database" - Get a high-level overview of the database structure, only one or two queries are needed. "What are the revenues by genre?" - Retrieve revenue information grouped by genre, LangChain agent iterates several time before producing the answer. The AI Agent will store the final answer in its memory, allowing for context-aware conversations. 💬 Read the full article: 👉 https://blog.n8n.io/ai-agents/
by Jimleuk
This n8n workflow shows how using multimodal LLMs with AI vision can tackle tricky image validation tasks which are near impossible to achieve with code and often impractical to be done by humans at scale. You may need image validation when users submitted photos or images are required to meet certain criteria before being accepted. A wine review website may require users only submit photos of wine with labels, a bank may require account holders to submit scanned documents for verification etc. In this demonstration, our scenario will be to analyse a set of portraits to verify if they meet the criteria for valid passport photos according to the UK government website (https://www.gov.uk/photos-for-passports). How it works Our set of portaits are jpg files downloaded from our Google Drive using the Google Drive node. Each image is resized using the Edit Image node to ensure a balance between resolution and processing speed. Using the Basic LLM node, we'll define a "user message" option with the type of binary (data). This will allow us to pass our portrait to the LLM as an input. With our prompt containing the criteria pulled off the passport photo requirements webpage, the LLM is able to validate the photo does or doesn't meet its criteria. A structured output parser is used to structure the LLM's response to a JSON object which has the "is_valid" boolean property. This can be useful to further extend the workflow. Requirements Google Gemini API key Google Drive account Customising this workflow Not using Gemini? n8n's LLM node works with any compatible multimodal LLM so feel free to swap Gemini out for OpenAI's GPT4o or Antrophic's Claude Sonnet. Don't need to validate portraits? Try other use cases such as document classification, security footage analysis, people tagging in photos and more.
by Jimleuk
This n8n workflow demonstrates how we can use Multimodal LLMs to parse and extract from PDF documents in n8n. In this particular scenario, we're passing a candidate's CV/resume to an AI which filters out unqualified applications. However, this sneaky candidate has added in hidden prompt to bypass our bot! Whatever will we do? No fret, using AI Vision is one approach to solve this problem... read on! How it works Our candidate's CV/Resume is a PDF downloaded via Google Drive for this demonstration. The PDF is then converted into an image PNG using a tool called Stirling PDF. Since the hidden prompt has a white font color, it is is invisible in the converted image. The image is then forwarded to a Basic LLM node to process using our multimodal model - in this example, we'll use Google's Gemini 1.5 Pro. In the Basic LLM node, we'll need to set a User Message with the type of Binary. This allows us to directly send the image file in our request. The LLM is now immune to the hidden prompt and its response is has expected. The example CV/Resume with hidden prompt can be found here: https://drive.google.com/file/d/1MORAdeev6cMcTJBV2EYALAwll8gCDRav/view?usp=sharing Requirements Google Gemini API Key. Alternatively, GPT4 will also work for this use-case. Stirling PDF or another service which can convert PDFs into images. Note for data privacy, this example uses a public API and it is recommended that you self-host and use a private instance of Stirling PDF instead. Customising the workflow Swap out the manual trigger for another trigger such as a webhook to integrate into your existing services. This example demonstrates a validation use-case ie. "does the candidate look qualified?". You can try additionally extracting data points instead such as years of experiences, previous companies etc.