Integration tests verify that data passes correctly across the full agent handoff chain and that each connected tool receives and processes the expected payload. All IDs continue the T sequence from Phase 1.
ID
Scenario
Input
Expected output
Pass criteria
T15
Segment to HubSpot to Offer Selection Agent full handoff
Valid Segment event fires; HubSpot fetch succeeds; payload passed to Offer Selection Agent
Offer Selection Agent receives complete payload including spend_tier, product_usage_signal, and account_segment
Agent execution log shows all three fields present on receipt; no data loss between steps
T16
Offer Selection Agent to Outreach Drafting Agent handoff
Offer Selection Agent returns { offer_name: 'Pro Plan Upgrade', rationale: '...' }
Outreach Drafting Agent receives offer_name and rationale and uses both in draft
Both fields referenced in generated draft; no null tokens; agent execution sequence confirmed in log
T17
Auto-send path: Outreach Drafting Agent through to Google Sheets append
Standard account, high_value_flag: false, full draft generated
Gmail send confirmed; HubSpot activity logged; Slack posted; Google Sheets row appended with customer, offer, date, account_owner
All four downstream actions confirmed in execution log; Google Sheets row present and correctly formatted
T18
High-value routing path: draft queued, rep approves, send fires
high_value_flag: true, rep approves draft in review queue within session
Gmail send fires after rep approval; HubSpot log created post-approval; Slack alert references approval event
Gmail send timestamp is after approval event timestamp; HubSpot log references rep approval; no premature send
T19
HubSpot activity log entry format validation
Auto-send path completed for sandbox customer record
HubSpot activity record contains: activity_type: 'upsell_outreach', offer_name, trigger_event_type, send_timestamp (ISO 8601)
All four fields present; timestamp format valid; activity type matches defined enum in HubSpot property schema
T20
Slack notification content and delivery
Send completed for sandbox account owned by 'Rachel Kim' in sandbox Slack workspace
Slack message delivered to correct channel; message contains offer_name and HubSpot record URL
Message received in sandbox channel; offer_name matches sent offer; URL resolves to correct HubSpot sandbox record
T21
Google Sheets append: correct column mapping
Completed run for sandbox customer 'Acme Corp', offer 'Pro Plan Upgrade', account_owner 'Rachel Kim'
New row in tracking sheet: Column A = customer name, Column B = offer, Column C = send date (YYYY-MM-DD), Column D = account owner
Row present; all four columns populated correctly; no row appended to wrong sheet tab
T22
End-to-end latency benchmark
Valid Segment event fired at T+0 in sandbox
Gmail send or review queue entry created within 90 seconds of trigger
Execution log timestamps show total elapsed time under 90 seconds from trigger receipt to send or queue entry
Edge case tests cover failure modes, data anomalies, and timeout scenarios that could occur under real traffic conditions.
ID
Scenario
Input
Expected output
Pass criteria
E01
Duplicate Segment event for the same customer within 24 hours
Two identical upsell_trigger_fired events for cust_sandbox_001 fired 10 minutes apart
Second event detected as duplicate; suppressed; no second email drafted or sent; deduplication log entry created
Only one execution proceeds; dedup log shows suppression of second event; single HubSpot activity entry
E02
HubSpot record exists but account is marked churned or closed
HubSpot contact fetched; lifecycle_stage: 'churned'
Workflow halts after CRM fetch; no offer selected; no email sent; suppression logged
Execution stops at eligibility check; suppression record created; no downstream agents fire
E03
Offer catalogue in Google Sheets is empty or unreachable
Offer Selection Agent attempts to read Google Sheets; sheet returns 0 rows or HTTP 503
Agent returns CATALOGUE_UNAVAILABLE; workflow halts; FullSpec team alerted via internal error channel
No offer passed downstream; error logged with timestamp; alert delivered
E04
Outreach Drafting Agent produces draft exceeding 400 words
Agent generates a draft of 520 words due to verbose account context
Draft is automatically truncated to 400 words with an ellipsis appended; flag logged: DRAFT_TRUNCATED
Sent draft is 400 words or fewer; DRAFT_TRUNCATED flag present; no content after ellipsis is sent
E05
Slack API unavailable when notification is attempted
Slack API returns HTTP 503 at notification step
Notification failure logged; workflow does not halt; email send and HubSpot log complete as normal; retry attempted after 5 minutes
Gmail send and HubSpot log confirmed despite Slack failure; retry log entry present; no workflow halt
E06
High-value account in review queue not actioned within 48 hours
Draft queued for rep review; no action taken for 48 hours
Escalation Slack alert sent to sales manager; draft remains in queue; no auto-send triggered; timeout logged
Escalation message delivered to manager channel at T+48h; draft not sent; timeout entry in execution log