AutomationFlowsAI & RAG › Route Whatsapp Support Requests with Claude, Supabase, Hubspot and Slack

Route Whatsapp Support Requests with Claude, Supabase, Hubspot and Slack

ByMultifly @ayusht-m on n8n.io

This workflow turns incoming WhatsApp messages (text, audio, images, and documents) into actionable support interactions by extracting content, detecting sentiment, and using an AI agent with a Supabase knowledge base to route requests to Google Calendar, HubSpot, Slack, Gmail,…

Event trigger★★★★★ complexityAI-powered44 nodesWhatsApp TriggerOpenAISupabaseOpenAI EmbeddingsSentiment AnalysisOpenAI ChatAgentOutput Parser Structured
AI & RAG Trigger: Event Nodes: 44 Complexity: ★★★★★ AI nodes: yes Added:
Route Whatsapp Support Requests with Claude, Supabase, Hubspot and Slack — n8n workflow card showing WhatsApp Trigger, OpenAI, Supabase integration

This workflow corresponds to n8n.io template #17006 — we link there as the canonical source.

This workflow follows the Agent → Datatable recipe pattern — see all workflows that pair these two integrations.

The workflow JSON

Copy or download the full n8n JSON below. Paste it into a new n8n workflow, add your credentials, activate. Full import guide →

