Tutorial: Lead Routing

Build a workflow that automatically classifies inbound leads by quality and routes them to the right sales team. High-value leads get an instant Slack alert; all leads get logged to a Google Sheet with their AI-assigned tier.

What you'll build

Form Submission → TinyGPT (classify lead) → If-Else (check tier) →
  Enterprise: Slack (#enterprise-leads) + Google Sheets (hot leads)
  Mid-market: Google Sheets (nurture list)
  SMB: Google Sheets (self-serve list)

Time to build: 15-20 minutes

Prerequisites

  • A published TinyForm (or any form; we'll use a webhook trigger as alternative)
  • Slack workspace connected in Build → App Authorizations
  • Google Sheets connection set up
  • A Google Sheet with columns: Name, Email, Company, Tier, Score, Reasoning, Date

Step 1: Set up the trigger

Option A: Form Submission trigger

  1. Create a new workflow and click + Add Trigger
  2. Select Form Submission
  3. Choose your contact/demo request form from the dropdown
  4. The trigger outputs all form fields as variables

Option B: Webhook trigger (if no form yet)

  1. Select Webhook as your trigger
  2. Copy the webhook URL
  3. Use this test payload structure:
{
  "name": "Sarah Chen",
  "email": "sarah@acmecorp.com",
  "company": "Acme Corp",
  "company_size": "500",
  "message": "Looking for an automation platform for our sales team. We process about 10,000 leads per month and need AI classification.",
  "budget": "50K+"
}
  1. Send a test request to populate the trigger output

Step 2: Add the TinyGPT classifier

  1. Click + Add NodeAITinyGPT
  2. On the Initialise tab, select the Classify & Categorize template → Continue
  3. On the Configure tab, set:

System Prompt:

You are a B2B lead qualification expert. Classify inbound leads into tiers based on company size, budget, use case complexity, and buying signals.

Tier definitions:
- ENTERPRISE: 500+ employees OR budget over 50K OR complex multi-department use case
- MID_MARKET: 50-499 employees OR budget 10K-50K OR single-department use case
- SMB: Under 50 employees OR budget under 10K OR individual/freelancer

Score from 0-100 based on likelihood to convert. Look for urgency signals, specific pain points, and clear budget indication.

Query:

Classify this lead:
Name: {{trigger.body.name}}
Company: {{trigger.body.company}}
Company size: {{trigger.body.company_size}}
Budget: {{trigger.body.budget}}
Message: {{trigger.body.message}}

Output Schema:

{
  "tier": "ENTERPRISE",
  "score": 85,
  "reasoning": "500+ employees, 50K+ budget, clear automation need with volume (10K leads/month)",
  "urgency": "HIGH",
  "recommended_action": "Schedule demo within 24 hours"
}
  1. Set Temperature to 0.2 (we want consistent classification, not creative output)
  2. Go to the Test tab and run; verify the classification makes sense
  3. Click Save

Step 3: Add the If-Else router

  1. Click + Add NodeFlow ControlIf-Else
  2. On the Configure tab, set the condition:

Condition: {{tinygpt.result.tier}} equals ENTERPRISE

  1. This creates two branches: True (enterprise) and False (everything else)
  2. Save the node

Step 4: Enterprise branch (Slack alert)

On the True branch:

  1. Click + Add NodeIntegrationsSlackSend Message
  2. Configure:
FieldValue
ConnectionSelect your Slack workspace
Channel#enterprise-leads
MessageSee below

Message:

:fire: *New Enterprise Lead*

*Name:* {{trigger.body.name}}
*Company:* {{trigger.body.company}} ({{trigger.body.company_size}} employees)
*Email:* {{trigger.body.email}}

*AI Classification:*
- Tier: {{tinygpt.result.tier}}
- Score: {{tinygpt.result.score}}/100
- Urgency: {{tinygpt.result.urgency}}

*Reasoning:* {{tinygpt.result.reasoning}}
*Recommended:* {{tinygpt.result.recommended_action}}

_Respond within 1 hour for best conversion._
  1. Test and save

Step 5: Enterprise branch (Log to Google Sheets)

Still on the True branch, after the Slack node:

  1. Click + Add NodeIntegrationsGoogle SheetsAppend Row
  2. Configure:
FieldValue
ConnectionYour Google account
SpreadsheetSelect your lead tracking sheet
Sheet"Hot Leads" (or Sheet1)

Column mapping:

ColumnValue
Name{{trigger.body.name}}
Email{{trigger.body.email}}
Company{{trigger.body.company}}
Tier{{tinygpt.result.tier}}
Score{{tinygpt.result.score}}
Reasoning{{tinygpt.result.reasoning}}
Date{{NOW()}}
  1. Test and save

Step 6: Non-enterprise branch (secondary routing)

On the False branch (mid-market and SMB leads):

  1. Add another If-Else node
  2. Condition: {{tinygpt.result.tier}} equals MID_MARKET

Mid-market (True branch)

Add a Google Sheets → Append Row node logging to a "Nurture List" sheet with the same column mapping.

SMB (False branch)

Add a Google Sheets → Append Row node logging to a "Self-Serve" sheet.

Step 7: Test the complete workflow

  1. Click Run in the top bar
  2. Send test data through your form or webhook with different scenarios:
    • Enterprise lead (large company, big budget)
    • Mid-market lead (medium company)
    • SMB lead (small team, low budget)
  3. Verify:
    • Enterprise leads trigger a Slack message AND appear in the hot leads sheet
    • Mid-market leads appear in the nurture sheet
    • SMB leads appear in the self-serve sheet
    • AI scores and reasoning are sensible

Step 8: Publish

Once testing passes:

  1. Click Publish in the top bar
  2. The workflow is now live and will process every new form submission automatically

Going further

  • Add email confirmation: Add a Send Email node after each branch to send the lead an auto-response tailored to their tier
  • Add enrichment: Insert a Company Enrichment node before TinyGPT to pull company data from public sources; this gives the AI more context for better classification
  • Add CRM sync: Replace or supplement Google Sheets with a HubSpot or Salesforce node to create contacts directly in your CRM
  • Add scoring threshold: Use the score field with a numeric If-Else (score > 90) to identify "hot" leads that need immediate outreach vs. leads that can wait
  • Add Slack thread follow-up: Use the Slack message timestamp output to post follow-up updates in the same thread when the lead responds
Note

This workflow costs 10 credits per execution (one TinyGPT classification). At 100 leads/day, that's 1,000 credits/day. Monitor usage in Monitor → Credit Usage.