AI-Powered WhatsApp Restaurant Delivery Assistant - n8n Workflow

Automate restaurant orders and customer support using this advanced n8n workflow. Integrates WhatsApp (Evolution API), LangChain Agents, RAG, and Supabase for ultimate delivery automation.

Workflow Preview

Ready to automate?

Download this n8n workflow template and start using it instantly.

Who is this best for?


  • Delivery business owners and restaurants needing 24/7 automated order processing.

  • Technical automation specialists and developers utilizing n8n for complex AI integrations.

  • Users who require advanced chat memory and RAG capabilities in their automation projects.

  • Those looking for practical examples of cutting-edge n8n templates combining multiple cloud services.

Overview

This comprehensive n8n workflow solves the common challenge of high-volume, repetitive customer service and order placement in the food delivery sector. By utilizing a sophisticated LangChain AI agent deployed as an n8n node, the system intelligently handles diverse customer interactions. The agent maintains conversational context using Postgres Chat Memory, accesses external documents via a Supabase Vector Store (RAG), and executes specific business logic using specialized 'Tool' workflows (such as placing an order or retrieving customer data).

This robust n8n automation ensures immediate responses, significantly reduces the need for manual agent intervention, and maintains all chat history and customer data within a structured Supabase database. Furthermore, it features a mechanism to update its knowledge base dynamically, ensuring the AI always has access to the latest menus or policy documents.

How it Works

The entire process is orchestrated by several interconnected flows within this large n8n workflow, handling both real-time customer chats and background knowledge updates.

1. Real-Time Customer Interaction Flow


  1. Trigger: The input evolution webhook acts as the primary n8n trigger, receiving messages instantly from the Evolution WhatsApp API.

  2. Initialization & State Check: The flow performs checks using Redis nodes (Verifica Atendimento Humano, PARAR ISIS) to determine if the chat requires human handover or if the user is spamming. Customer and chat records are retrieved or created using dedicated Supabase n8n nodes (FindPhone, If3).

  3. AI Processing: The message is passed to the core Delivery AI n8n node (a LangChain Agent). This agent uses the OpenAI Chat Model, leveraging tools like buscacliente, enviacomanda, and the RAG tool buscadocumentos to analyze the query and formulate a decisive action or response.

  4. Response Handling: A Switch3 n8n node analyzes the AI's output. Responses can be a standard text message (sent via Evolution API), a complex structured command (parsed by Parser Chain and sent via Evolution API2), or, uniquely, an audio response.

  5. Audio Response: If audio is required, the flow utilizes ElevenLabsGenerateVoice (via HTTP Request n8n node) for Text-to-Speech, converts the resulting file using Code2, and sends the voice note via Evolution API3.

  6. Data Persistence: The final response and chat metadata are logged into Supabase using CreateMessage-Supabase and UpdateChat-Supabase nodes.

2. Knowledge Base Update (RAG Flow)


  1. Trigger: This secondary section is activated by the Schedule Trigger or Google Drive change triggers (File Created/File Updated).

  2. Data Ingestion: Files (PDFs, Excel, documents) are downloaded (Download File), extracted (Extract Document Text, Extract PDF Text), and pre-processed. Character Text Splitter breaks down large documents into manageable chunks.

  3. Vectorization: The text chunks are processed by the Embeddings OpenAI2 node and then inserted into the Supabase Vector Store, making the new information immediately accessible to the buscadocumentos RAG tool used by the main AI agent. This ensures the n8n workflow operates with up-to-date knowledge.

Installation Guide

To deploy this expert n8n workflow, follow these steps:


  1. Import the JSON: Copy the provided n8n workflow JSON and paste it into your n8n instance using the 'New' -> 'Import from JSON' option.

  2. Configure Credentials: You must set up credentials for the following services:

WhatsApp/Evolution API: Configure the input evolution Webhook URL and the Evolution API connections.
OpenAI: Set up credentials for the Language Models (OpenAI Chat Model, Embeddings OpenAI).
Supabase/Postgres: Provide credentials for the various database interaction n8n nodes (Supabase and Postgres nodes are heavily used for chat memory, RAG, and customer data).
Google Drive: (Optional, for RAG update flow) Configure credentials for File Created and Download File.
* ElevenLabs: (Optional, for audio responses) Configure the HTTP Request n8n node for the ElevenLabs API.

  1. Database Setup: Ensure your Postgres/Supabase database tables (Customers, Chats, Messages) and the necessary vector store infrastructure are correctly initialized, as referenced by the initial setup Postgres n8n nodes (Cria tabela Cliente, etc.).

  2. Activate: Save the n8n template and activate the main webhook trigger.

Node Details

This n8n workflow relies on a mixture of core n8n node types, specialized AI nodes, and external integrations:

input evolution (Webhook n8n trigger): Listens for incoming WhatsApp messages from the Evolution API. Key Configuration: Webhook URL must be exposed publicly.
Delivery AI (LangChain Agent n8n node): The primary brain. Configured with Postgres Chat Memory for history and multiple Tool Workflow n8n templates (e.g., enviacomanda, buscacliente) to execute specific delivery actions.
OpenAI Chat Model (LangChain n8n node): Provides the LLM capabilities for the AI Agent and the Text Classifier.
Supabase Nodes (Multiple operations): Used extensively for data management (insert, update, find). Key Configuration: API Key and database URL are required for all Supabase operations, maintaining the history of the n8n workflow data.
Supabase Vector Store (LangChain n8n node): The storage backend for the RAG knowledge base. Key Configuration: Defines the table where embedded document chunks are stored.
Character Text Splitter (LangChain n8n node): Used in the RAG update flow to chunk large documents before embedding.
Redis Nodes: Used for quick, temporary state storage and conditional checks, essential for managing high-volume chat concurrency in this n8n automation.
Evolution API Nodes: Dedicated n8n node for sending structured WhatsApp responses and media back to the user.

Related n8n Workflows

Paid

Nodes: 40 Nodes
Updated: December 26 2025
View all
Created by

Especialista em automações, IA e marketing digital. #n8n #IA #automacao #make

Featured*