Download .json
{
  "id": "hoss18taJCsUBP45",
  "name": "Whatsapp AGENT",
  "tags": [
    {
      "id": "4fiyGu6Et1tw4NlY",
      "name": "google drive",
      "createdAt": "2026-07-17T18:49:28.821Z",
      "updatedAt": "2026-07-17T18:49:28.821Z"
    },
    {
      "id": "EwHQrwXPcirwT8jS",
      "name": "google calender",
      "createdAt": "2026-07-17T18:49:28.794Z",
      "updatedAt": "2026-07-17T18:49:28.794Z"
    },
    {
      "id": "J4oLq3fJEET0TbUe",
      "name": "supabase",
      "createdAt": "2026-07-17T18:49:28.875Z",
      "updatedAt": "2026-07-17T18:49:28.875Z"
    },
    {
      "id": "xXS7525BcBzDokGs",
      "name": "claudeai",
      "createdAt": "2026-07-17T18:49:28.845Z",
      "updatedAt": "2026-07-17T18:49:28.845Z"
    }
  ],
  "nodes": [
    {
      "id": "28dab7c8-5ae9-430d-86ab-afd61bcc4c16",
      "name": "WhatsApp Webhook",
      "type": "n8n-nodes-base.whatsAppTrigger",
      "position": [
        -2512,
        576
      ],
      "parameters": {
        "options": {},
        "updates": [
          "messages"
        ]
      },
      "retryOnFail": true,
      "typeVersion": 1,
      "alwaysOutputData": true
    },
    {
      "id": "d28aa4f4-7c7b-4cdb-adee-8e2d9c0e7a70",
      "name": "Message Type Router",
      "type": "n8n-nodes-base.switch",
      "position": [
        -2288,
        544
      ],
      "parameters": {
        "rules": {
          "values": [
            {
              "conditions": {
                "options": {
                  "version": 3,
                  "leftValue": "",
                  "caseSensitive": true,
                  "typeValidation": "strict"
                },
                "combinator": "and",
                "conditions": [
                  {
                    "id": "35139c18-bcd9-4f47-b335-d5f3858a6e61",
                    "operator": {
                      "type": "string",
                      "operation": "equals"
                    },
                    "leftValue": "={{ $json.entry[0].changes[0].value.messages[0].type }}",
                    "rightValue": "audio"
                  }
                ]
              }
            },
            {
              "conditions": {
                "options": {
                  "version": 3,
                  "leftValue": "",
                  "caseSensitive": true,
                  "typeValidation": "strict"
                },
                "combinator": "and",
                "conditions": [
                  {
                    "id": "8bf9d48f-1a77-4582-ae01-55fb16a7cd19",
                    "operator": {
                      "type": "string",
                      "operation": "equals"
                    },
                    "leftValue": "={{ $json.entry[0].changes[0].value.messages[0].type }}",
                    "rightValue": "image"
                  }
                ]
              }
            },
            {
              "conditions": {
                "options": {
                  "version": 3,
                  "leftValue": "",
                  "caseSensitive": true,
                  "typeValidation": "strict"
                },
                "combinator": "and",
                "conditions": [
                  {
                    "id": "660d2af7-cd2d-4ef5-8937-1f1a0343bc33",
                    "operator": {
                      "type": "string",
                      "operation": "equals"
                    },
                    "leftValue": "={{ $json.entry[0].changes[0].value.messages[0].type }}",
                    "rightValue": "document"
                  }
                ]
              }
            },
            {
              "conditions": {
                "options": {
                  "version": 3,
                  "leftValue": "",
                  "caseSensitive": true,
                  "typeValidation": "strict"
                },
                "combinator": "and",
                "conditions": [
                  {
                    "id": "0d715dc6-7f2f-4322-9662-6d181896acf5",
                    "operator": {
                      "type": "string",
                      "operation": "equals"
                    },
                    "leftValue": "={{ $json.entry[0].changes[0].value.messages[0].type }}",
                    "rightValue": "text"
                  }
                ]
              }
            }
          ]
        },
        "options": {}
      },
      "typeVersion": 3.4
    },
    {
      "id": "64141bdd-939c-405c-9162-b312ee1e7bde",
      "name": "Whisper STT",
      "type": "@n8n/n8n-nodes-langchain.openAi",
      "position": [
        -2064,
        288
      ],
      "parameters": {
        "options": {},
        "resource": "audio",
        "operation": "transcribe"
      },
      "typeVersion": 2.3
    },
    {
      "id": "7058092a-42d4-4d2d-bf0e-c87d798f8d3b",
      "name": "Merge Message Types",
      "type": "n8n-nodes-base.merge",
      "position": [
        -1840,
        544
      ],
      "parameters": {
        "numberInputs": 4
      },
      "typeVersion": 3.2
    },
    {
      "id": "1b1e006f-ae5a-4f86-b2dd-2cc71220a3d8",
      "name": "GPT-4o Vision",
      "type": "@n8n/n8n-nodes-langchain.openAi",
      "position": [
        -2064,
        480
      ],
      "parameters": {
        "text": "Describe this image in detail",
        "modelId": {
          "__rl": true,
          "mode": "list",
          "value": "gpt-4o"
        },
        "options": {},
        "resource": "image",
        "inputType": "base64",
        "operation": "analyze"
      },
      "typeVersion": 2.3
    },
    {
      "id": "2665ba26-f5d3-45ca-92a8-d048ef28faff",
      "name": "PDF/DOCX Parser",
      "type": "n8n-nodes-base.extractFromFile",
      "position": [
        -2064,
        672
      ],
      "parameters": {
        "options": {},
        "operation": "pdf"
      },
      "typeVersion": 1.1
    },
    {
      "id": "a1634920-ca29-43b9-9da3-659c10c4f35d",
      "name": "Text Pass Through",
      "type": "n8n-nodes-base.set",
      "position": [
        -2064,
        864
      ],
      "parameters": {
        "options": {},
        "assignments": {
          "assignments": [
            {
              "id": "1",
              "name": "text",
              "type": "string",
              "value": "={{ $json.entry[0].changes[0].value.messages[0].text.body }}"
            }
          ]
        }
      },
      "typeVersion": 3.4
    },
    {
      "id": "157b4d5f-3412-4ef9-815f-00100a5bd289",
      "name": "Supabase: Load Session",
      "type": "n8n-nodes-base.supabase",
      "position": [
        -1616,
        576
      ],
      "parameters": {
        "filters": {
          "conditions": [
            {
              "keyName": "phone_number",
              "keyValue": "={{ $json.entry[0].changes[0].value.messages[0].from }}"
            }
          ]
        },
        "tableId": "sessions",
        "operation": "get"
      },
      "typeVersion": 1
    },
    {
      "id": "4dc0f79b-dfb7-4009-8f61-b83671d07dd9",
      "name": "OpenAI Embeddings",
      "type": "@n8n/n8n-nodes-langchain.embeddingsOpenAi",
      "position": [
        -768,
        1008
      ],
      "parameters": {
        "options": {}
      },
      "typeVersion": 1.2
    },
    {
      "id": "e10d932d-81c7-49de-872d-1022f2c0f62e",
      "name": "Sentiment + Language Detection",
      "type": "@n8n/n8n-nodes-langchain.sentimentAnalysis",
      "position": [
        -1392,
        576
      ],
      "parameters": {
        "options": {
          "categories": "Positive, Neutral, Negative, Urgent, Frustrated",
          "includeDetailedResults": true
        },
        "inputText": "={{ $input.item.json.text }}"
      },
      "retryOnFail": true,
      "typeVersion": 1.1,
      "alwaysOutputData": true
    },
    {
      "id": "52dc5263-1f87-4d80-99d8-7023b09c8428",
      "name": "OpenAI Model (Sentiment)",
      "type": "@n8n/n8n-nodes-langchain.lmChatOpenAi",
      "position": [
        -1312,
        896
      ],
      "parameters": {
        "model": {
          "__rl": true,
          "mode": "list",
          "value": "gpt-4o-mini"
        },
        "options": {},
        "builtInTools": {}
      },
      "typeVersion": 1.3
    },
    {
      "id": "0eca430a-2279-45ae-93e7-11ee277ba1d2",
      "name": "Claude AI Agent",
      "type": "@n8n/n8n-nodes-langchain.agent",
      "position": [
        -432,
        576
      ],
      "parameters": {
        "text": "={{ $json.text }}",
        "options": {
          "systemMessage": "=You are an advanced AI assistant for customer support with access to multiple tools and knowledge bases.\n\nUser Context:\n- Sentiment: {{ $(\"Sentiment + Language Detection\").item.json.sentiment }}\n- Phone: {{ $(\"WhatsApp Webhook\").item.json.entry[0].changes[0].value.messages[0].from }}\n- Session Data: {{ $(\"Supabase: Load Session\").item.json.user_profile }}\n\nYou have access to:\n1. Knowledge Base Tool - Search company documentation\n2. Google Calendar Tool - Book appointments\n3. HubSpot Contact Tool - Create/update contacts\n4. HubSpot Ticket Tool - Create support tickets\n5. Slack Tool - Notify support team\n6. Gmail Tool - Send emails\n\nInstructions:\n- Use the Knowledge Base Tool to answer questions about products, policies, and procedures\n- Book appointments using the Calendar Tool when requested\n- Create contacts in HubSpot for lead capture\n- Create tickets for complex issues\n- Escalate urgent matters via Slack\n- Send documents via Gmail when needed\n\nAlways determine the user intent and respond professionally. Include the intent in your structured output."
        },
        "promptType": "define",
        "hasOutputParser": true
      },
      "typeVersion": 3.1
    },
    {
      "id": "f93e8f80-8632-427f-a9a9-6035d51ec3e2",
      "name": "Structured Output Parser",
      "type": "@n8n/n8n-nodes-langchain.outputParserStructured",
      "position": [
        144,
        800
      ],
      "parameters": {
        "autoFix": true,
        "jsonSchemaExample": "{\"intent\":\"BOOK_APPOINTMENT\",\"response\":\"I can help you book an appointment\",\"metadata\":{}}"
      },
      "typeVersion": 1.3
    },
    {
      "id": "0f030bd1-8a96-429c-9e55-cfebf4a6b9ff",
      "name": "OpenAI Model (Parser)",
      "type": "@n8n/n8n-nodes-langchain.lmChatOpenAi",
      "position": [
        224,
        1008
      ],
      "parameters": {
        "model": {
          "__rl": true,
          "mode": "list",
          "value": "gpt-4o-mini"
        },
        "options": {},
        "builtInTools": {}
      },
      "typeVersion": 1.3
    },
    {
      "id": "d5d126ce-5170-491d-902d-336ca1b38690",
      "name": "Intent Router",
      "type": "n8n-nodes-base.switch",
      "position": [
        736,
        512
      ],
      "parameters": {
        "rules": {
          "values": [
            {
              "conditions": {
                "options": {
                  "version": 1,
                  "leftValue": "",
                  "caseSensitive": false,
                  "typeValidation": "strict"
                },
                "combinator": "and",
                "conditions": [
                  {
                    "operator": {
                      "type": "string",
                      "operation": "equals"
                    },
                    "leftValue": "={{ $json.intent }}",
                    "rightValue": "BOOK_APPOINTMENT"
                  }
                ]
              }
            },
            {
              "conditions": {
                "options": {
                  "version": 1,
                  "leftValue": "",
                  "caseSensitive": false,
                  "typeValidation": "strict"
                },
                "combinator": "and",
                "conditions": [
                  {
                    "operator": {
                      "type": "string",
                      "operation": "equals"
                    },
                    "leftValue": "={{ $json.intent }}",
                    "rightValue": "LEAD_CAPTURE"
                  }
                ]
              }
            },
            {
              "conditions": {
                "options": {
                  "version": 1,
                  "leftValue": "",
                  "caseSensitive": false,
                  "typeValidation": "strict"
                },
                "combinator": "and",
                "conditions": [
                  {
                    "operator": {
                      "type": "string",
                      "operation": "equals"
                    },
                    "leftValue": "={{ $json.intent }}",
                    "rightValue": "DOCUMENT_REQUEST"
                  }
                ]
              }
            },
            {
              "conditions": {
                "options": {
                  "version": 1,
                  "leftValue": "",
                  "caseSensitive": false,
                  "typeValidation": "strict"
                },
                "combinator": "and",
                "conditions": [
                  {
                    "operator": {
                      "type": "string",
                      "operation": "equals"
                    },
                    "leftValue": "={{ $json.intent }}",
                    "rightValue": "SUPPORT_TICKET"
                  }
                ]
              }
            },
            {
              "conditions": {
                "options": {
                  "version": 1,
                  "leftValue": "",
                  "caseSensitive": false,
                  "typeValidation": "strict"
                },
                "combinator": "and",
                "conditions": [
                  {
                    "operator": {
                      "type": "string",
                      "operation": "equals"
                    },
                    "leftValue": "={{ $json.intent }}",
                    "rightValue": "HUMAN_ESCALATION"
                  }
                ]
              }
            }
          ]
        },
        "options": {
          "fallbackOutput": "extra",
          "renameFallbackOutput": "FAQ / Small Talk"
        }
      },
      "typeVersion": 3.4
    },
    {
      "id": "854c5d4a-cb2c-4f33-a694-a9d2f2ab1263",
      "name": "Google Calendar",
      "type": "n8n-nodes-base.googleCalendar",
      "position": [
        1184,
        96
      ],
      "parameters": {
        "end": "={{ $now.plus(1, \"hour\").toISO() }}",
        "start": "={{ $json.metadata.datetime }}",
        "calendar": {
          "__rl": true,
          "mode": "list",
          "value": "primary"
        },
        "additionalFields": {
          "summary": "=Appointment for {{ $(\"Supabase: Load Session\").item.json.phone_number }}",
          "description": "={{ $json.response }}"
        }
      },
      "typeVersion": 1.3
    },
    {
      "id": "f51368ce-1604-4302-8463-139f29914ac7",
      "name": "Merge Intent Handlers",
      "type": "n8n-nodes-base.merge",
      "position": [
        1408,
        512
      ],
      "parameters": {
        "numberInputs": 6
      },
      "typeVersion": 3.2
    },
    {
      "id": "413aafd5-b9a8-4e97-a280-6420a152caac",
      "name": "HubSpot Contact",
      "type": "n8n-nodes-base.hubspot",
      "position": [
        1184,
        288
      ],
      "parameters": {
        "email": "={{ $json.metadata.email }}",
        "options": {},
        "authentication": "oAuth2",
        "additionalFields": {
          "lastName": "={{ $json.metadata.lastName }}",
          "firstName": "={{ $json.metadata.firstName }}",
          "phoneNumber": "={{ $('WhatsApp Webhook').item.json[\"entry[0]\"][\"changes[0]\"].value[\"messages[0]\"].from }}"
        }
      },
      "typeVersion": 2.2
    },
    {
      "id": "0acc91f4-8602-40b4-9a98-0130ec971aff",
      "name": "Gmail Send",
      "type": "n8n-nodes-base.gmail",
      "position": [
        960,
        480
      ],
      "parameters": {
        "sendTo": "={{ $json.metadata.email }}",
        "message": "={{ $json.response }}",
        "options": {
          "attachmentsUi": {
            "attachmentsBinary": [
              {
                "property": "document"
              }
            ]
          }
        },
        "subject": "Your Requested Document"
      },
      "credentials": {
        "gmailOAuth2": {
          "name": "<your credential>"
        }
      },
      "typeVersion": 2.2
    },
    {
      "id": "ab3b72c2-18df-49cf-b4e8-1ed4f9f8dd3a",
      "name": "Google Drive Upload",
      "type": "n8n-nodes-base.googleDrive",
      "position": [
        1184,
        480
      ],
      "parameters": {
        "name": "={{ $json.metadata?.fileName ?? \"document.pdf\" }}",
        "driveId": {
          "__rl": true,
          "mode": "list",
          "value": "My Drive"
        },
        "options": {},
        "folderId": {
          "__rl": true,
          "mode": "list",
          "value": "root"
        },
        "inputDataFieldName": "document"
      },
      "typeVersion": 3
    },
    {
      "id": "e7e9c0a0-1055-409c-abaa-672c0a47108b",
      "name": "Slack Notify",
      "type": "n8n-nodes-base.slack",
      "position": [
        960,
        672
      ],
      "parameters": {
        "text": "=New support ticket from {{ $(\"Supabase: Load Session\").item.json.phone_number }}:\n{{ $json.response }}",
        "select": "channel",
        "channelId": {
          "__rl": true,
          "mode": "list",
          "value": "support"
        },
        "otherOptions": {},
        "authentication": "oAuth2"
      },
      "typeVersion": 2.5
    },
    {
      "id": "e048a710-214c-49c2-9eb9-83ebf2e261d9",
      "name": "HubSpot Ticket",
      "type": "n8n-nodes-base.hubspot",
      "position": [
        1184,
        672
      ],
      "parameters": {
        "stageId": "1",
        "resource": "ticket",
        "pipelineId": "0",
        "ticketName": "=Support Request from {{ $(\"Supabase: Load Session\").item.json.phone_number }}",
        "authentication": "oAuth2",
        "additionalFields": {
          "priority": "MEDIUM",
          "description": "={{ $(\"Claude AI Agent\").item.json.response }}"
        }
      },
      "typeVersion": 2.2
    },
    {
      "id": "ab4da6fd-eac3-4249-9e34-aa4f6a9b3fab",
      "name": "Slack Escalation",
      "type": "n8n-nodes-base.slack",
      "position": [
        1184,
        864
      ],
      "parameters": {
        "text": "=\ud83d\udea8 URGENT: Human escalation needed for {{ $(\"Supabase: Load Session\").item.json.phone_number }}:\n{{ $json.response }}",
        "select": "channel",
        "channelId": {
          "__rl": true,
          "mode": "list",
          "value": "urgent"
        },
        "otherOptions": {},
        "authentication": "oAuth2"
      },
      "typeVersion": 2.5
    },
    {
      "id": "c552c5e0-c25e-4527-9fed-78cdc8e0f311",
      "name": "FAQ Response",
      "type": "n8n-nodes-base.set",
      "position": [
        1184,
        1056
      ],
      "parameters": {
        "options": {},
        "assignments": {
          "assignments": [
            {
              "id": "1",
              "name": "finalResponse",
              "type": "string",
              "value": "={{ $json.response }}"
            }
          ]
        }
      },
      "typeVersion": 3.4
    },
    {
      "id": "e92c74d8-10b2-42f9-b751-8a397777a10e",
      "name": "Supabase: Save Session",
      "type": "n8n-nodes-base.supabase",
      "position": [
        1632,
        480
      ],
      "parameters": {
        "filters": {
          "conditions": [
            {
              "keyName": "phone_number",
              "keyValue": "={{ $('WhatsApp Webhook').item.json[\"entry[0]\"][\"changes[0]\"].value[\"messages[0]\"].from }}",
              "condition": "eq"
            }
          ]
        },
        "tableId": "sessions",
        "fieldsUi": {
          "fieldValues": [
            {
              "fieldId": "session_history",
              "fieldValue": "={{ $(\"Claude AI Agent\").item.json }}"
            },
            {
              "fieldId": "updated_at",
              "fieldValue": "={{ $now.toISO() }}"
            }
          ]
        },
        "operation": "update"
      },
      "typeVersion": 1
    },
    {
      "id": "d9b049d0-5907-4d4c-b236-9f02fd6b1c48",
      "name": "Response Formatter",
      "type": "n8n-nodes-base.code",
      "position": [
        1632,
        672
      ],
      "parameters": {
        "mode": "runOnceForEachItem",
        "jsCode": "// Strip internal tags and format response\nconst response = $input.item.json.response || $input.item.json.finalResponse || '';\nconst cleanResponse = response.replace(/<internal>.*?<\\/internal>/gs, '').trim();\n\nreturn {\n  json: {\n    message: cleanResponse,\n    phoneNumber: $('WhatsApp Webhook').item.json.entry[0].changes[0].value.messages[0].from,\n    phoneNumberId: $('WhatsApp Webhook').item.json.entry[0].changes[0].value.metadata.phone_number_id\n  }\n};"
      },
      "typeVersion": 2
    },
    {
      "id": "8329351e-3d2d-4fce-bb2c-c882b2db33b3",
      "name": "WhatsApp Send",
      "type": "n8n-nodes-base.whatsApp",
      "position": [
        1856,
        672
      ],
      "parameters": {
        "textBody": "={{ $json.message }}",
        "operation": "send",
        "phoneNumberId": "={{ $json.phoneNumberId }}",
        "additionalFields": {},
        "recipientPhoneNumber": "={{ $json.phoneNumber }}"
      },
      "retryOnFail": true,
      "typeVersion": 1.1,
      "alwaysOutputData": true
    },
    {
      "id": "ef2bd909-af88-4f3f-a8df-6e138f4f6dde",
      "name": "Knowledge Base Tool",
      "type": "@n8n/n8n-nodes-langchain.vectorStoreSupabase",
      "position": [
        -784,
        800
      ],
      "parameters": {
        "mode": "retrieve-as-tool",
        "topK": 5,
        "options": {},
        "tableName": {
          "__rl": true,
          "mode": "list",
          "value": "knowledge_base"
        },
        "useReranker": true,
        "toolDescription": "Search the company knowledge base for product information, policies, FAQs, and support documentation"
      },
      "typeVersion": 1.3
    },
    {
      "id": "48feef4f-3beb-4955-a327-0570dbca7f1f",
      "name": "Cohere Reranker",
      "type": "@n8n/n8n-nodes-langchain.rerankerCohere",
      "position": [
        -304,
        1008
      ],
      "parameters": {},
      "typeVersion": 1
    },
    {
      "id": "e69704c9-275a-4351-bc88-487a4889b269",
      "name": "Google Calendar Tool",
      "type": "n8n-nodes-base.googleCalendarTool",
      "position": [
        -496,
        800
      ],
      "parameters": {
        "end": "={{ /*n8n-auto-generated-fromAI-override*/ $fromAI('end_time', 'Appointment end time in ISO format') }}",
        "start": "={{ /*n8n-auto-generated-fromAI-override*/ $fromAI('start_time', 'Appointment start time in ISO format') }}",
        "calendar": {
          "__rl": true,
          "mode": "list",
          "value": "primary"
        },
        "additionalFields": {
          "summary": "={{ /*n8n-auto-generated-fromAI-override*/ $fromAI('summary', 'Appointment title') }}",
          "description": "={{ /*n8n-auto-generated-fromAI-override*/ $fromAI('description', 'Appointment description') }}"
        }
      },
      "typeVersion": 1.3
    },
    {
      "id": "8d5d6d38-d9e0-49f1-b0d3-1815f6cae5f6",
      "name": "HubSpot Contact Tool",
      "type": "n8n-nodes-base.hubspotTool",
      "position": [
        -368,
        800
      ],
      "parameters": {
        "email": "={{ /*n8n-auto-generated-fromAI-override*/ $fromAI('email', 'Contact email address') }}",
        "options": {},
        "authentication": "oAuth2",
        "additionalFields": {
          "lastName": "={{ /*n8n-auto-generated-fromAI-override*/ $fromAI('lastName', 'Contact last name') }}",
          "firstName": "={{ /*n8n-auto-generated-fromAI-override*/ $fromAI('firstName', 'Contact first name') }}",
          "phoneNumber": "={{ $('WhatsApp Webhook').item.json.entry[0].changes[0].value.messages[0].from }}"
        }
      },
      "typeVersion": 2.2
    },
    {
      "id": "fd3ad756-a9fc-4454-9cd9-41f38dbe956c",
      "name": "HubSpot Ticket Tool",
      "type": "n8n-nodes-base.hubspotTool",
      "position": [
        -240,
        800
      ],
      "parameters": {
        "stageId": "1",
        "resource": "ticket",
        "pipelineId": "0",
        "ticketName": "={{ /*n8n-auto-generated-fromAI-override*/ $fromAI('ticketName', 'Support ticket title') }}",
        "authentication": "oAuth2",
        "additionalFields": {
          "priority": "={{ /*n8n-auto-generated-fromAI-override*/ $fromAI('priority', 'Ticket priority: LOW, MEDIUM, or HIGH') }}",
          "description": "={{ /*n8n-auto-generated-fromAI-override*/ $fromAI('description', 'Ticket description') }}"
        }
      },
      "typeVersion": 2.2
    },
    {
      "id": "f9464dcf-c412-4072-8a1e-198d2e54da43",
      "name": "Slack Tool",
      "type": "n8n-nodes-base.slackTool",
      "position": [
        -112,
        800
      ],
      "parameters": {
        "text": "={{ /*n8n-auto-generated-fromAI-override*/ $fromAI('message', 'Message to send to Slack') }}",
        "select": "channel",
        "channelId": {
          "__rl": true,
          "mode": "list",
          "value": "support"
        },
        "otherOptions": {},
        "authentication": "oAuth2"
      },
      "typeVersion": 2.5
    },
    {
      "id": "3ea6fd7d-70f2-49db-ae33-68c03aa8dab5",
      "name": "Gmail Tool",
      "type": "n8n-nodes-base.gmailTool",
      "position": [
        16,
        800
      ],
      "parameters": {
        "sendTo": "={{ /*n8n-auto-generated-fromAI-override*/ $fromAI('recipient', 'Recipient email address') }}",
        "message": "={{ /*n8n-auto-generated-fromAI-override*/ $fromAI('body', 'Email body content') }}",
        "options": {},
        "subject": "={{ /*n8n-auto-generated-fromAI-override*/ $fromAI('subject', 'Email subject') }}"
      },
      "credentials": {
        "gmailOAuth2": {
          "name": "<your credential>"
        }
      },
      "typeVersion": 2.2
    },
    {
      "id": "69f6ae78-a518-414c-89d7-547542ca1480",
      "name": "Track Analytics",
      "type": "n8n-nodes-base.dataTable",
      "position": [
        512,
        576
      ],
      "parameters": {
        "columns": {
          "value": {
            "intent": "={{ $json.intent }}",
            "sentiment": "={{ $(\"Sentiment + Language Detection\").item.json.sentiment }}",
            "timestamp": "={{ $now.toISO() }}",
            "message_type": "={{ $(\"WhatsApp Webhook\").item.json.entry[0].changes[0].value.messages[0].type }}",
            "phone_number": "={{ $(\"WhatsApp Webhook\").item.json.entry[0].changes[0].value.messages[0].from }}",
            "response_length": "={{ $json.response.length }}"
          },
          "schema": [
            {
              "id": "phone_number",
              "type": "string",
              "display": true,
              "required": false,
              "displayName": "phone_number",
              "defaultMatch": false,
              "canBeUsedToMatch": true
            },
            {
              "id": "intent",
              "type": "string",
              "display": true,
              "required": false,
              "displayName": "intent",
              "defaultMatch": false,
              "canBeUsedToMatch": true
            },
            {
              "id": "sentiment",
              "type": "string",
              "display": true,
              "required": false,
              "displayName": "sentiment",
              "defaultMatch": false,
              "canBeUsedToMatch": true
            },
            {
              "id": "message_type",
              "type": "string",
              "display": true,
              "required": false,
              "displayName": "message_type",
              "defaultMatch": false,
              "canBeUsedToMatch": true
            },
            {
              "id": "timestamp",
              "type": "string",
              "display": true,
              "required": false,
              "displayName": "timestamp",
              "defaultMatch": false,
              "canBeUsedToMatch": true
            },
            {
              "id": "response_length",
              "type": "number",
              "display": true,
              "required": false,
              "displayName": "response_length",
              "defaultMatch": false,
              "canBeUsedToMatch": true
            }
          ],
          "mappingMode": "defineBelow"
        },
        "options": {},
        "dataTableId": {
          "__rl": true,
          "mode": "name",
          "value": "conversation_analytics"
        }
      },
      "typeVersion": 1.1
    },
    {
      "id": "85a9da14-c5a2-40da-aca6-0ff37c6ee935",
      "name": "Simple Memory",
      "type": "@n8n/n8n-nodes-langchain.memoryBufferWindow",
      "position": [
        -912,
        800
      ],
      "parameters": {},
      "typeVersion": 1.4
    },
    {
      "id": "1650c3ae-3a6e-48a8-8e17-7266a315a4c9",
      "name": "Sticky Note d192ba89",
      "type": "n8n-nodes-base.stickyNote",
      "position": [
        -3040,
        192
      ],
      "parameters": {
        "width": 480,
        "height": 720,
        "content": "## \ud83d\udcf1 WhatsApp AI Support Agent\n\n**What it does**\nAn AI customer-support agent for WhatsApp. It accepts text, voice, image and document messages, understands them, and replies automatically \u2014 while booking appointments, capturing leads, creating support tickets, and escalating urgent cases to a human.\n\n**How it works**\n1. A WhatsApp message arrives and is routed by type: audio \u2192 Whisper, image \u2192 GPT-4o Vision, document \u2192 parser, text \u2192 pass-through.\n2. The user session is loaded from Supabase and sentiment/language is detected.\n3. The Claude agent answers using a knowledge base plus Calendar, HubSpot, Slack and Gmail tools, returning a structured intent.\n4. The intent router runs the matching action, saves the session, logs analytics, and replies on WhatsApp.\n\n**Setup**\n- [ ] Connect WhatsApp Business Cloud (trigger + send)\n- [ ] Add Anthropic + OpenAI API keys\n- [ ] Connect Supabase (`sessions` table + `knowledge_base` vector table)\n- [ ] Connect Google Calendar, Drive, HubSpot, Slack, Gmail, Cohere\n- [ ] Create the `conversation_analytics` data table\n\n**Customize**\nEdit the agent system prompt, swap models, or add/remove intent branches and tools to match your business."
      },
      "typeVersion": 1
    },
    {
      "id": "890ed7b4-596c-4204-8582-98a1db513aba",
      "name": "Sticky Note ed2c234f",
      "type": "n8n-nodes-base.stickyNote",
      "position": [
        -2544,
        192
      ],
      "parameters": {
        "color": 7,
        "width": 972,
        "height": 776,
        "content": "## \ud83d\udce5 Input Processing\n\nRoutes each incoming WhatsApp message by type and converts audio, images and documents into text before merging all paths."
      },
      "typeVersion": 1
    },
    {
      "id": "d5661307-b878-481f-9c08-73586b199e92",
      "name": "Sticky Note 82e09893",
      "type": "n8n-nodes-base.stickyNote",
      "position": [
        -1456,
        432
      ],
      "parameters": {
        "color": 7,
        "width": 300,
        "height": 320,
        "content": "## \ud83e\udde0 Context & Analysis\n\nLoads the user session from Supabase and detects sentiment and language to give the agent context."
      },
      "typeVersion": 1
    },
    {
      "id": "0ce43499-31d6-407e-a3dc-947fc7cd89a9",
      "name": "Sticky Note 915a471b",
      "type": "n8n-nodes-base.stickyNote",
      "position": [
        -1120,
        432
      ],
      "parameters": {
        "color": 7,
        "width": 1000,
        "height": 720,
        "content": "## \ud83e\udd16 AI Agent Core\n\nClaude answers using the knowledge base, memory and business tools (Calendar, HubSpot, Slack, Gmail), returning a structured intent for routing."
      },
      "typeVersion": 1
    },
    {
      "id": "2b5bc45a-45fb-4b07-927a-b488440106ec",
      "name": "Sticky Note b0a94513",
      "type": "n8n-nodes-base.stickyNote",
      "position": [
        448,
        0
      ],
      "parameters": {
        "color": 7,
        "width": 1050,
        "height": 1200,
        "content": "## \ud83c\udfaf Intent Routing\n\nSends the detected intent to the right handler \u2014 booking, lead capture, document, ticket, escalation or FAQ \u2014 then merges the results."
      },
      "typeVersion": 1
    },
    {
      "id": "754bf23b-0b5f-4e66-a292-be218b6138d0",
      "name": "Sticky Note ae158859",
      "type": "n8n-nodes-base.stickyNote",
      "position": [
        1568,
        400
      ],
      "parameters": {
        "color": 7,
        "width": 460,
        "height": 420,
        "content": "## \ud83d\udce4 Output & Persistence\n\nSaves the conversation to Supabase, logs analytics, then formats and sends the reply back on WhatsApp."
      },
      "typeVersion": 1
    },
    {
      "id": "b7f1e0d2-1a2b-4c3d-9e8f-0a1b2c3d4e5f",
      "name": "Setup Warning",
      "type": "n8n-nodes-base.stickyNote",
      "position": [
        -3040,
        944
      ],
      "parameters": {
        "color": 3,
        "width": 480,
        "height": 260,
        "content": "## \u26a0\ufe0f Before you activate\n\nThe agent will not respond until **every** credential is connected. At minimum you must configure **Anthropic**, **OpenAI**, and **Supabase** (the `sessions` table + `knowledge_base` vector store).\n\nAlso confirm your WhatsApp Business number and webhook are registered in the Meta developer console."
      },
      "typeVersion": 1
    },
    {
      "id": "a20f1116-898b-4464-b7d5-3a8563a7fdae",
      "name": "Anthropic Chat Model",
      "type": "@n8n/n8n-nodes-langchain.lmChatAnthropic",
      "position": [
        -1040,
        800
      ],
      "parameters": {
        "model": {
          "__rl": true,
          "mode": "list",
          "value": "claude-sonnet-4-6",
          "cachedResultName": "Claude Sonnet 4.6"
        },
        "options": {}
      },
      "typeVersion": 1.5
    }
  ],
  "active": false,
  "settings": {
    "binaryMode": "separate",
    "availableInMCP": false,
    "executionOrder": "v1"
  },
  "versionId": "bfadde30-c3fe-46cc-858f-0f83ffae88f8",
  "nodeGroups": [],
  "connections": {
    "Gmail Send": {
      "main": [
        [
          {
            "node": "Google Drive Upload",
            "type": "main",
            "index": 0
          }
        ]
      ]
    },
    "Gmail Tool": {
      "ai_tool": [
        [
          {
            "node": "Claude AI Agent",
            "type": "ai_tool",
            "index": 0
          }
        ]
      ]
    },
    "Slack Tool": {
      "ai_tool": [
        [
          {
            "node": "Claude AI Agent",
            "type": "ai_tool",
            "index": 0
          }
        ]
      ]
    },
    "Whisper STT": {
      "main": [
        [
          {
            "node": "Merge Message Types",
            "type": "main",
            "index": 0
          }
        ]
      ]
    },
    "FAQ Response": {
      "main": [
        [
          {
            "node": "Merge Intent Handlers",
            "type": "main",
            "index": 5
          }
        ]
      ]
    },
    "Slack Notify": {
      "main": [
        [
          {
            "node": "HubSpot Ticket",
            "type": "main",
            "index": 0
          }
        ]
      ]
    },
    "GPT-4o Vision": {
      "main": [
        [
          {
            "node": "Merge Message Types",
            "type": "main",
            "index": 1
          }
        ]
      ]
    },
    "Intent Router": {
      "main": [
        [
          {
            "node": "Google Calendar",
            "type": "main",
            "index": 0
          }
        ],
        [
          {
            "node": "HubSpot Contact",
            "type": "main",
            "index": 0
          }
        ],
        [
          {
            "node": "Gmail Send",
            "type": "main",
            "index": 0
          }
        ],
        [
          {
            "node": "Slack Notify",
            "type": "main",
            "index": 0
          }
        ],
        [
          {
            "node": "Slack Escalation",
            "type": "main",
            "index": 0
          }
        ],
        [
          {
            "node": "FAQ Response",
            "type": "main",
            "index": 0
          }
        ]
      ]
    },
    "Simple Memory": {
      "ai_memory": [
        [
          {
            "node": "Claude AI Agent",
            "type": "ai_memory",
            "index": 0
          }
        ]
      ]
    },
    "HubSpot Ticket": {
      "main": [
        [
          {
            "node": "Merge Intent Handlers",
            "type": "main",
            "index": 3
          }
        ]
      ]
    },
    "Claude AI Agent": {
      "main": [
        [
          {
            "node": "Track Analytics",
            "type": "main",
            "index": 0
          }
        ]
      ]
    },
    "Cohere Reranker": {
      "ai_reranker": [
        [
          {
            "node": "Knowledge Base Tool",
            "type": "ai_reranker",
            "index": 0
          }
        ]
      ]
    },
    "Google Calendar": {
      "main": [
        [
          {
            "node": "Merge Intent Handlers",
            "type": "main",
            "index": 0
          }
        ]
      ]
    },
    "HubSpot Contact": {
      "main": [
        [
          {
            "node": "Merge Intent Handlers",
            "type": "main",
            "index": 1
          }
        ]
      ]
    },
    "PDF/DOCX Parser": {
      "main": [
        [
          {
            "node": "Merge Message Types",
            "type": "main",
            "index": 2
          }
        ]
      ]
    },
    "Track Analytics": {
      "main": [
        [
          {
            "node": "Intent Router",
            "type": "main",
            "index": 0
          }
        ]
      ]
    },
    "Slack Escalation": {
      "main": [
        [
          {
            "node": "Merge Intent Handlers",
            "type": "main",
            "index": 4
          }
        ]
      ]
    },
    "WhatsApp Webhook": {
      "main": [
        [
          {
            "node": "Message Type Router",
            "type": "main",
            "index": 0
          }
        ]
      ]
    },
    "OpenAI Embeddings": {
      "ai_embedding": [
        [
          {
            "node": "Knowledge Base Tool",
            "type": "ai_embedding",
            "index": 0
          }
        ]
      ]
    },
    "Text Pass Through": {
      "main": [
        [
          {
            "node": "Merge Message Types",
            "type": "main",
            "index": 3
          }
        ]
      ]
    },
    "Response Formatter": {
      "main": [
        [
          {
            "node": "WhatsApp Send",
            "type": "main",
            "index": 0
          }
        ]
      ]
    },
    "Google Drive Upload": {
      "main": [
        [
          {
            "node": "Merge Intent Handlers",
            "type": "main",
            "index": 2
          }
        ]
      ]
    },
    "HubSpot Ticket Tool": {
      "ai_tool": [
        [
          {
            "node": "Claude AI Agent",
            "type": "ai_tool",
            "index": 0
          }
        ]
      ]
    },
    "Knowledge Base Tool": {
      "ai_tool": [
        [
          {
            "node": "Claude AI Agent",
            "type": "ai_tool",
            "index": 0
          }
        ]
      ]
    },
    "Merge Message Types": {
      "main": [
        [
          {
            "node": "Supabase: Load Session",
            "type": "main",
            "index": 0
          }
        ]
      ]
    },
    "Message Type Router": {
      "main": [
        [
          {
            "node": "Whisper STT",
            "type": "main",
            "index": 0
          }
        ],
        [
          {
            "node": "GPT-4o Vision",
            "type": "main",
            "index": 0
          }
        ],
        [
          {
            "node": "PDF/DOCX Parser",
            "type": "main",
            "index": 0
          }
        ],
        [
          {
            "node": "Text Pass Through",
            "type": "main",
            "index": 0
          }
        ]
      ]
    },
    "Anthropic Chat Model": {
      "ai_languageModel": [
        [
          {
            "node": "Claude AI Agent",
            "type": "ai_languageModel",
            "index": 0
          }
        ]
      ]
    },
    "Google Calendar Tool": {
      "ai_tool": [
        [
          {
            "node": "Claude AI Agent",
            "type": "ai_tool",
            "index": 0
          }
        ]
      ]
    },
    "HubSpot Contact Tool": {
      "ai_tool": [
        [
          {
            "node": "Claude AI Agent",
            "type": "ai_tool",
            "index": 0
          }
        ]
      ]
    },
    "Merge Intent Handlers": {
      "main": [
        [
          {
            "node": "Supabase: Save Session",
            "type": "main",
            "index": 0
          },
          {
            "node": "Response Formatter",
            "type": "main",
            "index": 0
          }
        ]
      ]
    },
    "OpenAI Model (Parser)": {
      "ai_languageModel": [
        [
          {
            "node": "Structured Output Parser",
            "type": "ai_languageModel",
            "index": 0
          }
        ]
      ]
    },
    "Supabase: Load Session": {
      "main": [
        [
          {
            "node": "Sentiment + Language Detection",
            "type": "main",
            "index": 0
          }
        ]
      ]
    },
    "OpenAI Model (Sentiment)": {
      "ai_languageModel": [
        [
          {
            "node": "Sentiment + Language Detection",
            "type": "ai_languageModel",
            "index": 0
          }
        ]
      ]
    },
    "Structured Output Parser": {
      "ai_outputParser": [
        [
          {
            "node": "Claude AI Agent",
            "type": "ai_outputParser",
            "index": 0
          }
        ]
      ]
    },
    "Sentiment + Language Detection": {
      "main": [
        [
          {
            "node": "Claude AI Agent",
            "type": "main",
            "index": 0
          }
        ]
      ]
    }
  }
}

