{
  "id": "URFOwLt4qHI8HLbi",
  "name": "Lead Qualification Workflow",
  "tags": [],
  "nodes": [
    {
      "id": "a0a1e560-ae5f-4a4a-8a85-55d6da224aec",
      "name": "Typeform Submission",
      "type": "n8n-nodes-base.typeformTrigger",
      "position": [
        240,
        400
      ],
      "parameters": {
        "formId": "<__PLACEHOLDER_VALUE__Your Typeform Form ID__>"
      },
      "typeVersion": 1.1
    },
    {
      "id": "1376c2d8-7e45-4061-b42d-5679197790e9",
      "name": "Configure Variables",
      "type": "n8n-nodes-base.set",
      "position": [
        464,
        400
      ],
      "parameters": {
        "options": {},
        "assignments": {
          "assignments": [
            {
              "id": "1",
              "name": "typeformFormId",
              "type": "string",
              "value": "<__PLACEHOLDER_VALUE__Your Typeform Form ID__>"
            },
            {
              "id": "2",
              "name": "hotLeadThreshold",
              "type": "number",
              "value": 80
            },
            {
              "id": "3",
              "name": "warmLeadThreshold",
              "type": "number",
              "value": 50
            },
            {
              "id": "4",
              "name": "hotPipelineId",
              "type": "string",
              "value": "<__PLACEHOLDER_VALUE__Hot Pipeline ID from GoHighLevel__>"
            },
            {
              "id": "5",
              "name": "nurturePipelineId",
              "type": "string",
              "value": "<__PLACEHOLDER_VALUE__Nurture Pipeline ID from GoHighLevel__>"
            },
            {
              "id": "6",
              "name": "slackChannelName",
              "type": "string",
              "value": "<__PLACEHOLDER_VALUE__Slack channel name (e.g., #sales-alerts)__>"
            },
            {
              "id": "7",
              "name": "calendlyBookingLink",
              "type": "string",
              "value": "<__PLACEHOLDER_VALUE__Your Calendly booking link__>"
            }
          ]
        }
      },
      "typeVersion": 3.4
    },
    {
      "id": "6e8c6bb8-ba0e-4a20-8169-62ec453d87a6",
      "name": "AI Lead Scorer",
      "type": "@n8n/n8n-nodes-langchain.agent",
      "position": [
        688,
        400
      ],
      "parameters": {
        "text": "=Score this lead from 0 to 100 based on the following criteria:\n\nBudget: {{ $(\"Typeform Submission\").item.json.budget }}\nTimeline: {{ $(\"Typeform Submission\").item.json.timeline }}\nBusiness Need: {{ $(\"Typeform Submission\").item.json.business_need }}\n\nScoring guidelines:\n- Budget: Higher budget = higher score (0-40 points)\n- Timeline: Urgent timeline = higher score (0-30 points)\n- Business Need: Clear, specific need = higher score (0-30 points)\n\nDetermine qualification tier:\n- \"hot\" if score > 80\n- \"warm\" if score 50-80\n- \"cold\" if score < 50\n\nProvide a brief reason for the score and create a personalized message for the lead.",
        "options": {
          "systemMessage": "You are a lead qualification expert. Analyze leads based on budget, timeline, and business need. Score them from 0-100 and provide structured output with score, qualification tier, reason, and personalized message."
        },
        "promptType": "define",
        "hasOutputParser": true
      },
      "typeVersion": 3.1
    },
    {
      "id": "e5be7474-c1e2-4541-bd4f-6b8c175bc004",
      "name": "OpenAI Model",
      "type": "@n8n/n8n-nodes-langchain.lmChatOpenAi",
      "position": [
        704,
        624
      ],
      "parameters": {
        "model": {
          "__rl": true,
          "mode": "id",
          "value": "gpt-4o-mini"
        },
        "options": {
          "temperature": 0.2
        },
        "builtInTools": {}
      },
      "typeVersion": 1.3
    },
    {
      "id": "d96ca765-3c62-4284-8a38-664455ee824e",
      "name": "Structured Output Parser",
      "type": "@n8n/n8n-nodes-langchain.outputParserStructured",
      "position": [
        832,
        624
      ],
      "parameters": {
        "jsonSchemaExample": {
          "score": 85,
          "reason": "High budget and urgent timeline indicate strong buying intent",
          "qualification_tier": "hot",
          "personalized_message": "Based on your budget and timeline, I recommend scheduling a call to discuss our enterprise solution."
        }
      },
      "typeVersion": 1.3
    },
    {
      "id": "12d804ed-5249-45f4-84b0-1af2c80c33e4",
      "name": "Check Hot Lead",
      "type": "n8n-nodes-base.if",
      "position": [
        1056,
        400
      ],
      "parameters": {
        "options": {},
        "conditions": {
          "options": {
            "version": 2,
            "leftValue": "",
            "caseSensitive": true,
            "typeValidation": "strict"
          },
          "combinator": "and",
          "conditions": [
            {
              "id": "1",
              "operator": {
                "type": "number",
                "operation": "gt"
              },
              "leftValue": "={{ $json.output.score }}",
              "rightValue": "={{ $(\"Configure Variables\").item.json.hotLeadThreshold }}"
            }
          ]
        }
      },
      "typeVersion": 2.3
    },
    {
      "id": "17ae74cf-30ad-4413-938c-c91f22339e0a",
      "name": "Create Hot Lead Contact",
      "type": "n8n-nodes-base.highLevel",
      "position": [
        1360,
        208
      ],
      "parameters": {
        "email": "={{ $(\"Typeform Submission\").item.json.email }}",
        "phone": "={{ $(\"Typeform Submission\").item.json.phone }}",
        "requestOptions": {},
        "additionalFields": {
          "tags": "hot-lead,typeform",
          "notes": "=AI Score: {{ $(\"AI Lead Scorer\").item.json.output.score }}\nReason: {{ $(\"AI Lead Scorer\").item.json.output.reason }}",
          "lastName": "={{ $(\"Typeform Submission\").item.json.last_name }}",
          "firstName": "={{ $(\"Typeform Submission\").item.json.first_name }}"
        }
      },
      "typeVersion": 2
    },
    {
      "id": "d49d6e9c-4ccc-4fe4-bfb0-bdea2ee5dbec",
      "name": "Assign to Hot Pipeline",
      "type": "n8n-nodes-base.highLevel",
      "position": [
        1600,
        208
      ],
      "parameters": {
        "resource": "opportunity",
        "operation": "update",
        "updateFields": {
          "status": "open",
          "pipelineId": "={{ $(\"Configure Variables\").item.json.hotPipelineId }}"
        },
        "opportunityId": "={{ $json.id }}",
        "requestOptions": {}
      },
      "typeVersion": 2
    },
    {
      "id": "ae5c70e6-6f03-4ea6-b3d7-62db9a405dda",
      "name": "Send Hot Lead Email with Calendly",
      "type": "n8n-nodes-base.gmail",
      "position": [
        1856,
        208
      ],
      "parameters": {
        "sendTo": "={{ $(\"Typeform Submission\").item.json.email }}",
        "message": "=<p>Hi {{ $(\"Typeform Submission\").item.json.first_name }},</p>\n\n<p>Thank you for your interest! Based on your requirements, I'd love to schedule a personalized demo with you.</p>\n\n<p><strong>Book your demo here:</strong> <a href=\"{{ $(\"Configure Variables\").item.json.calendlyBookingLink }}\">{{ $(\"Configure Variables\").item.json.calendlyBookingLink }}</a></p>\n\n<p>Looking forward to speaking with you!</p>\n\n<p>Best regards,<br>Sales Team</p>",
        "options": {},
        "subject": "=Let's Schedule Your Demo - {{ $(\"Typeform Submission\").item.json.first_name }}"
      },
      "typeVersion": 2.2
    },
    {
      "id": "e9c6e085-3d5b-4107-bf9f-f567856ef21b",
      "name": "Notify Hot Lead on Slack",
      "type": "n8n-nodes-base.slack",
      "position": [
        2112,
        208
      ],
      "parameters": {
        "text": "=\ud83d\udd25 Hot Lead Alert",
        "select": "channel",
        "blocksUi": "=[\n  {\n    \"type\": \"header\",\n    \"text\": {\n      \"type\": \"plain_text\",\n      \"text\": \"\ud83d\udd25 Hot Lead Alert - Score: {{ $(\"AI Lead Scorer\").item.json.output.score }}\"\n    }\n  },\n  {\n    \"type\": \"section\",\n    \"fields\": [\n      {\n        \"type\": \"mrkdwn\",\n        \"text\": \"*Name:*\\n{{ $(\"Typeform Submission\").item.json.first_name }} {{ $(\"Typeform Submission\").item.json.last_name }}\"\n      },\n      {\n        \"type\": \"mrkdwn\",\n        \"text\": \"*Email:*\\n{{ $(\"Typeform Submission\").item.json.email }}\"\n      },\n      {\n        \"type\": \"mrkdwn\",\n        \"text\": \"*Budget:*\\n{{ $(\"Typeform Submission\").item.json.budget }}\"\n      },\n      {\n        \"type\": \"mrkdwn\",\n        \"text\": \"*Timeline:*\\n{{ $(\"Typeform Submission\").item.json.timeline }}\"\n      }\n    ]\n  },\n  {\n    \"type\": \"section\",\n    \"text\": {\n      \"type\": \"mrkdwn\",\n      \"text\": \"*Reason:*\\n{{ $(\"AI Lead Scorer\").item.json.output.reason }}\"\n    }\n  }\n]",
        "channelId": {
          "__rl": true,
          "mode": "name",
          "value": "={{ $(\"Configure Variables\").item.json.slackChannelName }}"
        },
        "messageType": "block",
        "otherOptions": {}
      },
      "typeVersion": 2.4
    },
    {
      "id": "3a52123a-a25f-4c78-8762-007bbefd1625",
      "name": "Check Warm Lead",
      "type": "n8n-nodes-base.if",
      "position": [
        1088,
        640
      ],
      "parameters": {
        "options": {},
        "conditions": {
          "options": {
            "version": 2,
            "leftValue": "",
            "caseSensitive": true,
            "typeValidation": "strict"
          },
          "combinator": "and",
          "conditions": [
            {
              "id": "1",
              "operator": {
                "type": "number",
                "operation": "gt"
              },
              "leftValue": "={{ $json.output.score }}",
              "rightValue": "={{ $(\"Configure Variables\").item.json.warmLeadThreshold }}"
            }
          ]
        }
      },
      "typeVersion": 2.3
    },
    {
      "id": "96b1b4ae-2a1e-45ad-ae11-c8a47f229df5",
      "name": "Create Warm Lead Contact",
      "type": "n8n-nodes-base.highLevel",
      "position": [
        1344,
        560
      ],
      "parameters": {
        "email": "={{ $(\"Typeform Submission\").item.json.email }}",
        "phone": "={{ $(\"Typeform Submission\").item.json.phone }}",
        "requestOptions": {},
        "additionalFields": {
          "tags": "warm-lead,typeform",
          "notes": "=AI Score: {{ $(\"AI Lead Scorer\").item.json.output.score }}\nReason: {{ $(\"AI Lead Scorer\").item.json.output.reason }}",
          "lastName": "={{ $(\"Typeform Submission\").item.json.last_name }}",
          "firstName": "={{ $(\"Typeform Submission\").item.json.first_name }}"
        }
      },
      "typeVersion": 2
    },
    {
      "id": "5ef1ba13-12aa-4f26-9226-cc93a711b1a1",
      "name": "Assign to Nurture Pipeline",
      "type": "n8n-nodes-base.highLevel",
      "position": [
        1584,
        560
      ],
      "parameters": {
        "resource": "opportunity",
        "operation": "update",
        "updateFields": {
          "status": "open",
          "pipelineId": "={{ $(\"Configure Variables\").item.json.nurturePipelineId }}"
        },
        "opportunityId": "={{ $json.id }}",
        "requestOptions": {}
      },
      "typeVersion": 2
    },
    {
      "id": "4bf5dcb2-8ffe-421d-ad7d-a10dd26a8e77",
      "name": "Send Warm Lead Personalized Email",
      "type": "n8n-nodes-base.gmail",
      "position": [
        1808,
        560
      ],
      "parameters": {
        "sendTo": "={{ $(\"Typeform Submission\").item.json.email }}",
        "message": "=<p>Hi {{ $(\"Typeform Submission\").item.json.first_name }},</p>\n\n<p>{{ $(\"AI Lead Scorer\").item.json.output.personalized_message }}</p>\n\n<p>I'll follow up with you in a couple of days with more information tailored to your needs.</p>\n\n<p>Best regards,<br>Sales Team</p>",
        "options": {},
        "subject": "=Thank You for Your Interest - {{ $(\"Typeform Submission\").item.json.first_name }}"
      },
      "typeVersion": 2.2
    },
    {
      "id": "bfaf751e-135f-42e6-b809-ca6d6e4d3cef",
      "name": "Wait 48 Hours",
      "type": "n8n-nodes-base.wait",
      "position": [
        2016,
        560
      ],
      "parameters": {
        "unit": "hours",
        "amount": 48
      },
      "typeVersion": 1.1
    },
    {
      "id": "de19fc80-eacf-40e2-8821-bea31f00a781",
      "name": "Send Warm Lead Follow-Up Email",
      "type": "n8n-nodes-base.gmail",
      "position": [
        2224,
        560
      ],
      "parameters": {
        "sendTo": "={{ $(\"Typeform Submission\").item.json.email }}",
        "message": "=<p>Hi {{ $(\"Typeform Submission\").item.json.first_name }},</p>\n\n<p>I wanted to follow up on my previous email. Have you had a chance to review our solution?</p>\n\n<p>I'd be happy to answer any questions you might have or schedule a brief call to discuss how we can help with {{ $(\"Typeform Submission\").item.json.business_need }}.</p>\n\n<p>Best regards,<br>Sales Team</p>",
        "options": {},
        "subject": "=Following Up - {{ $(\"Typeform Submission\").item.json.first_name }}"
      },
      "typeVersion": 2.2
    },
    {
      "id": "89d406b6-7333-481c-a8c5-66c317eec188",
      "name": "Create Cold Lead Contact",
      "type": "n8n-nodes-base.highLevel",
      "position": [
        1344,
        976
      ],
      "parameters": {
        "email": "={{ $(\"Typeform Submission\").item.json.email }}",
        "phone": "={{ $(\"Typeform Submission\").item.json.phone }}",
        "requestOptions": {},
        "additionalFields": {
          "tags": "cold-lead,typeform",
          "notes": "=AI Score: {{ $(\"AI Lead Scorer\").item.json.output.score }}\nReason: {{ $(\"AI Lead Scorer\").item.json.output.reason }}",
          "lastName": "={{ $(\"Typeform Submission\").item.json.last_name }}",
          "firstName": "={{ $(\"Typeform Submission\").item.json.first_name }}"
        }
      },
      "typeVersion": 2
    },
    {
      "id": "cd218b77-c208-4472-9418-635af90a2484",
      "name": "Notify Cold Lead on Slack",
      "type": "n8n-nodes-base.slack",
      "position": [
        1568,
        976
      ],
      "parameters": {
        "text": "=\u2744\ufe0f Cold Lead Notification",
        "select": "channel",
        "blocksUi": "=[\n  {\n    \"type\": \"header\",\n    \"text\": {\n      \"type\": \"plain_text\",\n      \"text\": \"\u2744\ufe0f Cold Lead - Score: {{ $(\"AI Lead Scorer\").item.json.output.score }}\"\n    }\n  },\n  {\n    \"type\": \"section\",\n    \"fields\": [\n      {\n        \"type\": \"mrkdwn\",\n        \"text\": \"*Name:*\\n{{ $(\"Typeform Submission\").item.json.first_name }} {{ $(\"Typeform Submission\").item.json.last_name }}\"\n      },\n      {\n        \"type\": \"mrkdwn\",\n        \"text\": \"*Email:*\\n{{ $(\"Typeform Submission\").item.json.email }}\"\n      }\n    ]\n  },\n  {\n    \"type\": \"section\",\n    \"text\": {\n      \"type\": \"mrkdwn\",\n      \"text\": \"*Reason:*\\n{{ $(\"AI Lead Scorer\").item.json.output.reason }}\"\n    }\n  }\n]",
        "channelId": {
          "__rl": true,
          "mode": "name",
          "value": "={{ $(\"Configure Variables\").item.json.slackChannelName }}"
        },
        "messageType": "block",
        "otherOptions": {}
      },
      "typeVersion": 2.4
    },
    {
      "id": "4e157129-c077-4859-9487-95015c06872f",
      "name": "Sticky Note",
      "type": "n8n-nodes-base.stickyNote",
      "position": [
        176,
        -416
      ],
      "parameters": {
        "color": "#FFF995",
        "width": 992,
        "height": 560,
        "content": "## Qualify, nurture and book appointments from Typeform leads using AI, GoHighLevel and Calendly\n\n### How it works\nWhen a lead submits your Typeform, OpenAI scores them 0-100 based on budget, timeline, and business need. Hot leads above 80 instantly receive a Calendly booking link and trigger a Slack alert. Warm leads above 50 are added to a nurture pipeline and receive a personalized email followed by an automated 48-hour follow-up. Cold leads are tagged and logged in GoHighLevel with a Slack notification. All three tiers are created as contacts in GoHighLevel automatically.\n\n### Setup\n1. Update all variables in the Configure Variables node\n2. Connect your Typeform account and select your form\n3. Add your OpenAI API credentials\n4. Add your GoHighLevel API credentials and Pipeline IDs\n5. Connect Gmail for all outbound emails\n6. Connect Slack and set your channel name\n7. Add your Calendly booking link to the Configure Variables node\n8. Activate the workflow\n\n### Customization\n- Adjust hot and warm score thresholds in the Configure Variables node\n- Modify the AI scoring criteria in the AI Lead Scorer prompt\n- Add SMS notifications via Twilio for hot leads\n- Replace the 48 hour wait with any delay that suits your sales cycle"
      },
      "typeVersion": 1
    },
    {
      "id": "aa61516b-98d1-4b8f-af78-2e88ac9eac74",
      "name": "Sticky Note1",
      "type": "n8n-nodes-base.stickyNote",
      "position": [
        192,
        288
      ],
      "parameters": {
        "color": "#AAAAAA",
        "width": 1040,
        "height": 480,
        "content": "## 1. Capture & Score\nTypeform triggers the workflow. Variables are configured here. OpenAI scores the lead 0-100."
      },
      "typeVersion": 1
    },
    {
      "id": "36deb7c4-0494-4fec-9060-83ef7f20f27b",
      "name": "Sticky Note2",
      "type": "n8n-nodes-base.stickyNote",
      "position": [
        1296,
        96
      ],
      "parameters": {
        "color": "#AAAAAA",
        "width": 1008,
        "height": 256,
        "content": "## 2. Hot Leads 80+\nContact created in GHL hot pipeline. Calendly link sent instantly. Slack alert fired."
      },
      "typeVersion": 1
    },
    {
      "id": "9161ef59-b84a-45f0-b80e-94e81a27699c",
      "name": "Sticky Note3",
      "type": "n8n-nodes-base.stickyNote",
      "position": [
        1296,
        448
      ],
      "parameters": {
        "color": "#AAAAAA",
        "width": 1104,
        "height": 272,
        "content": "## 3. Warm Leads 50-79\nContact added to nurture pipeline. Personalized email sent. 48-hour follow-up automated."
      },
      "typeVersion": 1
    },
    {
      "id": "31eff39e-6ca5-4c34-a894-97815098ae2c",
      "name": "Sticky Note4",
      "type": "n8n-nodes-base.stickyNote",
      "position": [
        1296,
        880
      ],
      "parameters": {
        "color": "#AAAAAA",
        "width": 528,
        "height": 256,
        "content": "## 4. Cold Leads Below 50\nContact tagged cold in GHL. Slack notification sent with score and reason."
      },
      "typeVersion": 1
    }
  ],
  "active": false,
  "settings": {
    "binaryMode": "separate",
    "executionOrder": "v1"
  },
  "versionId": "2a75152d-626c-46a5-a4a3-e6bf3c1099d1",
  "connections": {
    "OpenAI Model": {
      "ai_languageModel": [
        [
          {
            "node": "AI Lead Scorer",
            "type": "ai_languageModel",
            "index": 0
          }
        ]
      ]
    },
    "Wait 48 Hours": {
      "main": [
        [
          {
            "node": "Send Warm Lead Follow-Up Email",
            "type": "main",
            "index": 0
          }
        ]
      ]
    },
    "AI Lead Scorer": {
      "main": [
        [
          {
            "node": "Check Hot Lead",
            "type": "main",
            "index": 0
          }
        ]
      ]
    },
    "Check Hot Lead": {
      "main": [
        [
          {
            "node": "Create Hot Lead Contact",
            "type": "main",
            "index": 0
          }
        ],
        [
          {
            "node": "Check Warm Lead",
            "type": "main",
            "index": 0
          }
        ]
      ]
    },
    "Check Warm Lead": {
      "main": [
        [
          {
            "node": "Create Warm Lead Contact",
            "type": "main",
            "index": 0
          }
        ],
        [
          {
            "node": "Create Cold Lead Contact",
            "type": "main",
            "index": 0
          }
        ]
      ]
    },
    "Configure Variables": {
      "main": [
        [
          {
            "node": "AI Lead Scorer",
            "type": "main",
            "index": 0
          }
        ]
      ]
    },
    "Typeform Submission": {
      "main": [
        [
          {
            "node": "Configure Variables",
            "type": "main",
            "index": 0
          }
        ]
      ]
    },
    "Assign to Hot Pipeline": {
      "main": [
        [
          {
            "node": "Send Hot Lead Email with Calendly",
            "type": "main",
            "index": 0
          }
        ]
      ]
    },
    "Create Hot Lead Contact": {
      "main": [
        [
          {
            "node": "Assign to Hot Pipeline",
            "type": "main",
            "index": 0
          }
        ]
      ]
    },
    "Create Cold Lead Contact": {
      "main": [
        [
          {
            "node": "Notify Cold Lead on Slack",
            "type": "main",
            "index": 0
          }
        ]
      ]
    },
    "Create Warm Lead Contact": {
      "main": [
        [
          {
            "node": "Assign to Nurture Pipeline",
            "type": "main",
            "index": 0
          }
        ]
      ]
    },
    "Structured Output Parser": {
      "ai_outputParser": [
        [
          {
            "node": "AI Lead Scorer",
            "type": "ai_outputParser",
            "index": 0
          }
        ]
      ]
    },
    "Assign to Nurture Pipeline": {
      "main": [
        [
          {
            "node": "Send Warm Lead Personalized Email",
            "type": "main",
            "index": 0
          }
        ]
      ]
    },
    "Send Hot Lead Email with Calendly": {
      "main": [
        [
          {
            "node": "Notify Hot Lead on Slack",
            "type": "main",
            "index": 0
          }
        ]
      ]
    },
    "Send Warm Lead Personalized Email": {
      "main": [
        [
          {
            "node": "Wait 48 Hours",
            "type": "main",
            "index": 0
          }
        ]
      ]
    }
  }
}