AutomationFlowsGeneral › Webhook Chat Intake to AI Agent

Webhook Chat Intake to AI Agent

Original n8n title: Main Web Chat

main-web-chat. Webhook trigger; 13 nodes.

Webhook trigger★★★★☆ complexity13 nodes
General Trigger: Webhook Nodes: 13 Complexity: ★★★★☆ Added:

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
{
  "name": "main-web-chat",
  "nodes": [
    {
      "parameters": {
        "httpMethod": "POST",
        "path": "web-chat-intake",
        "responseMode": "responseNode"
      },
      "id": "webhook-intake",
      "name": "Webhook: Web Chat Intake",
      "type": "n8n-nodes-base.webhook",
      "typeVersion": 2,
      "position": [
        100,
        300
      ]
    },
    {
      "parameters": {
        "conditions": {
          "options": {
            "caseSensitive": true,
            "leftValue": "",
            "typeValidation": "strict"
          },
          "conditions": [
            {
              "id": "check-media",
              "leftValue": "={{ $json.body.message_type }}",
              "rightValue": "video_frame",
              "operator": {
                "type": "string",
                "operation": "equals"
              }
            }
          ],
          "combinator": "and"
        }
      },
      "id": "if-media-check",
      "name": "IF: Has Media?",
      "type": "n8n-nodes-base.if",
      "typeVersion": 2,
      "position": [
        320,
        300
      ]
    },
    {
      "parameters": {
        "workflowId": "={{ $vars.SUB_MEDIA_ANALYSIS_ID }}"
      },
      "id": "exec-media-analysis",
      "name": "Execute: sub-media-analysis",
      "type": "n8n-nodes-base.executeWorkflow",
      "typeVersion": 1,
      "position": [
        540,
        160
      ]
    },
    {
      "parameters": {
        "workflowId": "={{ $vars.SUB_CUSTOMER_LOOKUP_ID }}"
      },
      "id": "exec-customer-lookup",
      "name": "Execute: sub-customer-lookup",
      "type": "n8n-nodes-base.executeWorkflow",
      "typeVersion": 1,
      "position": [
        760,
        300
      ]
    },
    {
      "parameters": {
        "workflowId": "={{ $vars.SUB_MEMORY_RETRIEVAL_ID }}"
      },
      "id": "exec-memory-retrieval",
      "name": "Execute: sub-memory-retrieval",
      "type": "n8n-nodes-base.executeWorkflow",
      "typeVersion": 1,
      "position": [
        980,
        300
      ]
    },
    {
      "parameters": {
        "workflowId": "={{ $vars.SUB_AI_STYLIST_ID }}"
      },
      "id": "exec-ai-stylist",
      "name": "Execute: sub-ai-stylist-agent",
      "type": "n8n-nodes-base.executeWorkflow",
      "typeVersion": 1,
      "position": [
        1200,
        300
      ]
    },
    {
      "parameters": {
        "conditions": {
          "options": {
            "caseSensitive": true,
            "leftValue": "",
            "typeValidation": "strict"
          },
          "conditions": [
            {
              "id": "has-tool-calls",
              "leftValue": "={{ $json.tool_calls.length }}",
              "rightValue": 0,
              "operator": {
                "type": "number",
                "operation": "gt"
              }
            }
          ],
          "combinator": "and"
        }
      },
      "id": "if-tool-calls",
      "name": "IF: Has Tool Calls?",
      "type": "n8n-nodes-base.if",
      "typeVersion": 2,
      "position": [
        1420,
        300
      ]
    },
    {
      "parameters": {
        "rules": {
          "values": [
            {
              "conditions": {
                "conditions": [
                  {
                    "leftValue": "={{ $json.tool_calls[0].name }}",
                    "rightValue": "book_appointment",
                    "operator": {
                      "type": "string",
                      "operation": "equals"
                    }
                  }
                ],
                "combinator": "and"
              },
              "renameOutput": "Book"
            },
            {
              "conditions": {
                "conditions": [
                  {
                    "leftValue": "={{ $json.tool_calls[0].name }}",
                    "rightValue": "recommend_styles",
                    "operator": {
                      "type": "string",
                      "operation": "equals"
                    }
                  }
                ],
                "combinator": "and"
              },
              "renameOutput": "Recommend"
            },
            {
              "conditions": {
                "conditions": [
                  {
                    "leftValue": "={{ $json.tool_calls[0].name }}",
                    "rightValue": "check_availability",
                    "operator": {
                      "type": "string",
                      "operation": "equals"
                    }
                  }
                ],
                "combinator": "and"
              },
              "renameOutput": "Availability"
            }
          ]
        },
        "mode": "rules"
      },
      "id": "switch-tool",
      "name": "Switch: Tool Router",
      "type": "n8n-nodes-base.switch",
      "typeVersion": 3,
      "position": [
        1640,
        200
      ]
    },
    {
      "parameters": {
        "workflowId": "={{ $vars.SUB_APPOINTMENT_MANAGER_ID }}"
      },
      "id": "exec-book-appointment",
      "name": "Execute: sub-appointment-manager (Book)",
      "type": "n8n-nodes-base.executeWorkflow",
      "typeVersion": 1,
      "position": [
        1860,
        100
      ]
    },
    {
      "parameters": {
        "workflowId": "={{ $vars.SUB_STYLE_RECOMMENDER_ID }}"
      },
      "id": "exec-style-recommender",
      "name": "Execute: sub-style-recommender",
      "type": "n8n-nodes-base.executeWorkflow",
      "typeVersion": 1,
      "position": [
        1860,
        260
      ]
    },
    {
      "parameters": {
        "workflowId": "={{ $vars.SUB_APPOINTMENT_MANAGER_ID }}"
      },
      "id": "exec-check-availability",
      "name": "Execute: sub-appointment-manager (Availability)",
      "type": "n8n-nodes-base.executeWorkflow",
      "typeVersion": 1,
      "position": [
        1860,
        420
      ]
    },
    {
      "parameters": {
        "workflowId": "={{ $vars.SUB_MEMORY_WRITER_ID }}"
      },
      "id": "exec-memory-writer",
      "name": "Execute: sub-memory-writer",
      "type": "n8n-nodes-base.executeWorkflow",
      "typeVersion": 1,
      "position": [
        2100,
        300
      ]
    },
    {
      "parameters": {
        "respondWith": "json",
        "responseBody": "={{ JSON.stringify({ response: $('Execute: sub-ai-stylist-agent').item.json.response_text, images: $('Execute: sub-style-recommender').item.json?.recommended_styles ?? [], booking_result: $('Execute: sub-appointment-manager (Book)').item.json ?? null, session_id: $('Webhook: Web Chat Intake').item.json.body.session_id }) }}"
      },
      "id": "respond-webhook",
      "name": "Respond to Webhook",
      "type": "n8n-nodes-base.respondToWebhook",
      "typeVersion": 1,
      "position": [
        2320,
        300
      ]
    }
  ],
  "connections": {
    "Webhook: Web Chat Intake": {
      "main": [
        [
          {
            "node": "IF: Has Media?",
            "type": "main",
            "index": 0
          }
        ]
      ]
    },
    "IF: Has Media?": {
      "main": [
        [
          {
            "node": "Execute: sub-media-analysis",
            "type": "main",
            "index": 0
          }
        ],
        [
          {
            "node": "Execute: sub-customer-lookup",
            "type": "main",
            "index": 0
          }
        ]
      ]
    },
    "Execute: sub-media-analysis": {
      "main": [
        [
          {
            "node": "Execute: sub-customer-lookup",
            "type": "main",
            "index": 0
          }
        ]
      ]
    },
    "Execute: sub-customer-lookup": {
      "main": [
        [
          {
            "node": "Execute: sub-memory-retrieval",
            "type": "main",
            "index": 0
          }
        ]
      ]
    },
    "Execute: sub-memory-retrieval": {
      "main": [
        [
          {
            "node": "Execute: sub-ai-stylist-agent",
            "type": "main",
            "index": 0
          }
        ]
      ]
    },
    "Execute: sub-ai-stylist-agent": {
      "main": [
        [
          {
            "node": "IF: Has Tool Calls?",
            "type": "main",
            "index": 0
          }
        ]
      ]
    },
    "IF: Has Tool Calls?": {
      "main": [
        [
          {
            "node": "Switch: Tool Router",
            "type": "main",
            "index": 0
          }
        ],
        [
          {
            "node": "Execute: sub-memory-writer",
            "type": "main",
            "index": 0
          }
        ]
      ]
    },
    "Switch: Tool Router": {
      "main": [
        [
          {
            "node": "Execute: sub-appointment-manager (Book)",
            "type": "main",
            "index": 0
          }
        ],
        [
          {
            "node": "Execute: sub-style-recommender",
            "type": "main",
            "index": 0
          }
        ],
        [
          {
            "node": "Execute: sub-appointment-manager (Availability)",
            "type": "main",
            "index": 0
          }
        ]
      ]
    },
    "Execute: sub-appointment-manager (Book)": {
      "main": [
        [
          {
            "node": "Execute: sub-memory-writer",
            "type": "main",
            "index": 0
          }
        ]
      ]
    },
    "Execute: sub-style-recommender": {
      "main": [
        [
          {
            "node": "Execute: sub-memory-writer",
            "type": "main",
            "index": 0
          }
        ]
      ]
    },
    "Execute: sub-appointment-manager (Availability)": {
      "main": [
        [
          {
            "node": "Execute: sub-memory-writer",
            "type": "main",
            "index": 0
          }
        ]
      ]
    },
    "Execute: sub-memory-writer": {
      "main": [
        [
          {
            "node": "Respond to Webhook",
            "type": "main",
            "index": 0
          }
        ]
      ]
    }
  },
  "settings": {
    "executionOrder": "v1",
    "errorWorkflow": "sub-error-handler"
  },
  "tags": [
    {
      "name": "sweethandbraids"
    },
    {
      "name": "main-workflow"
    },
    {
      "name": "production"
    }
  ]
}
Pro

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

About this workflow

main-web-chat. Webhook trigger; 13 nodes.

Source: https://github.com/rdmahpcengineer-gpu/sweethandbraidsMainProject/blob/9c327e7b2190848ae227fe277b0662173be78f38/n8n/main-web-chat.json — original creator credit. Request a take-down →

More General workflows → · Browse all categories →

Related workflows

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

General

A production-ready authentication workflow implementing secure user registration, login, token verification, and refresh token mechanisms. Perfect for adding authentication to any application without

Crypto, Data Table, Execute Workflow Trigger
General

Portfolio Orchestrator. Uses httpRequest. Webhook trigger; 59 nodes.

HTTP Request
General

This n8n template demonstrates how a simple Multi-Layer Perceptron (MLP) neural network can predict housing prices. The prediction is based on four key features, processed through a three-layer model.

General

github code Try yourself

Google Calendar
General

This workflow contains community nodes that are only compatible with the self-hosted version of n8n.

N8N Nodes 1Shot