{
  "name": "Form leads to HubSpot with Slack alert",
  "nodes": [
    {
      "parameters": {
        "httpMethod": "POST",
        "path": "new-lead",
        "options": {}
      },
      "id": "80401bdd-516a-551b-9c7c-c6147b0467c5",
      "name": "New form submission",
      "type": "n8n-nodes-base.webhook",
      "typeVersion": 2,
      "position": [
        200,
        300
      ],
      "webhookId": "8d44d6ec-9434-5ae6-82d3-2f9212f4064e"
    },
    {
      "parameters": {
        "assignments": {
          "assignments": [
            {
              "id": "a1",
              "name": "name",
              "value": "={{ $json.body.data.fields.find(f => f.label.toLowerCase().includes('name'))?.value }}",
              "type": "string"
            },
            {
              "id": "a2",
              "name": "email",
              "value": "={{ $json.body.data.fields.find(f => f.type === 'INPUT_EMAIL')?.value }}",
              "type": "string"
            },
            {
              "id": "a3",
              "name": "message",
              "value": "={{ $json.body.data.fields.find(f => f.type === 'TEXTAREA')?.value }}",
              "type": "string"
            }
          ]
        },
        "options": {}
      },
      "id": "4b4635df-f02c-5327-a5fa-8b68aeaa46fa",
      "name": "Pick the fields",
      "type": "n8n-nodes-base.set",
      "typeVersion": 3.4,
      "position": [
        420,
        300
      ]
    },
    {
      "parameters": {
        "authentication": "appToken",
        "operation": "upsert",
        "email": "={{ $json.email }}",
        "additionalFields": {
          "firstName": "={{ $json.name }}"
        }
      },
      "id": "21ff760c-f07f-54ff-8716-e55aead4c9ad",
      "name": "Add to HubSpot",
      "type": "n8n-nodes-base.hubspot",
      "typeVersion": 2.1,
      "position": [
        640,
        300
      ]
    },
    {
      "parameters": {
        "select": "channel",
        "channelId": {
          "__rl": true,
          "value": "#general",
          "mode": "name"
        },
        "text": "=New lead: {{ $('Pick the fields').item.json.name }} ({{ $('Pick the fields').item.json.email }})\n> {{ $('Pick the fields').item.json.message }}",
        "otherOptions": {}
      },
      "id": "421ff43c-1321-53f6-9af8-628d6729aa4d",
      "name": "Alert in Slack",
      "type": "n8n-nodes-base.slack",
      "typeVersion": 2.2,
      "position": [
        860,
        300
      ]
    },
    {
      "parameters": {
        "content": "## Draft, not yet tested\nThis workflow was written by Automation Recipes and has NOT been run end to end yet.\n\nAfter importing: open each node, connect your own accounts (credentials), and fill in anything left blank (sheet URL, Slack channel, label names). Then run it once by hand with test data before turning it on.\n\nThe Pick the fields step assumes a Tally form with a name field, an email field, and a long-text field.",
        "height": 260,
        "width": 420
      },
      "id": "6990202b-b23c-5c46-bc37-e430ca0b63ff",
      "name": "Read me",
      "type": "n8n-nodes-base.stickyNote",
      "typeVersion": 1,
      "position": [
        0,
        20
      ]
    }
  ],
  "connections": {
    "New form submission": {
      "main": [
        [
          {
            "node": "Pick the fields",
            "type": "main",
            "index": 0
          }
        ]
      ]
    },
    "Pick the fields": {
      "main": [
        [
          {
            "node": "Add to HubSpot",
            "type": "main",
            "index": 0
          }
        ]
      ]
    },
    "Add to HubSpot": {
      "main": [
        [
          {
            "node": "Alert in Slack",
            "type": "main",
            "index": 0
          }
        ]
      ]
    }
  },
  "settings": {
    "executionOrder": "v1"
  },
  "pinData": {},
  "meta": {
    "templateCredsSetupCompleted": false
  },
  "tags": []
}