ID
Scenario
Input
Expected Output
Pass Criteria
T01
Happy path: new Typeform submission, no existing HubSpot contact, high-score lead
Typeform webhook payload: name, company (50+ employees), email (not in HubSpot), source=typeform, interest=Enterprise plan
Deduplicated record confirmed as new; numeric score >= 80; tag = Hot; enriched record passed to routing agent
Score value >= 80, tag field = 'Hot', no duplicate contact created in sandbox HubSpot, output payload well-formed
T02
Happy path: Gmail inbound alias lead, mid-score
Parsed inbound email payload: name, company (10 employees), email (not in HubSpot), source=gmail-alias, interest=Standard plan
New record created; score between 40 and 79; tag = Warm
Score in range 40-79, tag = 'Warm', source field = 'gmail-alias', no error thrown
T03
Happy path: webhook lead, low score
Ad platform webhook payload: name only, no company size data, email (not in HubSpot), source=ad-webhook, interest=unspecified
New record created; score < 40; tag = Low Priority; human review flag set to true
Score < 40, tag = 'Low Priority', human_review_required = true, record passed to routing agent with flag
T04
Duplicate detection: existing HubSpot contact matched by email
Typeform payload with email matching an existing sandbox HubSpot contact
Agent identifies duplicate; updates existing record with new form data; does not create second contact; log entry notes merge
No new contact created; existing contact updated; merge_event = true in output payload; no error thrown
T05
Duplicate detection: existing HubSpot contact matched by phone only (email differs)
Inbound payload with new email but matching phone number to existing sandbox contact
Agent flags potential duplicate; creates new contact but attaches a duplicate-warning note to both records
New contact created with duplicate_warning = true; note appended to both records; no silent data loss
T06
Failure mode: Typeform webhook payload missing required email field
Typeform webhook payload with email field null or absent
Agent halts enrichment; writes error to automation platform error log; does not create a partial HubSpot contact; alert raised
No contact written to HubSpot; error log entry contains field_missing='email' and timestamp; downstream agents not triggered
T07
Failure mode: HubSpot sandbox API returns 429 rate-limit response during deduplication lookup
Valid Typeform payload submitted while HubSpot sandbox API is throttled (simulated via mock 429 response)
Agent retries with exponential back-off (3 attempts, 2s/4s/8s intervals); if all retries fail, lead is written to a holding queue and an alert is fired
Retry attempts logged; after third failure, holding_queue_entry = true; no silent drop; alert observable in platform error log
ID
Scenario
Input
Expected Output
Pass Criteria
T08
Happy path: Hot lead routed to correct territory rep with lowest current workload
Scored record: tag=Hot, territory=West, available reps: Rep A (3 open tasks), Rep B (7 open tasks)
Contact assigned to Rep A in HubSpot; follow-up task created with due date = today + 1 business hour; Slack message sent to Rep A
HubSpot contact owner = Rep A; task due_date correct; Slack message delivered to Rep A's sandbox channel; message includes score, source, and HubSpot link
T09
Happy path: Warm lead routed with 24-hour follow-up task
Scored record: tag=Warm, territory=East, rep available
Contact assigned to correct East rep; task due = today + 24 hours; Slack alert sent
Task due date = now + 24h (within 1 minute tolerance); Slack message tone matches Warm priority template
T10
Low Priority lead: human review flag triggers routing hold
Scored record: tag=Low Priority, human_review_required=true
Contact NOT auto-assigned; record placed in Low Priority review queue; Slack message sent to Sales Coordinator channel (not a rep channel) requesting review
No rep assigned in HubSpot; review_queue = true on record; Slack notification delivered to coordinator channel, not rep channel
T11
Gmail acknowledgement email sent within 2 minutes of trigger
Hot lead record passed to routing agent at timestamp T; agent completes routing
Personalised Gmail acknowledgement sent to prospect email address; email timestamp <= T + 120 seconds
Email received in sandbox test inbox; timestamp delta <= 120 seconds; subject line and first name personalisation fields populated correctly
T12
Failure mode: no eligible rep available in territory (all reps at capacity cap)
Hot lead, territory=North, all North reps at or above maximum task threshold
Agent escalates: assigns to Sales Manager as fallback owner; Slack alert sent to manager channel flagging capacity issue; task created with escalation note
HubSpot owner = Sales Manager; escalation_flag = true; Slack message delivered to manager channel; no lead silently dropped