AutomationFlowsAI & RAG › Ai-powered E-commerce Customer Support Chatbot with Gpt-4 & Supabase

Ai-powered E-commerce Customer Support Chatbot with Gpt-4 & Supabase

BySehar Nazeer @automates-with-eaze on n8n.io

This AI-powered customer support automation built in n8n handles your e-commerce queries instantly — from order tracking to personalized product recommendations and support ticket management. Features: 🛒 Order Status Tracking: Instantly retrieve order details from your database.…

Webhook trigger★★★★☆ complexityAI-powered27 nodesAgentOpenAI ChatSupabase ToolMemory Buffer WindowTool CodeGmail Tool
AI & RAG Trigger: Webhook Nodes: 27 Complexity: ★★★★☆ AI nodes: yes Added:

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

This workflow follows the Agent → Gmail Tool 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": "uuSl9lDT5Kvcmorr",
  "meta": {
    "templateCredsSetupCompleted": true
  },
  "name": "Customer Support",
  "tags": [],
  "nodes": [
    {
      "id": "dfd932f3-1fe2-49a4-b914-a6d9c69cdbf6",
      "name": "AI Agent",
      "type": "@n8n/n8n-nodes-langchain.agent",
      "position": [
        -220,
        -20
      ],
      "parameters": {
        "text": "=Here is the query of user  {{ $json.body.message }}",
        "options": {
          "systemMessage": "=You are an AI assistant that classifies customer support queries.\n\nYour task is to:\n1. Understand the user's message.\n2. Identify the **intent** behind the query.\n3. Extract any **mentioned product** or item.\n4. Respond in **strict JSON format**.\n5. If user did not asking about these things then reply with the assitant tone . don't forecfully try to classify everything to certain category.\n\nPossible intents:\n- \"order_status\" \u2192 Asking about delivery, shipping, or order update.\n- \"support_ticket\" \u2192 Complaints, issues, or help requests.\n- \"product_recommendation\" \u2192 Asking for product suggestions or alternatives.\n\nHere are some examples:\n\n---\nUser: \"Where is my headset?\"\nOutput:\n{ \"intent\": \"order_status\", \"product\": \"headset\" }\n\n---\nUser: \"My keyboard hasn\u2019t arrived yet.\"\nOutput:\n{ \"intent\": \"order_status\", \"product\": \"keyboard\" }\n\n---\nUser: \"I need help with a broken mouse.\"\nOutput:\n{ \"intent\": \"support_ticket\", \"product\": \"mouse\" }\n\n---\nUser: \"Can you suggest something similar to a gaming chair?\"\nOutput:\n{ \"intent\": \"product_recommendation\", \"product\": \"gaming chair\" }\n\n---\nUser: \"Thanks for your help\"\nOutput:\n{ \"intent\":\"general\", \"product\":\"Happy to assists you . What else you need . Aske me i can help.\"}\n\n\n"
        },
        "promptType": "define"
      },
      "typeVersion": 2
    },
    {
      "id": "dd1aa1e5-eaa2-4617-85e5-71f93a4327bd",
      "name": "OpenAI Chat Model",
      "type": "@n8n/n8n-nodes-langchain.lmChatOpenAi",
      "position": [
        -220,
        160
      ],
      "parameters": {
        "model": {
          "__rl": true,
          "mode": "list",
          "value": "gpt-4o-mini"
        },
        "options": {}
      },
      "credentials": {
        "openAiApi": {
          "name": "<your credential>"
        }
      },
      "typeVersion": 1.2
    },
    {
      "id": "37a5d705-e4a3-43c5-9405-077f0bc2827c",
      "name": "Code",
      "type": "n8n-nodes-base.code",
      "position": [
        80,
        -20
      ],
      "parameters": {
        "jsCode": "// Loop over input items and add a new field called 'myNewField' to the JSON of each one\nresponse= JSON.parse($input.first().json.output)\nreturn {\"category\":response}"
      },
      "typeVersion": 2
    },
    {
      "id": "865fc0d3-679a-4368-8605-75a94bb00f59",
      "name": "Switch",
      "type": "n8n-nodes-base.switch",
      "position": [
        280,
        0
      ],
      "parameters": {
        "rules": {
          "values": [
            {
              "conditions": {
                "options": {
                  "version": 2,
                  "leftValue": "",
                  "caseSensitive": true,
                  "typeValidation": "strict"
                },
                "combinator": "and",
                "conditions": [
                  {
                    "id": "52528583-0e80-4335-aa15-660d2d500108",
                    "operator": {
                      "type": "string",
                      "operation": "equals"
                    },
                    "leftValue": "={{ $json.category.intent }}",
                    "rightValue": "order_status"
                  }
                ]
              }
            },
            {
              "conditions": {
                "options": {
                  "version": 2,
                  "leftValue": "",
                  "caseSensitive": true,
                  "typeValidation": "strict"
                },
                "combinator": "and",
                "conditions": [
                  {
                    "id": "fb71b829-1006-4f9f-80ed-3458d5ce4b63",
                    "operator": {
                      "name": "filter.operator.equals",
                      "type": "string",
                      "operation": "equals"
                    },
                    "leftValue": "={{ $json.category.intent }}",
                    "rightValue": "product_recommendation"
                  }
                ]
              }
            },
            {
              "conditions": {
                "options": {
                  "version": 2,
                  "leftValue": "",
                  "caseSensitive": true,
                  "typeValidation": "strict"
                },
                "combinator": "and",
                "conditions": [
                  {
                    "id": "ec099566-32cf-408b-a502-7d0f6ca742f4",
                    "operator": {
                      "name": "filter.operator.equals",
                      "type": "string",
                      "operation": "equals"
                    },
                    "leftValue": "={{ $json.category.intent }}",
                    "rightValue": "support_ticket"
                  }
                ]
              }
            },
            {
              "conditions": {
                "options": {
                  "version": 2,
                  "leftValue": "",
                  "caseSensitive": true,
                  "typeValidation": "strict"
                },
                "combinator": "and",
                "conditions": [
                  {
                    "id": "d3ad5c59-2938-4fc6-ad0f-c9fec160c589",
                    "operator": {
                      "name": "filter.operator.equals",
                      "type": "string",
                      "operation": "equals"
                    },
                    "leftValue": "={{ $json.category.intent }}",
                    "rightValue": "general"
                  }
                ]
              }
            }
          ]
        },
        "options": {
          "allMatchingOutputs": true
        }
      },
      "typeVersion": 3.2
    },
    {
      "id": "83768852-add1-4a23-a407-9a193b821580",
      "name": "Sticky Note",
      "type": "n8n-nodes-base.stickyNote",
      "position": [
        240,
        -120
      ],
      "parameters": {
        "height": 100,
        "content": "#### order_status\n#### product_recommendations\n#### support_ticket\n"
      },
      "typeVersion": 1
    },
    {
      "id": "95fbe02c-e9b1-4fc1-9444-2b98e76e3b99",
      "name": "Order Queries",
      "type": "@n8n/n8n-nodes-langchain.agent",
      "position": [
        840,
        -500
      ],
      "parameters": {
        "text": "=The query of the user is this .{{ $('Webhook').item.json.body.message }}",
        "options": {
          "systemMessage": "=You are a helpful AI assistant that handles customer support queries related to order tracking.\n\nYour job is to:\n1. Understand the customer's query.\n2. Extract any useful details like:\n   - `order_id` (e.g., ORD001)\n   - `product` name (e.g., keyboard)\n   - `customer_name` (optional, fallback if no order_id is given)\n3. If the intent is to check order status, you MUST call the `getOrderStatus` tool with the extracted order_id or product.\n4. Wait for the result from the tool and then respond clearly with the order status and ETA.\n\n---\n\nExamples:\n\nUser: \"Where is my keyboard? I think it was order ORD001\"\n\u2192 Extract:\n{\n  \"intent\": \"order_status\",\n  \"order_id\": \"ORD001\",\n  \"product\": \"keyboard\"\n}\n\u2192 Then call: getOrderStatus(order_id = \"ORD001\")\n\n---\n\nUser: \"I ordered a mouse last week. When will it arrive?\"\n\u2192 Extract:\n{\n  \"intent\": \"order_status\",\n  \"product\": \"mouse\"\n}\n\u2192 Then ask about the order_id first then move further\n\n---\n\nUser: \"I haven\u2019t received my microphone yet\"\n\u2192 Extract:\n{\n  \"intent\": \"order_status\",\n  \"product\": \"microphone\"\n}\n\u2192 Then call: getOrderStatus(product = \"microphone\")\n\n---\n\nIf you do not have enough information to look up the order, ask for the `order ID` or product name politely.\n\nALWAYS return your final answer to the user in natural, friendly language, after getting the result from `getOrderStatus`.\n\nThe result value should be of string .\n"
        },
        "promptType": "define"
      },
      "typeVersion": 2
    },
    {
      "id": "9fe7972e-c225-4918-b8ad-5b30e35c6535",
      "name": "getOrderStatus",
      "type": "n8n-nodes-base.supabaseTool",
      "position": [
        1240,
        -320
      ],
      "parameters": {
        "filters": {
          "conditions": [
            {
              "keyName": "order_id",
              "keyValue": "={{ /*n8n-auto-generated-fromAI-override*/ $fromAI('conditions0_Value', ``, 'string') }}"
            }
          ]
        },
        "tableId": "orders",
        "operation": "get"
      },
      "credentials": {
        "supabaseApi": {
          "name": "<your credential>"
        }
      },
      "typeVersion": 1
    },
    {
      "id": "37d2380c-1f86-4d33-a8a1-096df1aa8741",
      "name": "OpenAI Chat Model1",
      "type": "@n8n/n8n-nodes-langchain.lmChatOpenAi",
      "position": [
        860,
        -300
      ],
      "parameters": {
        "model": {
          "__rl": true,
          "mode": "list",
          "value": "gpt-4o-mini"
        },
        "options": {}
      },
      "credentials": {
        "openAiApi": {
          "name": "<your credential>"
        }
      },
      "typeVersion": 1.2
    },
    {
      "id": "2075ef0b-9415-4267-9d79-f9b5cd752fcb",
      "name": "Simple Memory",
      "type": "@n8n/n8n-nodes-langchain.memoryBufferWindow",
      "position": [
        1080,
        -280
      ],
      "parameters": {
        "sessionKey": "={{ $('Webhook').item.json.body.session_id }}",
        "sessionIdType": "customKey",
        "contextWindowLength": 7
      },
      "typeVersion": 1.3
    },
    {
      "id": "5a1f1e85-580a-489a-8e89-0d0065f5bfe8",
      "name": "Simple Memory1",
      "type": "@n8n/n8n-nodes-langchain.memoryBufferWindow",
      "position": [
        -40,
        180
      ],
      "parameters": {
        "sessionKey": "={{ $json.body.session_id }}",
        "sessionIdType": "customKey",
        "contextWindowLength": 7
      },
      "typeVersion": 1.3
    },
    {
      "id": "fe9f6c92-70d3-4ef9-90e3-f39f16d2a548",
      "name": "AI Agent1",
      "type": "@n8n/n8n-nodes-langchain.agent",
      "position": [
        760,
        340
      ],
      "parameters": {
        "text": "=The message/qiery of the user {{ $('Webhook').item.json.body.message }}",
        "options": {
          "systemMessage": "=You are a smart and polite AI assistant that helps users manage customer support tickets.\n\nYou have **two main responsibilities**:\n1. \ud83d\udcdd Help users **create a new support ticket** when they report an issue.\n2. \ud83d\udcca Help users **check the status** of an existing support ticket using their ticket ID.\n\n---\n\n### 1. SUPPORT TICKET CREATION\n\nIf the user reports an issue with a product (e.g., \u201cmy keyboard is not working\u201d), your task is to:\n\n\u2705 Collect the following required information:\n\n- `user_email` \u2192 The customer's email address  \n   - If the email is not provided, ask the user to share it.\n   - Warn them that this email will be used by the company to contact them, so it must be correct.\n\n- `product` \u2192 The name of the product involved in the issue.\n\n- `issue` \u2192 A clear description of the problem.\n\n- `ticket_id` \u2192 Call the **Code tool** to generate a unique ticket ID.  \n   **Do NOT generate the ticket ID yourself.**\n\n---\n\n\u2705 Once all required fields are collected:\n\n- Call the **`createSupportTicket`** tool using:\n  - `ticket_id` (from the Code tool)\n  - `user_email`\n  - `product`\n  - `issue`\n  - `status = open`\n\n- Then, politely respond to the user like this:\n\n> \u201cThanks! Your support ticket has been created with Ticket ID **TKT-20250711-8471**. Our team will contact you at **ali@example.com**. You can use this ID anytime to check the ticket's progress.\u201d\n\n---\n\n\u2705 Also, **send an email** to the company or support team with the ticket info using a connected email tool (e.g., SendGrid or SMTP):\n- Subject: `New Support Ticket Created - TKT-20250711-8471`\n- Include: `user_email`, `product`, `issue`\n\n---\n\n### 2. CHECK TICKET STATUS\n\nIf the user asks about an existing ticket's progress (e.g., \u201cWhat's the update on TKT-20250711-8471?\u201d):\n\n\u2705 Steps:\n- Extract the `ticket_id` from the message.\n- If not provided, ask the user to share their ticket ID.\n- Once available, call the **`getTicketStatus`** tool using the `ticket_id`.\n\n\u2705 Respond back to the user with:\n\n> \u201cYour ticket **TKT-20250711-8471** is currently marked as **in progress**.  \n> Update: Our technician is working on your issue and will follow up soon.\u201d\n\n---\n\n### BEHAVIOR RULES:\n\n- Always use a helpful, natural, and polite tone.\n- Don\u2019t make up any values \u2014 especially ticket IDs.\n- Don\u2019t submit the ticket until all required fields are collected.\n- If any field is missing, gently ask for it.\n\n---\n\n### EXAMPLE DIALOGUE:\n\n**User**: \u201cMy monitor keeps flickering.\u201d\n\u2192 Ask: \u201cI\u2019m sorry to hear that! Can you please share your email address? We\u2019ll use it to contact you with updates.\u201d\n\n**User**: \u201cMy headset is broken. Email: sara@example.com\u201d\n\u2192 Extract all info \u2192 Call Code tool for `ticket_id` \u2192 Call `createSupportTicket` \u2192 Respond with confirmation + ID\n\n**User**: \u201cWhat\u2019s going on with ticket TKT-20250711-8471?\u201d\n\u2192 Extract ID \u2192 Call `getTicketStatus` \u2192 Respond with current status and update notes\n\n---\n\nFollow these steps carefully to manage all support ticket interactions.\n\n\n## Important\n- don't the output with ** , / or any element which cause the invalid json while parsing. "
        },
        "promptType": "define"
      },
      "typeVersion": 2
    },
    {
      "id": "40fe3c62-7dd5-4db7-9179-e773cc151a0f",
      "name": "handle support tickets",
      "type": "@n8n/n8n-nodes-langchain.lmChatOpenAi",
      "position": [
        500,
        600
      ],
      "parameters": {
        "model": {
          "__rl": true,
          "mode": "list",
          "value": "gpt-4o-mini"
        },
        "options": {}
      },
      "credentials": {
        "openAiApi": {
          "name": "<your credential>"
        }
      },
      "typeVersion": 1.2
    },
    {
      "id": "2760705d-0971-46c8-bf42-a16e08341ca0",
      "name": "Simple Memory2",
      "type": "@n8n/n8n-nodes-langchain.memoryBufferWindow",
      "position": [
        640,
        620
      ],
      "parameters": {
        "sessionKey": "={{ $('Webhook').item.json.body.session_id }}",
        "sessionIdType": "customKey",
        "contextWindowLength": 7
      },
      "typeVersion": 1.3
    },
    {
      "id": "55cbecd5-9e0c-482c-89ff-413b8fb4b35b",
      "name": "Code Tool",
      "type": "@n8n/n8n-nodes-langchain.toolCode",
      "position": [
        860,
        640
      ],
      "parameters": {
        "jsCode": "const now = new Date();\nconst dateStr = now.toISOString().slice(0,10).replace(/-/g, '');\nconst random = Math.floor(1000 + Math.random() * 9000); // 4-digit code\nconst ticket_id = `TKT-${dateStr}-${random}`;\nreturn ticket_id",
        "description": "Call this tool to create the unique Ticket Id"
      },
      "typeVersion": 1.2
    },
    {
      "id": "eb443fb8-fd18-4983-b1c3-91f1c92d7563",
      "name": "Send",
      "type": "n8n-nodes-base.gmailTool",
      "position": [
        1140,
        620
      ],
      "parameters": {
        "sendTo": "user@example.com",
        "message": "={{ /*n8n-auto-generated-fromAI-override*/ $fromAI('Message', ``, 'string') }}",
        "options": {},
        "subject": "={{ /*n8n-auto-generated-fromAI-override*/ $fromAI('Subject', ``, 'string') }}"
      },
      "credentials": {
        "gmailOAuth2": {
          "name": "<your credential>"
        }
      },
      "typeVersion": 2.1
    },
    {
      "id": "35975b58-ce77-4837-b098-a5673ce5dc6f",
      "name": "createSupportTicket",
      "type": "n8n-nodes-base.supabaseTool",
      "position": [
        1000,
        640
      ],
      "parameters": {
        "tableId": "support_tickets",
        "fieldsUi": {
          "fieldValues": [
            {
              "fieldId": "ticket_id",
              "fieldValue": "={{ /*n8n-auto-generated-fromAI-override*/ $fromAI('fieldValues0_Field_Value', ``, 'string') }}"
            },
            {
              "fieldId": "user_email",
              "fieldValue": "={{ /*n8n-auto-generated-fromAI-override*/ $fromAI('fieldValues1_Field_Value', ``, 'string') }}"
            },
            {
              "fieldId": "product",
              "fieldValue": "={{ /*n8n-auto-generated-fromAI-override*/ $fromAI('fieldValues2_Field_Value', ``, 'string') }}"
            },
            {
              "fieldId": "issue",
              "fieldValue": "={{ /*n8n-auto-generated-fromAI-override*/ $fromAI('fieldValues3_Field_Value', ``, 'string') }}"
            },
            {
              "fieldId": "status",
              "fieldValue": "={{ /*n8n-auto-generated-fromAI-override*/ $fromAI('fieldValues4_Field_Value', ``, 'string') }}"
            }
          ]
        }
      },
      "credentials": {
        "supabaseApi": {
          "name": "<your credential>"
        }
      },
      "typeVersion": 1
    },
    {
      "id": "dcd292e1-bb3b-441e-a4bf-8b730bbc353f",
      "name": "getTicketStatus",
      "type": "n8n-nodes-base.supabaseTool",
      "position": [
        1260,
        600
      ],
      "parameters": {
        "filters": {
          "conditions": [
            {
              "keyName": "ticket_id",
              "keyValue": "={{ /*n8n-auto-generated-fromAI-override*/ $fromAI('conditions0_Value', ``, 'string') }}"
            }
          ]
        },
        "tableId": "support_tickets",
        "operation": "get",
        "descriptionType": "manual",
        "toolDescription": "Tool can retrieve the information about any support ticket by its Ticket ID"
      },
      "credentials": {
        "supabaseApi": {
          "name": "<your credential>"
        }
      },
      "typeVersion": 1
    },
    {
      "id": "a7b25883-96b5-4d98-9c9b-37fcd23d5315",
      "name": "Recommendations",
      "type": "@n8n/n8n-nodes-langchain.agent",
      "position": [
        1160,
        -40
      ],
      "parameters": {
        "text": "=The query of the user is this . {{ $('Webhook').item.json.body.message }}",
        "options": {
          "systemMessage": "=You are a helpful and polite AI assistant that suggests similar or related products based on what the user is looking for.\n\nYour job is to:\n1. Understand whether the user is asking for **product recommendations**, **similar items**, **suggestions**, or **alternatives**.\n2. Determine whether the user is referring to a **specific product** or a **product category**.\n3. Based on that:\n   - If the user refers to a **product name**, call the tool `getProductRecommendations` with the key `\"product\"`.\n   - If the user refers to a **product category**, call the tool `getCategoryRecommendations` with the key `\"category\"`.\n4. Wait for the tool response before replying.\n5. After receiving the tool result, present the recommended products in a helpful, friendly tone.\n\n---\n\n### \ud83d\udd0d Input Understanding Rules\n\n- If the user says something like \u201cCan you suggest something like a wireless mouse?\u201d, interpret this as a **product-based recommendation**.\n  - Extract: `\"product\": \"wireless mouse\"`\n  - Call: `getProductRecommendations`\n\n- If the user says something like \u201cWhat are some good accessories for laptops?\u201d or \u201cSuggest something in audio equipment,\u201d interpret this as a **category-based recommendation**.\n  - Extract: `\"category\": \"laptop accessories\"` or `\"audio equipment\"` or `\"display\"` , `\"audio\"`\n  - Call: `getCategoryRecommendations`\n\n---\n\n### \u26a0\ufe0f Missing Info Handling\n\nIf the user does not clearly mention a product or category, politely ask:\n> \u201cCould you please tell me the product or category you\u2019re interested in so I can recommend something useful?\u201d\n\n---\n\n"
        },
        "promptType": "define"
      },
      "typeVersion": 2
    },
    {
      "id": "5ac4c297-01f9-4f30-8e8a-55479a73dfe0",
      "name": "OpenAI Chat Model2",
      "type": "@n8n/n8n-nodes-langchain.lmChatOpenAi",
      "position": [
        1140,
        160
      ],
      "parameters": {
        "model": {
          "__rl": true,
          "mode": "list",
          "value": "gpt-4o-mini"
        },
        "options": {}
      },
      "credentials": {
        "openAiApi": {
          "name": "<your credential>"
        }
      },
      "typeVersion": 1.2
    },
    {
      "id": "cda9abdf-cabe-4127-9507-66392d712769",
      "name": "Simple Memory3",
      "type": "@n8n/n8n-nodes-langchain.memoryBufferWindow",
      "position": [
        1280,
        180
      ],
      "parameters": {
        "sessionKey": "={{ $('Webhook').item.json.body.session_id }}",
        "sessionIdType": "customKey",
        "contextWindowLength": 7
      },
      "typeVersion": 1.3
    },
    {
      "id": "11aa9f9e-1acb-45ee-986c-4298b228dc5d",
      "name": "getCategoryRecommendations",
      "type": "n8n-nodes-base.supabaseTool",
      "position": [
        1400,
        200
      ],
      "parameters": {
        "filters": {
          "conditions": [
            {
              "keyName": "category",
              "keyValue": "={{ /*n8n-auto-generated-fromAI-override*/ $fromAI('conditions1_Value', ``, 'string') }}"
            }
          ]
        },
        "tableId": "products",
        "operation": "get",
        "descriptionType": "manual",
        "toolDescription": "Call this tool when you want recommendation based on the category."
      },
      "credentials": {
        "supabaseApi": {
          "name": "<your credential>"
        }
      },
      "typeVersion": 1
    },
    {
      "id": "130277bc-6cbf-48e2-9b16-a94bc1088d31",
      "name": "getProductRecommendations",
      "type": "n8n-nodes-base.supabaseTool",
      "position": [
        1540,
        140
      ],
      "parameters": {
        "filters": {
          "conditions": [
            {
              "keyName": "name",
              "keyValue": "={{ /*n8n-auto-generated-fromAI-override*/ $fromAI('conditions0_Value', ``, 'string') }}"
            }
          ]
        },
        "tableId": "products",
        "operation": "get",
        "descriptionType": "manual",
        "toolDescription": "Call this tool if you want recommendation based on the product name."
      },
      "credentials": {
        "supabaseApi": {
          "name": "<your credential>"
        }
      },
      "typeVersion": 1
    },
    {
      "id": "3ca4c1cb-6a0d-49c5-ad2d-94ab800a3437",
      "name": "Webhook",
      "type": "n8n-nodes-base.webhook",
      "position": [
        -440,
        -20
      ],
      "parameters": {
        "path": "4cdaa2e9-be46-4f60-83f6-8d7bd4a6ad5d",
        "options": {},
        "httpMethod": "POST",
        "responseMode": "responseNode"
      },
      "typeVersion": 2
    },
    {
      "id": "015084ec-64f3-4bae-8aee-3f826c383c71",
      "name": "Respond to Webhook",
      "type": "n8n-nodes-base.respondToWebhook",
      "position": [
        1200,
        -500
      ],
      "parameters": {
        "options": {},
        "respondWith": "json",
        "responseBody": "={\n  \"response\": \"{{ $json.output.replace(/[\\n\\r\\t]+/g, ' ').replace(/\\s{2,}/g, ' ').trim() }}\"\n}\n"
      },
      "typeVersion": 1.4
    },
    {
      "id": "cfe0f477-ae44-45cc-b3c1-33575934607b",
      "name": "Respond to Webhook1",
      "type": "n8n-nodes-base.respondToWebhook",
      "position": [
        1560,
        -40
      ],
      "parameters": {
        "options": {},
        "respondWith": "json",
        "responseBody": "={\n\"response\":\"{{ JSON.stringify($json.output) }}\"\n}"
      },
      "typeVersion": 1.4
    },
    {
      "id": "8251dd9d-41b8-413b-a97e-aa086b6f66c6",
      "name": "Respond to Webhook2",
      "type": "n8n-nodes-base.respondToWebhook",
      "position": [
        1120,
        340
      ],
      "parameters": {
        "options": {},
        "respondWith": "json",
        "responseBody": "={\n  \"response\": \"{{ $json.output.replace(/[\\n\\r\\t]+/g, ' ').replace(/\\s{2,}/g, ' ').trim() }}\"\n}\n"
      },
      "typeVersion": 1.4
    },
    {
      "id": "0d6e5c87-9824-493f-a492-dead40212114",
      "name": "Respond to Webhook3",
      "type": "n8n-nodes-base.respondToWebhook",
      "position": [
        280,
        440
      ],
      "parameters": {
        "options": {},
        "respondWith": "json",
        "responseBody": "={\n  \"response\": \"{{ $json.category.product }}\"\n}"
      },
      "typeVersion": 1.4
    }
  ],
  "active": true,
  "settings": {
    "executionOrder": "v1"
  },
  "versionId": "0c596213-59ce-4080-b740-b2b6c6e3981d",
  "connections": {
    "Code": {
      "main": [
        [
          {
            "node": "Switch",
            "type": "main",
            "index": 0
          }
        ]
      ]
    },
    "Send": {
      "ai_tool": [
        [
          {
            "node": "AI Agent1",
            "type": "ai_tool",
            "index": 0
          }
        ]
      ]
    },
    "Switch": {
      "main": [
        [
          {
            "node": "Order Queries",
            "type": "main",
            "index": 0
          }
        ],
        [
          {
            "node": "Recommendations",
            "type": "main",
            "index": 0
          }
        ],
        [
          {
            "node": "AI Agent1",
            "type": "main",
            "index": 0
          }
        ],
        [
          {
            "node": "Respond to Webhook3",
            "type": "main",
            "index": 0
          }
        ]
      ]
    },
    "Webhook": {
      "main": [
        [
          {
            "node": "AI Agent",
            "type": "main",
            "index": 0
          }
        ]
      ]
    },
    "AI Agent": {
      "main": [
        [
          {
            "node": "Code",
            "type": "main",
            "index": 0
          }
        ]
      ]
    },
    "AI Agent1": {
      "main": [
        [
          {
            "node": "Respond to Webhook2",
            "type": "main",
            "index": 0
          }
        ]
      ]
    },
    "Code Tool": {
      "ai_tool": [
        [
          {
            "node": "AI Agent1",
            "type": "ai_tool",
            "index": 0
          }
        ]
      ]
    },
    "Order Queries": {
      "main": [
        [
          {
            "node": "Respond to Webhook",
            "type": "main",
            "index": 0
          }
        ]
      ]
    },
    "Simple Memory": {
      "ai_memory": [
        [
          {
            "node": "Order Queries",
            "type": "ai_memory",
            "index": 0
          }
        ]
      ]
    },
    "Simple Memory1": {
      "ai_memory": [
        [
          {
            "node": "AI Agent",
            "type": "ai_memory",
            "index": 0
          }
        ]
      ]
    },
    "Simple Memory2": {
      "ai_memory": [
        [
          {
            "node": "AI Agent1",
            "type": "ai_memory",
            "index": 0
          }
        ]
      ]
    },
    "Simple Memory3": {
      "ai_memory": [
        [
          {
            "node": "Recommendations",
            "type": "ai_memory",
            "index": 0
          }
        ]
      ]
    },
    "getOrderStatus": {
      "ai_tool": [
        [
          {
            "node": "Order Queries",
            "type": "ai_tool",
            "index": 0
          }
        ]
      ]
    },
    "Recommendations": {
      "main": [
        [
          {
            "node": "Respond to Webhook1",
            "type": "main",
            "index": 0
          }
        ]
      ]
    },
    "getTicketStatus": {
      "ai_tool": [
        [
          {
            "node": "AI Agent1",
            "type": "ai_tool",
            "index": 0
          }
        ]
      ]
    },
    "OpenAI Chat Model": {
      "ai_languageModel": [
        [
          {
            "node": "AI Agent",
            "type": "ai_languageModel",
            "index": 0
          }
        ]
      ]
    },
    "OpenAI Chat Model1": {
      "ai_languageModel": [
        [
          {
            "node": "Order Queries",
            "type": "ai_languageModel",
            "index": 0
          }
        ]
      ]
    },
    "OpenAI Chat Model2": {
      "ai_languageModel": [
        [
          {
            "node": "Recommendations",
            "type": "ai_languageModel",
            "index": 0
          }
        ]
      ]
    },
    "Respond to Webhook": {
      "main": [
        []
      ]
    },
    "Respond to Webhook1": {
      "main": [
        []
      ]
    },
    "createSupportTicket": {
      "ai_tool": [
        [
          {
            "node": "AI Agent1",
            "type": "ai_tool",
            "index": 0
          }
        ]
      ]
    },
    "handle support tickets": {
      "ai_languageModel": [
        [
          {
            "node": "AI Agent1",
            "type": "ai_languageModel",
            "index": 0
          }
        ]
      ]
    },
    "getProductRecommendations": {
      "ai_tool": [
        [
          {
            "node": "Recommendations",
            "type": "ai_tool",
            "index": 0
          }
        ]
      ]
    },
    "getCategoryRecommendations": {
      "ai_tool": [
        [
          {
            "node": "Recommendations",
            "type": "ai_tool",
            "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 AI-powered customer support automation built in n8n handles your e-commerce queries instantly — from order tracking to personalized product recommendations and support ticket management. Features: 🛒 Order Status Tracking: Instantly retrieve order details from your database.…

Source: https://n8n.io/workflows/7256/ — 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

Are you drowning in daily operational chaos, desperately trying to juggle sales, projects, content, and client communication? Imagine an AI brain that handles it all, freeing you to lead your business

Telegram Trigger, Telegram, OpenAI +13
AI & RAG

This workflow integrates multiple productivity tools into a single AI-powered assistant using n8n, acting as a centralized control hub to receive and execute tasks across Google Calendar, Gmail, Googl

Agent, Discord, OpenAI Chat +12
AI & RAG

This workflow is an AI-powered Dental Appointment Assistant that automates appointment booking, rescheduling, and cancellations through Telegram or a Webhook. It uses intelligent agents to understand

Memory Buffer Window, Output Parser Structured, Mcp Client Tool +12
AI & RAG

This workflow transforms WhatsApp into a powerful personal AI using n8n + Green-API. Send text or voice messages — the assistant understands intent and handles daily tasks automatically. 💰 Expense & i

Tool Calculator, Google Sheets Tool, OpenAI Chat +10
AI & RAG

This workflow automates enterprise compliance governance using a multi-agent AI architecture. It targets compliance officers, legal teams, and risk managers who need continuous, jurisdiction-aware mon

Agent, OpenAI Chat, Memory Buffer Window +8