Route Chatwoot customer chats to AI and live agents with Groq and Gemini
Needs changesWhat this workflow does
This AI workflow has 17 nodes and runs when an HTTP POST request hits its webhook URL. Along the way it connects Postgres Chat Memory, Gmail, HTTP Request and Groq Chat Model and 4 more.
How it runs
Trigger: When an HTTP POST request hits its webhook URL.
- Prepare Field Edits (Edit Fields (Set)): sets or maps fields
- Route by Chat Message Type (Switch): routes items into 2 branches
- Check Live Agent Assignment (If): checks a condition and branches into true / false
- Fetch Live Agent Data (HTTP Request): calls an HTTP API
- Generate Assignee Agent ID (Code): runs custom JavaScript code
- AI Customer Support Agent (AI Agent): runs an AI agent, with model: Use Groq Chat Model; 3 tools (Access Knowledge Base, Escalate Chat via HTTP, Send Internal Team Email); memory: Store Chat Memory in Postgres
- Split AI Messages (Code): runs custom JavaScript code
Services it uses
Before you upgrade to n8n 3.0
1 thing in this workflow is removed in n8n 3.0. Fix it before you upgrade:
- AI Agent v1 (old agent modes) in AI Customer Support Agent (v1.7): replace with Latest AI Agent node (Tools Agent). For SQL Agent, use a Postgres or MySQL tool with a recent AI Agent.
| Removed in 3.0 | Replace with |
|---|---|
| AI Agent v1 (old agent modes) AI Customer Support Agent (v1.7) | Latest AI Agent node (Tools Agent). For SQL Agent, use a Postgres or MySQL tool with a recent AI Agent. |
Nodes used (16)
- If
n8n-nodes-base.if - Code
n8n-nodes-base.code - Switch
n8n-nodes-base.switch - No Operation, do nothing
n8n-nodes-base.noOp - HTTP Request
n8n-nodes-base.httpRequest - Postgres Chat Memory
@n8n/n8n-nodes-langchain.memoryPostgresChat - Gmail Tool
n8n-nodes-base.gmailTool - Http Request Tool
n8n-nodes-base.httpRequestTool - Webhook
n8n-nodes-base.webhook - Edit Fields (Set)
n8n-nodes-base.set - Groq Chat Model
@n8n/n8n-nodes-langchain.lmChatGroq - Pinecone Vector Store
@n8n/n8n-nodes-langchain.vectorStorePinecone - Embeddings Google Gemini
@n8n/n8n-nodes-langchain.embeddingsGoogleGemini - Google Gemini Chat Model
@n8n/n8n-nodes-langchain.lmChatGoogleGemini - AI Agent
@n8n/n8n-nodes-langchain.agent - Vector Store Question Answer Tool
@n8n/n8n-nodes-langchain.toolVectorStore
From the author
Quick overview This workflow automates customer chat with Chatwoot & n8n AI agent that handles incoming chats, qualifies leads, answers FAQs from Pinecone knowledge base, and escalates to a live human agent when one is online. Works with any Chatwoot inbox:…