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
- Create a new workflow and click + Add Trigger
- Select Form Submission
- Choose your contact/demo request form from the dropdown
- The trigger outputs all form fields as variables
Option B: Webhook trigger (if no form yet)
- Select Webhook as your trigger
- Copy the webhook URL
- 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+"
}
- Send a test request to populate the trigger output
Step 2: Add the TinyGPT classifier
- Click + Add Node → AI → TinyGPT
- On the Initialise tab, select the Classify & Categorize template → Continue
- 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"
}
- Set Temperature to
0.2(we want consistent classification, not creative output) - Go to the Test tab and run; verify the classification makes sense
- Click Save
Step 3: Add the If-Else router
- Click + Add Node → Flow Control → If-Else
- On the Configure tab, set the condition:
Condition: {{tinygpt.result.tier}} equals ENTERPRISE
- This creates two branches: True (enterprise) and False (everything else)
- Save the node
Step 4: Enterprise branch (Slack alert)
On the True branch:
- Click + Add Node → Integrations → Slack → Send Message
- Configure:
| Field | Value |
|---|---|
| Connection | Select your Slack workspace |
| Channel | #enterprise-leads |
| Message | See 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._
- Test and save
Step 5: Enterprise branch (Log to Google Sheets)
Still on the True branch, after the Slack node:
- Click + Add Node → Integrations → Google Sheets → Append Row
- Configure:
| Field | Value |
|---|---|
| Connection | Your Google account |
| Spreadsheet | Select your lead tracking sheet |
| Sheet | "Hot Leads" (or Sheet1) |
Column mapping:
| Column | Value |
|---|---|
| Name | {{trigger.body.name}} |
{{trigger.body.email}} | |
| Company | {{trigger.body.company}} |
| Tier | {{tinygpt.result.tier}} |
| Score | {{tinygpt.result.score}} |
| Reasoning | {{tinygpt.result.reasoning}} |
| Date | {{NOW()}} |
- Test and save
Step 6: Non-enterprise branch (secondary routing)
On the False branch (mid-market and SMB leads):
- Add another If-Else node
- Condition:
{{tinygpt.result.tier}}equalsMID_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
- Click Run in the top bar
- 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)
- 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:
- Click Publish in the top bar
- 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
scorefield 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
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.