Credentials you'll need

Each integration node will prompt for credentials when you import. We strip credential IDs before publishing — you'll add your own.

Pro

For the full experience including quality scoring and batch install features for each workflow upgrade to Pro

About this workflow

This workflow turns incoming WhatsApp messages (text, audio, images, and documents) into actionable support interactions by extracting content, detecting sentiment, and using an AI agent with a Supabase knowledge base to route requests to Google Calendar, HubSpot, Slack, Gmail,…

Source: https://n8n.io/workflows/17006/ — original creator credit. Request a take-down →

More AI & RAG workflows → · Browse all categories →

Related workflows

Workflows that share integrations, category, or trigger type with this one. All free to copy and import.

AI & RAG

A lightweight, self-hosted AI assistant built entirely in n8n. Multi-channel messaging (Telegram, WhatsApp, Gmail), persistent memory, task management, and autonomous work — all in a single visual wor

Telegram Trigger, OpenRouter Chat, Data Table +20
AI & RAG

This workflow implements an advanced AI automation agent (OpenClaw Agent) that interacts with users through Telegram and integrates multiple AI models, external tools, and cloud services to automate c

Telegram Trigger, Telegram, OpenAI +21
AI & RAG

📌 Overview

Redis, WhatsApp, OpenAI Chat +12
AI & RAG

Alfred (funcional). Uses gmailTool, googleCalendarTool, gmail, embeddingsOpenAi. Event-driven trigger; 83 nodes.

Gmail Tool, Google Calendar Tool, Gmail +24
AI & RAG

Your AI workforce is ready. Are you?

Google Sheets Tool, Mcp Trigger, Google Drive +29