Workflow code
Copy this code to understand the workflow logic. Replace all API keys and credentials with your own before running.
// Lead qualification workflow
// Node 1: Webhook — receives form data
// Node 2: HTTP → Hunter.io — verify email
// Node 3: HTTP → Clearbit — enrich company data
// Node 4: Claude — score and qualify lead
const qualificationPrompt = `
Score this lead from 0-100 and classify as Hot/Warm/Cold.
Lead data:
- Name: ${name}
- Company: ${company}
- Role: ${role}
- Message: ${message}
- Company size: ${companyData.employees}
- Industry: ${companyData.industry}
- Revenue: ${companyData.revenue}
Return JSON: { score: number, classification: "Hot|Warm|Cold", reasoning: string, suggestedFollowUp: string }
`
// Node 5: Switch — route by classification
// Hot → Node 6: Instant Slack alert to sales team
// Warm → Node 7: Add to 3-day email sequence
// Cold → Node 8: Add to newsletter only
// Node 9: HubSpot — create/update contact
// Node 10: Send personalised email (based on Claude's suggestion)