{
  "name": "Lead follow-up: form > AI qualify > CRM > Slack > 3-step email (Swiftbuild demo)",
  "nodes": [
    {
      "parameters": {
        "httpMethod": "POST",
        "path": "lead",
        "responseMode": "onReceived",
        "options": {}
      },
      "id": "dd54ee86-facc-4495-92f9-fd55a169d949",
      "name": "Website form",
      "type": "n8n-nodes-base.webhook",
      "typeVersion": 2,
      "position": [
        0,
        300
      ],
      "webhookId": "6cbdda8f-96f7-47bb-b43a-8564b24878f2"
    },
    {
      "parameters": {
        "modelId": {
          "__rl": true,
          "value": "gpt-4o-mini",
          "mode": "list",
          "cachedResultName": "GPT-4O-MINI"
        },
        "messages": {
          "values": [
            {
              "role": "system",
              "content": "You qualify inbound B2B leads. Score 1-10 using: role seniority, stated budget, urgency, fit for automation services. Return JSON only: {\"score\": number, \"tier\": \"hot\"|\"warm\"|\"cold\", \"reason\": string (max 20 words)}."
            },
            {
              "content": "=Name: {{ $json.body.name }}\nCompany: {{ $json.body.company }}\nBudget: {{ $json.body.budget }}\nMessage: {{ $json.body.message }}"
            }
          ]
        },
        "jsonOutput": true,
        "options": {
          "temperature": 0
        }
      },
      "id": "00bcabee-bfed-4ccb-9988-cc1ffbaf942c",
      "name": "AI qualify lead",
      "type": "@n8n/n8n-nodes-langchain.openAi",
      "typeVersion": 1.8,
      "position": [
        240,
        300
      ],
      "credentials": {
        "openAiApi": {
          "id": "REPLACE_WITH_YOUR_CREDENTIAL_ID",
          "name": "OpenAI account"
        }
      }
    },
    {
      "parameters": {
        "method": "POST",
        "url": "https://api.your-crm.example.com/v1/contacts",
        "authentication": "genericCredentialType",
        "genericAuthType": "httpHeaderAuth",
        "sendBody": true,
        "specifyBody": "json",
        "jsonBody": "={\n  \"email\": \"{{ $('Website form').item.json.body.email }}\",\n  \"name\": \"{{ $('Website form').item.json.body.name }}\",\n  \"company\": \"{{ $('Website form').item.json.body.company }}\",\n  \"source\": \"website-form\",\n  \"lead_score\": {{ $json.message.content.score }},\n  \"lead_tier\": \"{{ $json.message.content.tier }}\",\n  \"ai_reason\": \"{{ $json.message.content.reason }}\"\n}",
        "options": {}
      },
      "id": "1522a24e-0a42-4957-8599-2affb1e97283",
      "name": "Create CRM contact",
      "type": "n8n-nodes-base.httpRequest",
      "typeVersion": 4.2,
      "position": [
        480,
        300
      ],
      "credentials": {
        "httpHeaderAuth": {
          "id": "REPLACE_WITH_YOUR_CREDENTIAL_ID",
          "name": "CRM API key"
        }
      }
    },
    {
      "parameters": {
        "select": "channel",
        "channelId": {
          "__rl": true,
          "value": "#new-leads",
          "mode": "name"
        },
        "text": "={{ $('AI qualify lead').item.json.message.content.score >= 7 ? ':fire: PRIORITY ' : '' }}New lead: {{ $('Website form').item.json.body.name }} ({{ $('Website form').item.json.body.company || 'no company' }}) scored {{ $('AI qualify lead').item.json.message.content.score }}/10\n> {{ $('AI qualify lead').item.json.message.content.reason }}\nEmail: {{ $('Website form').item.json.body.email }}",
        "otherOptions": {}
      },
      "id": "12791cd0-eb60-41a4-aad2-5668b6b38a88",
      "name": "Alert sales in Slack",
      "type": "n8n-nodes-base.slack",
      "typeVersion": 2.2,
      "position": [
        720,
        120
      ],
      "credentials": {
        "slackApi": {
          "id": "REPLACE_WITH_YOUR_CREDENTIAL_ID",
          "name": "Slack account"
        }
      },
      "webhookId": "04e7194c-256f-4f53-85f9-662e57c01951"
    },
    {
      "parameters": {
        "fromEmail": "hello@your-domain.example.com",
        "toEmail": "={{ $('Website form').item.json.body.email }}",
        "subject": "=Thanks for reaching out, {{ $('Website form').item.json.body.name.split(' ')[0] }}",
        "emailFormat": "text",
        "text": "=Hi {{ $('Website form').item.json.body.name.split(' ')[0] }},\n\nThanks for getting in touch about: \"{{ $('Website form').item.json.body.message }}\"\n\nI have read your note and will come back with next steps shortly. If it is easier to talk it through, you can grab a 15-minute slot here: https://example.com/book\n\nBest,\nThe team",
        "options": {
          "appendAttribution": false
        }
      },
      "id": "a64b10b4-8c49-48f5-b232-50bd015348bd",
      "name": "Send welcome email",
      "type": "n8n-nodes-base.emailSend",
      "typeVersion": 2.1,
      "position": [
        720,
        480
      ],
      "credentials": {
        "smtp": {
          "id": "REPLACE_WITH_YOUR_CREDENTIAL_ID",
          "name": "SMTP account"
        }
      },
      "webhookId": "440342d7-b0fe-4a31-b7ba-5573e6d322c5"
    },
    {
      "parameters": {
        "amount": 2,
        "unit": "days"
      },
      "id": "6285c3f3-4813-4b68-ad25-651d8f43d048",
      "name": "Wait 2 days",
      "type": "n8n-nodes-base.wait",
      "typeVersion": 1.1,
      "position": [
        960,
        480
      ],
      "webhookId": "a4876d86-f40a-43f6-a819-c7ab5a8c2514"
    },
    {
      "parameters": {
        "fromEmail": "hello@your-domain.example.com",
        "toEmail": "={{ $('Website form').item.json.body.email }}",
        "subject": "=A quick idea for {{ $('Website form').item.json.body.company || 'your team' }}",
        "emailFormat": "text",
        "text": "=Hi {{ $('Website form').item.json.body.name.split(' ')[0] }},\n\nFollowing up on your message from a couple of days ago. Here is a short guide on how teams like yours handle this: https://example.com/guide\n\nWould a quick call this week help?\n\nBest,\nThe team",
        "options": {
          "appendAttribution": false
        }
      },
      "id": "1ccd919d-7830-4d26-b76b-a8cf61c4c3a6",
      "name": "Send follow-up",
      "type": "n8n-nodes-base.emailSend",
      "typeVersion": 2.1,
      "position": [
        1200,
        480
      ],
      "credentials": {
        "smtp": {
          "id": "REPLACE_WITH_YOUR_CREDENTIAL_ID",
          "name": "SMTP account"
        }
      },
      "webhookId": "e98fa7a6-6cb7-41e4-8ce0-73ea7647d7fa"
    },
    {
      "parameters": {
        "amount": 4,
        "unit": "days"
      },
      "id": "ba2bdf64-d7f5-4c71-9dca-009d415c8c40",
      "name": "Wait 4 days",
      "type": "n8n-nodes-base.wait",
      "typeVersion": 1.1,
      "position": [
        1440,
        480
      ],
      "webhookId": "49913a62-dda2-4938-abc0-f27d047c0738"
    },
    {
      "parameters": {
        "fromEmail": "hello@your-domain.example.com",
        "toEmail": "={{ $('Website form').item.json.body.email }}",
        "subject": "=Should I close your request?",
        "emailFormat": "text",
        "text": "=Hi {{ $('Website form').item.json.body.name.split(' ')[0] }},\n\nI have not heard back, so I will assume the timing is not right. If anything changes, just reply to this email and it comes straight to me.\n\nBest,\nThe team",
        "options": {
          "appendAttribution": false
        }
      },
      "id": "516d4c3d-38a2-4259-a89b-f25b1f199897",
      "name": "Send last check-in",
      "type": "n8n-nodes-base.emailSend",
      "typeVersion": 2.1,
      "position": [
        1680,
        480
      ],
      "credentials": {
        "smtp": {
          "id": "REPLACE_WITH_YOUR_CREDENTIAL_ID",
          "name": "SMTP account"
        }
      },
      "webhookId": "5d665f62-c23a-4a6d-a71e-f61dbd44a462"
    }
  ],
  "connections": {
    "Website form": {
      "main": [
        [
          {
            "node": "AI qualify lead",
            "type": "main",
            "index": 0
          }
        ]
      ]
    },
    "AI qualify lead": {
      "main": [
        [
          {
            "node": "Create CRM contact",
            "type": "main",
            "index": 0
          }
        ]
      ]
    },
    "Create CRM contact": {
      "main": [
        [
          {
            "node": "Alert sales in Slack",
            "type": "main",
            "index": 0
          },
          {
            "node": "Send welcome email",
            "type": "main",
            "index": 0
          }
        ]
      ]
    },
    "Send welcome email": {
      "main": [
        [
          {
            "node": "Wait 2 days",
            "type": "main",
            "index": 0
          }
        ]
      ]
    },
    "Wait 2 days": {
      "main": [
        [
          {
            "node": "Send follow-up",
            "type": "main",
            "index": 0
          }
        ]
      ]
    },
    "Send follow-up": {
      "main": [
        [
          {
            "node": "Wait 4 days",
            "type": "main",
            "index": 0
          }
        ]
      ]
    },
    "Wait 4 days": {
      "main": [
        [
          {
            "node": "Send last check-in",
            "type": "main",
            "index": 0
          }
        ]
      ]
    }
  },
  "active": false,
  "settings": {
    "executionOrder": "v1"
  },
  "pinData": {},
  "meta": {
    "templateCredsSetupCompleted": false
  },
  "tags": []
}