{
  "name": "Website form \u2192 WhatsApp follow-up in under a minute",
  "nodes": [
    {
      "parameters": {
        "content": "What you get: a WhatsApp message to everyone who fills in your website form (Typeform, Tally, WordPress, Bitrix24 web forms -- any form that can call a webhook), plus a lead in the CRM.\nWhat it replaces: the auto-reply email nobody opens and the follow-up call that happens the next day.\nSetup time: about 10 minutes.\n\nThe form is where interest peaks -- this template answers while it is still hot.\n\nWorks with a normal WhatsApp number -- no Meta Business account needed.\n\nThis workflow accepts a generic JSON body ({ name, phone, email, message }). See the \"Mapping Other Form Builders\" note below the \"Map Form Fields\" node for how to adapt Typeform, Tally, WordPress, or Bitrix24 web forms to that shape. Creating a CRM lead is optional -- flip \"createCrmLead\" to false in the Settings node to send the WhatsApp message only.\n\nSetup:\n1. Create an API key at https://developers.wasync.app/keys (scopes: whatsapp.send).\n2. In n8n, go to Credentials -> New -> Header Auth. Name the credential \"WASync API key\". Set its Name field to `Authorization` and its Value field to `Bearer wsk_live_<your key>`.\n3. Open the \"Settings\" node at the top of this workflow and fill in your own values. Never commit real portal URLs, tokens, connection ids, or phone numbers.\n\nPoint your form tool (Typeform webhook, Tally webhook, WordPress plugin, Bitrix24 web form) at this workflow's Webhook node URL -- copy it from the \"Website Form Webhook\" node (double-click -> \"Production URL\"). Find your WASync connectionId by calling `GET https://developers.wasync.app/api/v1/connections` with your API key, or from your connection list at developers.wasync.app -- put it in the Settings node.\n\nThis template uses only built-in n8n nodes, so it works on n8n Cloud; if you self-host, you can also use our community node n8n-nodes-wasync.\n\nDocs: https://docs.wasync.app/docs/guides/n8n?utm_source=n8n&utm_medium=template&utm_campaign=t6-http",
        "height": 640,
        "width": 520
      },
      "name": "Read Me First",
      "type": "n8n-nodes-base.stickyNote",
      "typeVersion": 1,
      "position": [
        0,
        -180
      ]
    },
    {
      "parameters": {
        "httpMethod": "POST",
        "path": "website-form",
        "responseMode": "onReceived",
        "options": {}
      },
      "name": "Website Form Webhook",
      "type": "n8n-nodes-base.webhook",
      "typeVersion": 2,
      "position": [
        0,
        460
      ]
    },
    {
      "parameters": {
        "mode": "manual",
        "assignments": {
          "assignments": [
            {
              "id": "Settings-0",
              "name": "bitrixPortalUrl",
              "value": "https://yourportal.bitrix24.com",
              "type": "string"
            },
            {
              "id": "Settings-1",
              "name": "bitrixWebhookToken",
              "value": "REPLACE_WITH_YOUR_INBOUND_WEBHOOK_TOKEN",
              "type": "string"
            },
            {
              "id": "Settings-2",
              "name": "companyName",
              "value": "Your Company",
              "type": "string"
            },
            {
              "id": "Settings-3",
              "name": "defaultCountryCode",
              "value": "40",
              "type": "string"
            },
            {
              "id": "Settings-4",
              "name": "createCrmLead",
              "value": true,
              "type": "boolean"
            },
            {
              "id": "Settings-5",
              "name": "wasyncConnectionId",
              "value": "REPLACE_WITH_YOUR_WASYNC_CONNECTION_ID",
              "type": "string"
            }
          ]
        },
        "options": {}
      },
      "name": "Settings",
      "type": "n8n-nodes-base.set",
      "typeVersion": 3.4,
      "position": [
        0,
        700
      ]
    },
    {
      "parameters": {
        "mode": "manual",
        "assignments": {
          "assignments": [
            {
              "id": "Map-0",
              "name": "name",
              "value": "={{ $('Website Form Webhook').item.json.body.name || '' }}",
              "type": "string"
            },
            {
              "id": "Map-1",
              "name": "phone",
              "value": "={{ $('Website Form Webhook').item.json.body.phone || '' }}",
              "type": "string"
            },
            {
              "id": "Map-2",
              "name": "email",
              "value": "={{ $('Website Form Webhook').item.json.body.email || '' }}",
              "type": "string"
            },
            {
              "id": "Map-3",
              "name": "message",
              "value": "={{ $('Website Form Webhook').item.json.body.message || '' }}",
              "type": "string"
            }
          ]
        },
        "options": {}
      },
      "name": "Map Form Fields",
      "type": "n8n-nodes-base.set",
      "typeVersion": 3.4,
      "position": [
        260,
        700
      ]
    },
    {
      "parameters": {
        "content": "Mapping other form builders\n\nThe \"Map Form Fields\" node reads {{ $json.body.name }}, {{ $json.body.phone }}, {{ $json.body.email }} and {{ $json.body.message }}. If your form tool sends a different shape, edit those four expressions:\n\n- Typeform: body is `form_response.answers[]`, each item has a `field.ref` (or `field.title`) plus a type-specific value (`.phone_number`, `.email`, `.text`). Find the answer by ref/type, e.g. {{ $json.body.form_response.answers.find(a => a.field.type === 'phone_number')?.phone_number }}.\n- Tally: body is `data.fields[]`, each `{ key, label, value }`. Map by label, e.g. {{ $json.body.data.fields.find(f => f.label === 'Phone')?.value }}.\n- WordPress (Contact Form 7 / WPForms / Forminator): the webhook payload usually mirrors your field names directly (e.g. `your-name`, `your-phone`) -- check the plugin's webhook/Zapier-style payload docs and adjust the field keys to match.\n- Bitrix24 web forms (CRM Forms): forward via the form's \"Send data to another site\" action, or an outbound `crm.lead.add` webhook -- fields arrive Bitrix24-style (NAME, PHONE[0].VALUE, EMAIL[0].VALUE).",
        "height": 380,
        "width": 480
      },
      "name": "Mapping Other Form Builders",
      "type": "n8n-nodes-base.stickyNote",
      "typeVersion": 1,
      "position": [
        220,
        920
      ]
    },
    {
      "parameters": {
        "mode": "runOnceForAllItems",
        "jsCode": "// Strip everything but digits, then prepend the default country code (from Settings) if the number\n// looks local (no leading country code / not already in +NN... shape).\nconst countryCode = String($('Settings').first().json.defaultCountryCode || '').replace(/\\D/g, '');\n\nreturn $input.all().map((item) => {\n  let digits = String(item.json.phone || '').replace(/\\D/g, '');\n  if (countryCode && digits.length <= 10 && !digits.startsWith(countryCode)) {\n    digits = countryCode + digits;\n  }\n  return { json: { ...item.json, phoneE164: '+' + digits } };\n});"
      },
      "name": "Normalize Phone",
      "type": "n8n-nodes-base.code",
      "typeVersion": 2,
      "position": [
        520,
        700
      ]
    },
    {
      "parameters": {
        "method": "POST",
        "url": "https://developers.wasync.app/api/v1/messages",
        "authentication": "genericCredentialType",
        "genericAuthType": "httpHeaderAuth",
        "sendHeaders": true,
        "headerParameters": {
          "parameters": [
            {
              "name": "Accept",
              "value": "application/json"
            }
          ]
        },
        "options": {},
        "sendBody": true,
        "contentType": "json",
        "specifyBody": "json",
        "jsonBody": "={{ JSON.stringify({ connectionId: $('Settings').item.json.wasyncConnectionId, to: $json.phoneE164, text: 'Hello ' + ($('Map Form Fields').item.json.name || 'there') + '! Thanks for reaching out to ' + $('Settings').item.json.companyName + '. We got your message and will follow up shortly.' }) }}"
      },
      "name": "Send WhatsApp Message",
      "type": "n8n-nodes-base.httpRequest",
      "typeVersion": 4.2,
      "position": [
        780,
        700
      ],
      "credentials": {
        "httpHeaderAuth": {
          "name": "WASync API key"
        }
      }
    },
    {
      "parameters": {
        "conditions": {
          "options": {
            "caseSensitive": true,
            "leftValue": "",
            "typeValidation": "strict"
          },
          "conditions": [
            {
              "id": "Create CRM Lead?-cond0",
              "leftValue": "={{ $('Settings').item.json.createCrmLead }}",
              "rightValue": true,
              "operator": {
                "type": "boolean",
                "operation": "equals"
              }
            }
          ],
          "combinator": "and"
        },
        "options": {}
      },
      "name": "Create CRM Lead?",
      "type": "n8n-nodes-base.if",
      "typeVersion": 2.2,
      "position": [
        1040,
        700
      ]
    },
    {
      "parameters": {
        "method": "POST",
        "url": "={{ $('Settings').item.json.bitrixPortalUrl }}/rest/{{ $('Settings').item.json.bitrixWebhookToken }}/crm.lead.add",
        "sendBody": true,
        "contentType": "json",
        "specifyBody": "json",
        "jsonBody": "={{ JSON.stringify({ fields: { NAME: ($('Map Form Fields').item.json.name || 'Website lead'), PHONE: [{ VALUE: $('Map Form Fields').item.json.phone, VALUE_TYPE: 'WORK' }], EMAIL: ($('Map Form Fields').item.json.email ? [{ VALUE: $('Map Form Fields').item.json.email, VALUE_TYPE: 'WORK' }] : []), COMMENTS: $('Map Form Fields').item.json.message, SOURCE_ID: 'WEB' } }) }}",
        "options": {}
      },
      "name": "Create CRM Lead",
      "type": "n8n-nodes-base.httpRequest",
      "typeVersion": 4.2,
      "position": [
        1300,
        700
      ]
    }
  ],
  "connections": {
    "Website Form Webhook": {
      "main": [
        [
          {
            "node": "Settings",
            "type": "main",
            "index": 0
          }
        ]
      ]
    },
    "Settings": {
      "main": [
        [
          {
            "node": "Map Form Fields",
            "type": "main",
            "index": 0
          }
        ]
      ]
    },
    "Map Form Fields": {
      "main": [
        [
          {
            "node": "Normalize Phone",
            "type": "main",
            "index": 0
          }
        ]
      ]
    },
    "Normalize Phone": {
      "main": [
        [
          {
            "node": "Send WhatsApp Message",
            "type": "main",
            "index": 0
          }
        ]
      ]
    },
    "Send WhatsApp Message": {
      "main": [
        [
          {
            "node": "Create CRM Lead?",
            "type": "main",
            "index": 0
          }
        ]
      ]
    },
    "Create CRM Lead?": {
      "main": [
        [
          {
            "node": "Create CRM Lead",
            "type": "main",
            "index": 0
          }
        ]
      ]
    }
  },
  "settings": {
    "executionOrder": "v1"
  }
}
