{
  "id": "veLUSLGYao7hs0Zl",
  "meta": {
    "templateCredsSetupCompleted": true
  },
  "name": "Route website chat visitors to booking, FAQs, and Gmail",
  "tags": [],
  "nodes": [
    {
      "id": "25468ed6-f098-4080-8f94-37e385661efc",
      "name": "Sticky Note",
      "type": "n8n-nodes-base.stickyNote",
      "position": [
        11824,
        2320
      ],
      "parameters": {
        "width": 480,
        "height": 896,
        "content": "## Route website chat visitors to booking, FAQs, and Gmail\n\n### How it works\n\nThis workflow acts as a website chat assistant that greets visitors, presents a main menu, and routes them to scheduling, service FAQs, or a contact form. It can share a Calendly-style booking link, explain IT consulting and automation services, collect a visitor\u2019s phone or email plus message, and send that lead to an inbox through Gmail. Several switch nodes loop users back to menus or retry prompts when replies are unclear or incomplete.\n\n### Setup steps\n\n- Configure the chat trigger for the website or chat widget where visitors will start the conversation.\n- Edit the \u201cWorkflow Configuration (edit these values)\u201d node with the correct contactEmail, calendlyLink, and imprintUrl values.\n- Connect valid Gmail credentials to the \u201cEmail lead to inbox (Gmail)\u201d node and confirm the recipient inbox and email content are correct.\n- Review the chat prompt text and switch conditions so the menu options, retry paths, and confirmation replies match the site\u2019s wording.\n\n### Customization\n\nUpdate the menu choices, service descriptions, booking link, and lead email template to match the business. Additional service branches can be added near the existing service information cluster."
      },
      "typeVersion": 1
    },
    {
      "id": "4fb2d66d-52fb-4e9e-b56d-8ee7cff6e6f4",
      "name": "Sticky Note1",
      "type": "n8n-nodes-base.stickyNote",
      "position": [
        11968,
        3312
      ],
      "parameters": {
        "color": 7,
        "width": 640,
        "height": 304,
        "content": "## Chat entry setup\n\nStarts the website chat session, loads editable workflow settings, welcomes the visitor, and displays the main menu."
      },
      "typeVersion": 1
    },
    {
      "id": "48524769-fe04-4a11-b82d-7dafeddda98c",
      "name": "Sticky Note2",
      "type": "n8n-nodes-base.stickyNote",
      "position": [
        12816,
        3216
      ],
      "parameters": {
        "color": 7,
        "height": 512,
        "content": "## Main menu routing\n\nBranches the visitor\u2019s main menu selection toward scheduling, service information, contact capture, or back to the menu for unsupported choices."
      },
      "typeVersion": 1
    },
    {
      "id": "1f007bb1-e1ac-4824-a2f2-5f37a6567738",
      "name": "Sticky Note3",
      "type": "n8n-nodes-base.stickyNote",
      "position": [
        13728,
        2352
      ],
      "parameters": {
        "color": 6,
        "width": 416,
        "height": 368,
        "content": "## 1. Schedule meeting loop\n\nShows the meeting scheduling option and routes the visitor either back to the main menu or through the scheduling prompt again."
      },
      "typeVersion": 1
    },
    {
      "id": "4cdf59dd-7d91-4113-b6e5-fb61f913f93f",
      "name": "Sticky Note4",
      "type": "n8n-nodes-base.stickyNote",
      "position": [
        13712,
        4112
      ],
      "parameters": {
        "color": "#643102",
        "width": 608,
        "height": 352,
        "content": "## 3.  Collect contact details\n\nAsks for a phone number or email address, extracts contact details from the chat response, checks whether anything valid was found, and retries when needed."
      },
      "typeVersion": 1
    },
    {
      "id": "d3bdc34d-89c4-4e76-9712-dbff3da9772f",
      "name": "Sticky Note5",
      "type": "n8n-nodes-base.stickyNote",
      "position": [
        14384,
        4032
      ],
      "parameters": {
        "color": "#643102",
        "width": 704,
        "height": 560,
        "content": "## Confirm lead message\n\nConfirms the captured contact method, asks the visitor for their message, and routes whether to continue, go back, or return to the main menu."
      },
      "typeVersion": 1
    },
    {
      "id": "c825406d-6c22-4416-802a-2fa13bdf7b48",
      "name": "Sticky Note6",
      "type": "n8n-nodes-base.stickyNote",
      "position": [
        15152,
        4032
      ],
      "parameters": {
        "color": "#643102",
        "width": 432,
        "height": 560,
        "content": "## Send decision handling\n\nHandles the visitor\u2019s final choice to send the lead, replace the message, return to the menu, go back to contact entry, or retry after an invalid response."
      },
      "typeVersion": 1
    },
    {
      "id": "c24daac7-ae4c-4fe2-83dc-7cc7ae5371b2",
      "name": "Sticky Note7",
      "type": "n8n-nodes-base.stickyNote",
      "position": [
        15648,
        4112
      ],
      "parameters": {
        "color": "#643102",
        "width": 416,
        "height": 368,
        "content": "## Email lead confirmation\n\nSends the captured visitor lead to Gmail and confirms in chat that the message was received."
      },
      "typeVersion": 1
    },
    {
      "id": "319f17a1-728e-4edf-a2b5-f6411ba72ba6",
      "name": "Sticky Note8",
      "type": "n8n-nodes-base.stickyNote",
      "position": [
        16128,
        4112
      ],
      "parameters": {
        "color": "#643102",
        "width": 368,
        "height": 368,
        "content": "## Post-send routing\n\nRoutes the visitor after the message confirmation, allowing them to return to the main menu or repeat the confirmation prompt."
      },
      "typeVersion": 1
    },
    {
      "id": "c6d2ddd6-d7d2-43cf-9490-6373ff5a6436",
      "name": "Sticky Note9",
      "type": "n8n-nodes-base.stickyNote",
      "position": [
        13728,
        3008
      ],
      "parameters": {
        "color": 4,
        "width": 416,
        "height": 736,
        "content": "## 2. Services menu selection\n\nPresents service information and routes the visitor\u2019s service choice toward IT consulting, automation engineering, or menu navigation."
      },
      "typeVersion": 1
    },
    {
      "id": "18a6a3f3-7b79-437e-8210-1ef3dfb1b419",
      "name": "Sticky Note10",
      "type": "n8n-nodes-base.stickyNote",
      "position": [
        14208,
        3008
      ],
      "parameters": {
        "color": 4,
        "width": 480,
        "height": 736,
        "content": "## Service detail loops\n\nShows detailed information for IT consulting and automation engineering, then lets the visitor return to the main menu, return to services, or view the same topic again."
      },
      "typeVersion": 1
    },
    {
      "id": "c256f6c4-8b1a-474d-8014-bae0c0685cab",
      "name": "Send Welcome Message",
      "type": "@n8n/n8n-nodes-langchain.chat",
      "position": [
        12240,
        3456
      ],
      "parameters": {
        "message": "=Hey,\nThanks for reaching out! By chatting with this assistant, you accept our Data Privacy Policy, which you can find here: {{ $('Set Workflow Configuration').item.json.imprintUrl }}",
        "options": {}
      },
      "typeVersion": 1.2
    },
    {
      "id": "3b0ace0e-586e-4b42-a43f-2fe5af9ca809",
      "name": "Display Main Menu",
      "type": "@n8n/n8n-nodes-langchain.chat",
      "position": [
        12464,
        3456
      ],
      "parameters": {
        "message": "={{ `We're happy to assist you. Please reply with one of the following numbers:\n\n1 - Schedule a call with me\n\n2 - Get more information about our services\n\n3 - Send us a direct message\n\nYou can always type 'menu' or 'back' to return to this main menu or the previous step.` }}",
        "options": {
          "limitWaitTime": {
            "values": {
              "resumeUnit": "minutes",
              "resumeAmount": 15
            }
          }
        },
        "operation": "sendAndWait"
      },
      "typeVersion": 1.2
    },
    {
      "id": "203e4915-df3d-46a6-9ef9-4de0ad97eb2e",
      "name": "Route by Main Menu Choice",
      "type": "n8n-nodes-base.switch",
      "position": [
        12880,
        3392
      ],
      "parameters": {
        "rules": {
          "values": [
            {
              "outputKey": "1",
              "conditions": {
                "options": {
                  "version": 3,
                  "leftValue": "",
                  "caseSensitive": true,
                  "typeValidation": "strict"
                },
                "combinator": "and",
                "conditions": [
                  {
                    "id": "0439d35f-1a58-47a4-951b-293d72241e87",
                    "operator": {
                      "type": "string",
                      "operation": "equals"
                    },
                    "leftValue": "={{ $json.chatInput }}",
                    "rightValue": "1"
                  }
                ]
              },
              "renameOutput": true
            },
            {
              "outputKey": "2",
              "conditions": {
                "options": {
                  "version": 3,
                  "leftValue": "",
                  "caseSensitive": true,
                  "typeValidation": "strict"
                },
                "combinator": "and",
                "conditions": [
                  {
                    "id": "cbf365f9-4865-4d2b-8ccb-613da5852888",
                    "operator": {
                      "type": "string",
                      "operation": "equals"
                    },
                    "leftValue": "={{ $json.chatInput }}",
                    "rightValue": "2"
                  }
                ]
              },
              "renameOutput": true
            },
            {
              "outputKey": "3",
              "conditions": {
                "options": {
                  "version": 3,
                  "leftValue": "",
                  "caseSensitive": true,
                  "typeValidation": "strict"
                },
                "combinator": "and",
                "conditions": [
                  {
                    "id": "38784274-9d6a-4950-ac1f-4050ce65eea7",
                    "operator": {
                      "type": "string",
                      "operation": "equals"
                    },
                    "leftValue": "={{ $json.chatInput }}",
                    "rightValue": "3"
                  }
                ]
              },
              "renameOutput": true
            },
            {
              "outputKey": "back",
              "conditions": {
                "options": {
                  "version": 3,
                  "leftValue": "",
                  "caseSensitive": true,
                  "typeValidation": "strict"
                },
                "combinator": "and",
                "conditions": [
                  {
                    "id": "bea5a40a-4302-4579-9a59-38003c0866d5",
                    "operator": {
                      "name": "filter.operator.equals",
                      "type": "string",
                      "operation": "equals"
                    },
                    "leftValue": "={{ $json.chatInput.toLowerCase() }}",
                    "rightValue": "back"
                  }
                ]
              },
              "renameOutput": true
            },
            {
              "outputKey": "menu",
              "conditions": {
                "options": {
                  "version": 3,
                  "leftValue": "",
                  "caseSensitive": true,
                  "typeValidation": "strict"
                },
                "combinator": "and",
                "conditions": [
                  {
                    "id": "57303469-e618-47ef-bc00-630b988aa375",
                    "operator": {
                      "name": "filter.operator.equals",
                      "type": "string",
                      "operation": "equals"
                    },
                    "leftValue": "={{ $json.chatInput.toLowerCase() }}",
                    "rightValue": "menu"
                  }
                ]
              },
              "renameOutput": true
            }
          ]
        },
        "options": {
          "fallbackOutput": "extra"
        }
      },
      "typeVersion": 3.4
    },
    {
      "id": "da2e82b8-62ea-4e49-8aef-560566354e86",
      "name": "Route Post-Schedule Reply",
      "type": "n8n-nodes-base.switch",
      "position": [
        13984,
        2512
      ],
      "parameters": {
        "rules": {
          "values": [
            {
              "outputKey": "menu",
              "conditions": {
                "options": {
                  "version": 3,
                  "leftValue": "",
                  "caseSensitive": true,
                  "typeValidation": "strict"
                },
                "combinator": "and",
                "conditions": [
                  {
                    "id": "643e109d-3d65-4467-ad21-180d33c701c2",
                    "operator": {
                      "type": "string",
                      "operation": "equals"
                    },
                    "leftValue": "={{ $json.chatInput.toLowerCase() }}",
                    "rightValue": "menu"
                  }
                ]
              },
              "renameOutput": true
            }
          ]
        },
        "options": {
          "fallbackOutput": "extra"
        }
      },
      "typeVersion": 3.4
    },
    {
      "id": "afab7d66-0d22-4ae4-a382-c17c761e6d0a",
      "name": "Initiate Meeting Scheduling",
      "type": "@n8n/n8n-nodes-langchain.chat",
      "position": [
        13792,
        2512
      ],
      "parameters": {
        "message": "=In order to schedule a call with me, please use this link to select an available timeslot and provide your information. You'll receive an automatic invitation to the call: {{ $('Set Workflow Configuration').item.json.calendlyLink }}\n\nThe conversation ends here. If you need something else, please type 'menu' to return to the main menu \u2014 otherwise this chat will end automatically in 15 minutes.",
        "options": {
          "limitWaitTime": {
            "values": {
              "resumeUnit": "minutes",
              "resumeAmount": 15
            }
          }
        },
        "operation": "sendAndWait"
      },
      "typeVersion": 1.2
    },
    {
      "id": "fec7ba37-6e5f-408b-bed9-33dda3914a55",
      "name": "Route by Service Choice",
      "type": "n8n-nodes-base.switch",
      "position": [
        13984,
        3360
      ],
      "parameters": {
        "rules": {
          "values": [
            {
              "outputKey": "1",
              "conditions": {
                "options": {
                  "version": 3,
                  "leftValue": "",
                  "caseSensitive": true,
                  "typeValidation": "strict"
                },
                "combinator": "and",
                "conditions": [
                  {
                    "id": "0439d35f-1a58-47a4-951b-293d72241e87",
                    "operator": {
                      "type": "string",
                      "operation": "equals"
                    },
                    "leftValue": "={{ $json.chatInput }}",
                    "rightValue": "1"
                  }
                ]
              },
              "renameOutput": true
            },
            {
              "outputKey": "2",
              "conditions": {
                "options": {
                  "version": 3,
                  "leftValue": "",
                  "caseSensitive": true,
                  "typeValidation": "strict"
                },
                "combinator": "and",
                "conditions": [
                  {
                    "id": "cbf365f9-4865-4d2b-8ccb-613da5852888",
                    "operator": {
                      "type": "string",
                      "operation": "equals"
                    },
                    "leftValue": "={{ $json.chatInput }}",
                    "rightValue": "2"
                  }
                ]
              },
              "renameOutput": true
            },
            {
              "outputKey": "back",
              "conditions": {
                "options": {
                  "version": 3,
                  "leftValue": "",
                  "caseSensitive": true,
                  "typeValidation": "strict"
                },
                "combinator": "and",
                "conditions": [
                  {
                    "id": "bea5a40a-4302-4579-9a59-38003c0866d5",
                    "operator": {
                      "name": "filter.operator.equals",
                      "type": "string",
                      "operation": "equals"
                    },
                    "leftValue": "={{ $json.chatInput.toLowerCase() }}",
                    "rightValue": "back"
                  }
                ]
              },
              "renameOutput": true
            },
            {
              "outputKey": "menu",
              "conditions": {
                "options": {
                  "version": 3,
                  "leftValue": "",
                  "caseSensitive": true,
                  "typeValidation": "strict"
                },
                "combinator": "and",
                "conditions": [
                  {
                    "id": "57303469-e618-47ef-bc00-630b988aa375",
                    "operator": {
                      "name": "filter.operator.equals",
                      "type": "string",
                      "operation": "equals"
                    },
                    "leftValue": "={{ $json.chatInput.toLowerCase() }}",
                    "rightValue": "menu"
                  }
                ]
              },
              "renameOutput": true
            }
          ]
        },
        "options": {
          "fallbackOutput": "extra"
        }
      },
      "typeVersion": 3.4
    },
    {
      "id": "51542ae4-a12f-4af6-b100-b6b9388d2d38",
      "name": "Provide Services Information",
      "type": "@n8n/n8n-nodes-langchain.chat",
      "position": [
        13776,
        3408
      ],
      "parameters": {
        "message": "={{ `We offer the following services. Please let us know which one you'd like more information about:\n\n1 - IT Consulting\n\n2 - Process Automation\n\nNote: You can always type 'menu' or 'back' to return to the main menu or the previous step.` }}",
        "options": {},
        "operation": "sendAndWait"
      },
      "typeVersion": 1.2
    },
    {
      "id": "afc3b630-2955-40fd-a476-cc5cde77a6c1",
      "name": "Present Automation Services",
      "type": "@n8n/n8n-nodes-langchain.chat",
      "position": [
        14272,
        3440
      ],
      "parameters": {
        "message": "={{ `Automation engineering means I build the behind-the-scenes systems that let your business run smoother \u2014 connecting apps, automating data flows, and integrating AI agents where they add real value. Whether it's a single workflow or a full process overhaul, I build solutions tailored to how your business actually works.\n\nTools I work with include:\n- n8n\n- Workato\n- Make.com\n- Claude\n- OpenAI\n- CRMs\n- Email/Calendar integrations\n- API integrations\n\nThe conversation ends here. If you need something else, please type 'menu' or 'back' to return to the main menu or the previous step \u2014 otherwise this chat will end automatically in 15 minutes.` }}",
        "options": {
          "limitWaitTime": {
            "values": {
              "resumeUnit": "minutes",
              "resumeAmount": 15
            }
          }
        },
        "operation": "sendAndWait"
      },
      "typeVersion": 1.2
    },
    {
      "id": "d9dfc938-b761-41ba-b008-ccbc7866fbb5",
      "name": "Route Post-IT Consulting Chat",
      "type": "n8n-nodes-base.switch",
      "position": [
        14512,
        3168
      ],
      "parameters": {
        "rules": {
          "values": [
            {
              "outputKey": "menu",
              "conditions": {
                "options": {
                  "version": 3,
                  "leftValue": "",
                  "caseSensitive": true,
                  "typeValidation": "strict"
                },
                "combinator": "and",
                "conditions": [
                  {
                    "id": "643e109d-3d65-4467-ad21-180d33c701c2",
                    "operator": {
                      "type": "string",
                      "operation": "equals"
                    },
                    "leftValue": "={{ $json.chatInput.toLowerCase() }}",
                    "rightValue": "menu"
                  }
                ]
              },
              "renameOutput": true
            },
            {
              "outputKey": "back",
              "conditions": {
                "options": {
                  "version": 3,
                  "leftValue": "",
                  "caseSensitive": true,
                  "typeValidation": "strict"
                },
                "combinator": "and",
                "conditions": [
                  {
                    "id": "a515c2dd-49f9-405b-b6ec-868cb67f1e36",
                    "operator": {
                      "name": "filter.operator.equals",
                      "type": "string",
                      "operation": "equals"
                    },
                    "leftValue": "={{ $json.chatInput.toLowerCase() }}",
                    "rightValue": "back"
                  }
                ]
              },
              "renameOutput": true
            }
          ]
        },
        "options": {
          "fallbackOutput": "extra"
        }
      },
      "typeVersion": 3.4
    },
    {
      "id": "cf6264c9-f0c0-49e5-ab40-e36691546aa9",
      "name": "Route Post-Automation Info",
      "type": "n8n-nodes-base.switch",
      "position": [
        14512,
        3424
      ],
      "parameters": {
        "rules": {
          "values": [
            {
              "outputKey": "menu",
              "conditions": {
                "options": {
                  "version": 3,
                  "leftValue": "",
                  "caseSensitive": true,
                  "typeValidation": "strict"
                },
                "combinator": "and",
                "conditions": [
                  {
                    "id": "643e109d-3d65-4467-ad21-180d33c701c2",
                    "operator": {
                      "type": "string",
                      "operation": "equals"
                    },
                    "leftValue": "={{ $json.chatInput.toLowerCase() }}",
                    "rightValue": "menu"
                  }
                ]
              },
              "renameOutput": true
            },
            {
              "outputKey": "back",
              "conditions": {
                "options": {
                  "version": 3,
                  "leftValue": "",
                  "caseSensitive": true,
                  "typeValidation": "strict"
                },
                "combinator": "and",
                "conditions": [
                  {
                    "id": "26cc86a0-542d-4ba3-8eeb-202d38516855",
                    "operator": {
                      "name": "filter.operator.equals",
                      "type": "string",
                      "operation": "equals"
                    },
                    "leftValue": "={{ $json.chatInput.toLowerCase() }}",
                    "rightValue": "back"
                  }
                ]
              },
              "renameOutput": true
            }
          ]
        },
        "options": {
          "fallbackOutput": "extra"
        }
      },
      "typeVersion": 3.4
    },
    {
      "id": "f0d6823e-132a-442f-894f-a46d2e412694",
      "name": "Request Contact Details",
      "type": "@n8n/n8n-nodes-langchain.chat",
      "position": [
        13760,
        4256
      ],
      "parameters": {
        "message": "={{ `To send us a message, please provide a phone number or email address where we can reach you.` }}",
        "options": {
          "limitWaitTime": {
            "values": {
              "resumeUnit": "minutes",
              "resumeAmount": 15
            }
          }
        },
        "operation": "sendAndWait"
      },
      "typeVersion": 1.2
    },
    {
      "id": "c14df85c-dce9-4ff5-8d32-f29f8c3066ab",
      "name": "Check for Contact Information",
      "type": "n8n-nodes-base.if",
      "position": [
        14176,
        4256
      ],
      "parameters": {
        "options": {},
        "conditions": {
          "options": {
            "version": 3,
            "leftValue": "",
            "caseSensitive": true,
            "typeValidation": "strict"
          },
          "combinator": "or",
          "conditions": [
            {
              "id": "0868c985-c84b-4e2a-9b93-4377aa0fbbbe",
              "operator": {
                "type": "string",
                "operation": "exists",
                "singleValue": true
              },
              "leftValue": "={{ $json.extractedEmail }}",
              "rightValue": ""
            },
            {
              "id": "fb8cba86-04e0-404d-a933-092f0cbb3d71",
              "operator": {
                "type": "string",
                "operation": "exists",
                "singleValue": true
              },
              "leftValue": "={{ $json.extractedPhone }}",
              "rightValue": ""
            }
          ]
        }
      },
      "typeVersion": 2.3
    },
    {
      "id": "9bee26e7-f345-47ec-9448-a39e8bf77534",
      "name": "Retry Contact Information Request",
      "type": "@n8n/n8n-nodes-langchain.chat",
      "position": [
        14432,
        4368
      ],
      "parameters": {
        "message": "=We couldn't find a valid phone number or email in your message. Please try again, or write to us directly at {{ $('Set Workflow Configuration').item.json.contactEmail }}.",
        "options": {}
      },
      "typeVersion": 1.2
    },
    {
      "id": "eb3013bd-9fe0-4e6b-8080-8f6e498886f9",
      "name": "Route Post-Contact Confirmation",
      "type": "n8n-nodes-base.switch",
      "position": [
        14688,
        4272
      ],
      "parameters": {
        "rules": {
          "values": [
            {
              "outputKey": "menu",
              "conditions": {
                "options": {
                  "version": 3,
                  "leftValue": "",
                  "caseSensitive": true,
                  "typeValidation": "strict"
                },
                "combinator": "and",
                "conditions": [
                  {
                    "id": "643e109d-3d65-4467-ad21-180d33c701c2",
                    "operator": {
                      "type": "string",
                      "operation": "equals"
                    },
                    "leftValue": "={{ $json.chatInput.toLowerCase() }}",
                    "rightValue": "menu"
                  }
                ]
              },
              "renameOutput": true
            },
            {
              "outputKey": "back",
              "conditions": {
                "options": {
                  "version": 3,
                  "leftValue": "",
                  "caseSensitive": true,
                  "typeValidation": "strict"
                },
                "combinator": "and",
                "conditions": [
                  {
                    "id": "a515c2dd-49f9-405b-b6ec-868cb67f1e36",
                    "operator": {
                      "name": "filter.operator.equals",
                      "type": "string",
                      "operation": "equals"
                    },
                    "leftValue": "={{ $json.chatInput.toLowerCase() }}",
                    "rightValue": "back"
                  }
                ]
              },
              "renameOutput": true
            }
          ]
        },
        "options": {
          "fallbackOutput": "extra"
        }
      },
      "typeVersion": 3.4
    },
    {
      "id": "bc18b88a-3bbc-41e9-9c68-065e9237d0be",
      "name": "Verify Contact and Request Message",
      "type": "@n8n/n8n-nodes-langchain.chat",
      "position": [
        14432,
        4176
      ],
      "parameters": {
        "message": "={{ $json.extractedEmail \n  ? `Thanks, we've got your email address: \"${$json.extractedEmail}\". Please send us your message now.\\n\\nIf the email is wrong, or you'd like to provide a phone number instead, type 'back' to return to the previous step.`\n  : `Thanks, we've got your phone number: \"${$json.extractedPhone}\". Please send us your message now.\\n\\nIf the number is wrong, or you'd like to provide an email instead, type 'back' to return to the previous step.`\n}}",
        "options": {
          "limitWaitTime": {
            "values": {
              "resumeUnit": "minutes",
              "resumeAmount": 15
            }
          }
        },
        "operation": "sendAndWait"
      },
      "typeVersion": 1.2
    },
    {
      "id": "8afee3e3-04df-4d61-bdf5-f859ac8bfc08",
      "name": "Extract Contact from Message",
      "type": "n8n-nodes-base.code",
      "position": [
        13984,
        4256
      ],
      "parameters": {
        "jsCode": "// n8n Code node \u2014 extract email and phone number from incoming chat message\n// Assumes the previous node's text is in a field like `chatInput` or `text`.\n// Adjust the field name below to match your actual input.\n\nconst items = $input.all();\n\nconst emailRegex = /[a-zA-Z0-9._%+-]+@[a-zA-Z0-9.-]+\\.[a-zA-Z]{2,}/g;\n\n// Matches common phone formats: +1234567890, (030) 1234567, 0151-1234567, etc.\nconst phoneRegex = /(\\+?\\d{1,3}[\\s.-]?)?(\\(?\\d{2,4}\\)?[\\s.-]?)?\\d{3,4}[\\s.-]?\\d{3,6}/g;\n\nreturn items.map(item => {\n  // Change this to whatever field actually holds the message text\n  const message = item.json.chatInput || item.json.text || item.json.message || '';\n\n  const emailMatches = message.match(emailRegex) || [];\n  let phoneMatches = message.match(phoneRegex) || [];\n\n  // Clean up phone matches: strip whitespace-only or too-short false positives\n  phoneMatches = phoneMatches\n    .map(p => p.trim())\n    .filter(p => p.replace(/\\D/g, '').length >= 6);\n\n  return {\n    json: {\n      ...item.json,\n      extractedEmail: emailMatches[0] || null,\n      extractedPhone: phoneMatches[0] || null,\n      allEmails: emailMatches,\n      allPhones: phoneMatches,\n    },\n  };\n});"
      },
      "typeVersion": 2
    },
    {
      "id": "3d4e47f7-09b3-4dd1-abbf-cc1972191b8b",
      "name": "Confirm Message Prior to Sending",
      "type": "@n8n/n8n-nodes-langchain.chat",
      "position": [
        14944,
        4320
      ],
      "parameters": {
        "message": "={{ `Thanks, we've got your message: \"${$json.chatInput}\".\n\nTo send it, reply with 'send'. To rewrite it, type 'replace'. To go back to the phone/email step, type 'back', or type 'menu' for the main menu.`\n}}",
        "options": {
          "limitWaitTime": {
            "values": {
              "resumeUnit": "minutes",
              "resumeAmount": 15
            }
          }
        },
        "operation": "sendAndWait"
      },
      "typeVersion": 1.2
    },
    {
      "id": "599d33b4-58b6-4f6f-8382-1e67ea7b9f1e",
      "name": "Route Message Send Options",
      "type": "n8n-nodes-base.switch",
      "position": [
        15216,
        4272
      ],
      "parameters": {
        "rules": {
          "values": [
            {
              "outputKey": "send",
              "conditions": {
                "options": {
                  "version": 3,
                  "leftValue": "",
                  "caseSensitive": true,
                  "typeValidation": "strict"
                },
                "combinator": "and",
                "conditions": [
                  {
                    "id": "34382efa-1223-41f8-939b-bfc71b8455cb",
                    "operator": {
                      "name": "filter.operator.equals",
                      "type": "string",
                      "operation": "equals"
                    },
                    "leftValue": "={{ $json.chatInput.toLowerCase() }}",
                    "rightValue": "send"
                  }
                ]
              },
              "renameOutput": true
            },
            {
              "outputKey": "replace",
              "conditions": {
                "options": {
                  "version": 3,
                  "leftValue": "",
                  "caseSensitive": true,
                  "typeValidation": "strict"
                },
                "combinator": "and",
                "conditions": [
                  {
                    "id": "3f6fbbee-5eb2-4ba3-ac90-1bbeb90b24ee",
                    "operator": {
                      "name": "filter.operator.equals",
                      "type": "string",
                      "operation": "equals"
                    },
                    "leftValue": "={{ $json.chatInput.toLowerCase() }}",
                    "rightValue": "replace"
                  }
                ]
              },
              "renameOutput": true
            },
            {
              "outputKey": "menu",
              "conditions": {
                "options": {
                  "version": 3,
                  "leftValue": "",
                  "caseSensitive": true,
                  "typeValidation": "strict"
                },
                "combinator": "and",
                "conditions": [
                  {
                    "id": "643e109d-3d65-4467-ad21-180d33c701c2",
                    "operator": {
                      "type": "string",
                      "operation": "equals"
                    },
                    "leftValue": "={{ $json.chatInput.toLowerCase() }}",
                    "rightValue": "menu"
                  }
                ]
              },
              "renameOutput": true
            },
            {
              "outputKey": "back",
              "conditions": {
                "options": {
                  "version": 3,
                  "leftValue": "",
                  "caseSensitive": true,
                  "typeValidation": "strict"
                },
                "combinator": "and",
                "conditions": [
                  {
                    "id": "a515c2dd-49f9-405b-b6ec-868cb67f1e36",
                    "operator": {
                      "name": "filter.operator.equals",
                      "type": "string",
                      "operation": "equals"
                    },
                    "leftValue": "={{ $json.chatInput.toLowerCase() }}",
                    "rightValue": "back"
                  }
                ]
              },
              "renameOutput": true
            }
          ]
        },
        "options": {
          "fallbackOutput": "extra"
        }
      },
      "typeVersion": 3.4
    },
    {
      "id": "ef27acd5-e1f7-43b0-8bc7-c391d75ab68f",
      "name": "Send Email via Gmail",
      "type": "n8n-nodes-base.gmail",
      "position": [
        15696,
        4256
      ],
      "parameters": {
        "sendTo": "={{ $('Set Workflow Configuration').item.json.contactEmail }}",
        "message": "=<div style=\"font-family: Arial, sans-serif; max-width: 600px; margin: 0 auto; padding: 20px; background-color: #f9f9f9;\">   <div style=\"background-color: #ffffff; border-radius: 8px; padding: 24px; box-shadow: 0 1px 3px rgba(0,0,0,0.1);\">          <h2 style=\"color: #1a1a1a; margin-top: 0; border-bottom: 2px solid #4a90d9; padding-bottom: 10px;\">       New Website Chat Message     </h2>      <table style=\"width: 100%; border-collapse: collapse; margin: 16px 0;\">       <tr>         <td style=\"padding: 8px 0; color: #666; font-size: 14px; width: 140px;\"><strong>Email:</strong></td>         <td style=\"padding: 8px 0; color: #1a1a1a; font-size: 14px;\">{{ $('Extract Contact from Message').item.json.extractedEmail }}</td>       </tr>       <tr>         <td style=\"padding: 8px 0; color: #666; font-size: 14px;\"><strong>Phone:</strong></td>         <td style=\"padding: 8px 0; color: #1a1a1a; font-size: 14px;\">{{ $('Extract Contact from Message').item.json.extractedPhone }}</td>       </tr>     </table>      <div style=\"margin-top: 20px;\">       <p style=\"color: #666; font-size: 14px; margin-bottom: 6px;\"><strong>Message:</strong></p>       <div style=\"background-color: #f4f6f8; border-left: 3px solid #4a90d9; padding: 12px 16px; border-radius: 4px; color: #1a1a1a; font-size: 14px; line-height: 1.5;\">         {{ $('Verify Contact and Request Message').item.json.chatInput }}      </div>     </div>      <p style=\"color: #999; font-size: 12px; margin-top: 24px; border-top: 1px solid #eee; padding-top: 12px;\">       This notification was generated automatically from your website chat.     </p>    </div> </div>",
        "options": {},
        "subject": "You got a new message from your chat"
      },
      "credentials": {
        "gmailOAuth2": {
          "name": "<your credential>"
        }
      },
      "typeVersion": 2.2
    },
    {
      "id": "ac4d72b2-7509-459d-ae09-615e59625826",
      "name": "Acknowledge Email Receipt",
      "type": "@n8n/n8n-nodes-langchain.chat",
      "position": [
        15920,
        4256
      ],
      "parameters": {
        "message": "We've received your message and will get back to you shortly.\n\nThe conversation ends here. If you need something else, please type 'menu' to return to the main menu \u2014 otherwise this chat will end automatically in 15 minutes.",
        "options": {
          "limitWaitTime": {
            "values": {
              "resumeUnit": "minutes",
              "resumeAmount": 15
            }
          }
        },
        "operation": "sendAndWait"
      },
      "typeVersion": 1.2
    },
    {
      "id": "1acbf94e-a874-467b-bc39-f0eb1a055ede",
      "name": "Route Post-Email Confirmation",
      "type": "n8n-nodes-base.switch",
      "position": [
        16272,
        4256
      ],
      "parameters": {
        "rules": {
          "values": [
            {
              "outputKey": "menu",
              "conditions": {
                "options": {
                  "version": 3,
                  "leftValue": "",
                  "caseSensitive": true,
                  "typeValidation": "strict"
                },
                "combinator": "and",
                "conditions": [
                  {
                    "id": "643e109d-3d65-4467-ad21-180d33c701c2",
                    "operator": {
                      "type": "string",
                      "operation": "equals"
                    },
                    "leftValue": "={{ $json.chatInput.toLowerCase() }}",
                    "rightValue": "menu"
                  }
                ]
              },
              "renameOutput": true
            }
          ]
        },
        "options": {
          "fallbackOutput": "extra"
        }
      },
      "typeVersion": 3.4
    },
    {
      "id": "9315fd07-ad61-4939-b9d7-9a95a9240e77",
      "name": "Handle Invalid Response",
      "type": "@n8n/n8n-nodes-langchain.chat",
      "position": [
        15424,
        4384
      ],
      "parameters": {
        "message": "={{ `Sorry, something went wrong. To send your message, reply with 'send'. To rewrite it, type 'replace'. To go back to the phone/email step, type 'back', or type 'menu' for the main menu.`\n}}",
        "options": {
          "limitWaitTime": {
            "values": {
              "resumeUnit": "minutes",
              "resumeAmount": 15
            }
          }
        },
        "operation": "sendAndWait"
      },
      "typeVersion": 1.2
    },
    {
      "id": "8510fd28-358c-4218-ba21-c02a913403d2",
      "name": "Set Workflow Configuration",
      "type": "n8n-nodes-base.set",
      "position": [
        12016,
        3456
      ],
      "parameters": {
        "options": {},
        "assignments": {
          "assignments": [
            {
              "id": "da758a7d-9e8a-4a9d-a5cb-6bc05b37ca80",
              "name": "contactEmail",
              "type": "string",
              "value": "info@example.com"
            },
            {
              "id": "7037340e-494f-4756-9ec4-796985e286be",
              "name": "calendlyLink",
              "type": "string",
              "value": "https://calendly.com/your-name/introduction-call"
            },
            {
              "id": "35f436fe-fdf5-4a16-8525-73d4294d5327",
              "name": "imprintUrl",
              "type": "string",
              "value": "https://www.example.com/privacy.html"
            }
          ]
        }
      },
      "typeVersion": 3.4
    },
    {
      "id": "82c267a6-21bb-475e-954e-ca9ec164e88e",
      "name": "Present IT Consulting Services",
      "type": "@n8n/n8n-nodes-langchain.chat",
      "position": [
        14272,
        3184
      ],
      "parameters": {
        "message": "={{ `My IT consultancy service is about giving you clarity on your technology stack \u2014 whether that's planning a cloud migration, auditing your current infrastructure, or simply advising on the right tools for where your business is headed. With 10+ years of IT experience, I translate technical complexity into decisions you can act on with confidence.\n\nTools I support include:\n- Microsoft 365\n- Google Workspace\n- Microsoft Intune and Entra ID\n- Google Cloud\n- Phone systems\n- Firewall and network infrastructure\n- Windows and Linux server management\n\nThe conversation ends here. If you need something else, please type 'menu' or 'back' to return to the main menu or the previous step \u2014 otherwise this chat will end automatically in 15 minutes.` }}",
        "options": {
          "limitWaitTime": {
            "values": {
              "resumeUnit": "minutes",
              "resumeAmount": 15
            }
          }
        },
        "operation": "sendAndWait"
      },
      "typeVersion": 1.2
    }
  ],
  "active": false,
  "settings": {
    "binaryMode": "separate",
    "availableInMCP": false,
    "executionOrder": "v1"
  },
  "versionId": "b6bfa444-7429-429b-97e5-95c308235ed0",
  "connections": {
    "Display Main Menu": {
      "main": [
        [
          {
            "node": "Route by Main Menu Choice",
            "type": "main",
            "index": 0
          }
        ]
      ]
    },
    "Send Email via Gmail": {
      "main": [
        [
          {
            "node": "Acknowledge Email Receipt",
            "type": "main",
            "index": 0
          }
        ]
      ]
    },
    "Send Welcome Message": {
      "main": [
        [
          {
            "node": "Display Main Menu",
            "type": "main",
            "index": 0
          }
        ]
      ]
    },
    "Handle Invalid Response": {
      "main": [
        [
          {
            "node": "Route Message Send Options",
            "type": "main",
            "index": 0
          }
        ]
      ]
    },
    "Request Contact Details": {
      "main": [
        [
          {
            "node": "Extract Contact from Message",
            "type": "main",
            "index": 0
          }
        ]
      ]
    },
    "Route by Service Choice": {
      "main": [
        [
          {
            "node": "Present IT Consulting Services",
            "type": "main",
            "index": 0
          }
        ],
        [
          {
            "node": "Present Automation Services",
            "type": "main",
            "index": 0
          }
        ],
        [
          {
            "node": "Display Main Menu",
            "type": "main",
            "index": 0
          }
        ],
        [
          {
            "node": "Display Main Menu",
            "type": "main",
            "index": 0
          }
        ],
        [
          {
            "node": "Provide Services Information",
            "type": "main",
            "index": 0
          }
        ]
      ]
    },
    "Acknowledge Email Receipt": {
      "main": [
        [
          {
            "node": "Route Post-Email Confirmation",
            "type": "main",
            "index": 0
          }
        ]
      ]
    },
    "Route Post-Schedule Reply": {
      "main": [
        [
          {
            "node": "Display Main Menu",
            "type": "main",
            "index": 0
          }
        ],
        [
          {
            "node": "Initiate Meeting Scheduling",
            "type": "main",
            "index": 0
          }
        ]
      ]
    },
    "Route by Main Menu Choice": {
      "main": [
        [
          {
            "node": "Initiate Meeting Scheduling",
            "type": "main",
            "index": 0
          }
        ],
        [
          {
            "node": "Provide Services Information",
            "type": "main",
            "index": 0
          }
        ],
        [
          {
            "node": "Request Contact Details",
            "type": "main",
            "index": 0
          }
        ],
        [
          {
            "node": "Display Main Menu",
            "type": "main",
            "index": 0
          }
        ],
        [
          {
            "node": "Display Main Menu",
            "type": "main",
            "index": 0
          }
        ],
        [
          {
            "node": "Display Main Menu",
            "type": "main",
            "index": 0
          }
        ]
      ]
    },
    "Route Message Send Options": {
      "main": [
        [
          {
            "node": "Send Email via Gmail",
            "type": "main",
            "index": 0
          }
        ],
        [
          {
            "node": "Verify Contact and Request Message",
            "type": "main",
            "index": 0
          }
        ],
        [
          {
            "node": "Display Main Menu",
            "type": "main",
            "index": 0
          }
        ],
        [
          {
            "node": "Request Contact Details",
            "type": "main",
            "index": 0
          }
        ],
        [
          {
            "node": "Handle Invalid Response",
            "type": "main",
            "index": 0
          }
        ]
      ]
    },
    "Route Post-Automation Info": {
      "main": [
        [
          {
            "node": "Display Main Menu",
            "type": "main",
            "index": 0
          }
        ],
        [
          {
            "node": "Provide Services Information",
            "type": "main",
            "index": 0
          }
        ],
        [
          {
            "node": "Present Automation Services",
            "type": "main",
            "index": 0
          }
        ]
      ]
    },
    "Set Workflow Configuration": {
      "main": [
        [
          {
            "node": "Send Welcome Message",
            "type": "main",
            "index": 0
          }
        ]
      ]
    },
    "Initiate Meeting Scheduling": {
      "main": [
        [
          {
            "node": "Route Post-Schedule Reply",
            "type": "main",
            "index": 0
          }
        ]
      ]
    },
    "Present Automation Services": {
      "main": [
        [
          {
            "node": "Route Post-Automation Info",
            "type": "main",
            "index": 0
          }
        ]
      ]
    },
    "Extract Contact from Message": {
      "main": [
        [
          {
            "node": "Check for Contact Information",
            "type": "main",
            "index": 0
          }
        ]
      ]
    },
    "Provide Services Information": {
      "main": [
        [
          {
            "node": "Route by Service Choice",
            "type": "main",
            "index": 0
          }
        ]
      ]
    },
    "Check for Contact Information": {
      "main": [
        [
          {
            "node": "Verify Contact and Request Message",
            "type": "main",
            "index": 0
          }
        ],
        [
          {
            "node": "Retry Contact Information Request",
            "type": "main",
            "index": 0
          }
        ]
      ]
    },
    "Route Post-Email Confirmation": {
      "main": [
        [
          {
            "node": "Display Main Menu",
            "type": "main",
            "index": 0
          }
        ],
        [
          {
            "node": "Acknowledge Email Receipt",
            "type": "main",
            "index": 0
          }
        ]
      ]
    },
    "Route Post-IT Consulting Chat": {
      "main": [
        [
          {
            "node": "Display Main Menu",
            "type": "main",
            "index": 0
          }
        ],
        [
          {
            "node": "Provide Services Information",
            "type": "main",
            "index": 0
          }
        ],
        [
          {
            "node": "Present IT Consulting Services",
            "type": "main",
            "index": 0
          }
        ]
      ]
    },
    "Present IT Consulting Services": {
      "main": [
        [
          {
            "node": "Route Post-IT Consulting Chat",
            "type": "main",
            "index": 0
          }
        ]
      ]
    },
    "Route Post-Contact Confirmation": {
      "main": [
        [
          {
            "node": "Display Main Menu",
            "type": "main",
            "index": 0
          }
        ],
        [
          {
            "node": "Request Contact Details",
            "type": "main",
            "index": 0
          }
        ],
        [
          {
            "node": "Confirm Message Prior to Sending",
            "type": "main",
            "index": 0
          }
        ]
      ]
    },
    "Confirm Message Prior to Sending": {
      "main": [
        [
          {
            "node": "Route Message Send Options",
            "type": "main",
            "index": 0
          }
        ]
      ]
    },
    "Retry Contact Information Request": {
      "main": [
        [
          {
            "node": "Request Contact Details",
            "type": "main",
            "index": 0
          }
        ]
      ]
    },
    "Verify Contact and Request Message": {
      "main": [
        [
          {
            "node": "Route Post-Contact Confirmation",
            "type": "main",
            "index": 0
          }
        ]
      ]
    }
  }
}