Integration tests verify that data flows correctly across agent boundaries and that each tool receives the expected payload shape from the previous step in the workflow.
ID
Scenario
Agents / Tools Involved
Expected Output
Pass Criteria
T16
Notion brief triggers Research Agent and Sheet is correctly seeded for Drafting Agent
Notion webhook to Research Agent to Google Sheets
Sheet rows written with all fields required by Pitch Drafting Agent: name, handle, niche, email, brief_id
Drafting Agent reads Sheet without schema error; all required columns present and non-null for valid rows
T17
Research Agent Hunter.io result passes verified email to Drafting Agent
Hunter.io lookup result to Google Sheets to Pitch Drafting Agent
Only rows with verification_status 'valid' are passed downstream; 'email not found' rows are excluded from draft creation
Draft count equals verified-email row count; excluded rows logged; no draft created for unverified rows
T18
Pitch Drafting Agent HubSpot contact record consumed correctly by Follow-Up Agent
HubSpot contact with 'draft' status from Drafting Agent; status updated to 'email sent' externally
Follow-Up Agent triggers on status change to 'email sent'; enrolment sequence starts for correct contact ID
Follow-Up Agent enrols the matching HubSpot contact ID; no cross-contact enrolment; send timestamp carried correctly
T19
End-to-end handoff: all three agents complete a single prospect cycle in sandbox
Full sandbox run: Notion trigger through to Slack alert for one prospect
Google Sheet row written, Gmail draft created, HubSpot contact created, follow-up sequence enrolled, Slack alert fired on simulated reply
All five output artefacts present; data consistent across all tools (same prospect name, email, campaign tag in every system)
T20
Gmail draft status change (approved) correctly triggers send step
Gmail draft approval event to orchestration layer to Gmail send API
Approved draft sent via Gmail; send timestamp written to HubSpot contact record and Google Sheet
Draft no longer in drafts folder; sent item present; HubSpot send_timestamp field populated; Sheet status updated to 'sent'
T21
Batch of 10 prospects completes full Research-to-Draft cycle within acceptable time
Notion brief with 10 qualifying prospects; sandbox APIs respond at normal latency
All 10 Sheet rows written and 10 Gmail drafts created within 4 minutes of trigger
Completion time under 4 minutes; all 10 drafts present; no timeout errors in orchestration log
T22
Follow-up sequence day-4 email dispatches at correct interval
Sandbox contact enrolled in sequence with send_timestamp set to 4 days prior in test data
Follow-up email 1 dispatched via Gmail; HubSpot activity log updated; sequence remains active for day-9 email
Follow-up 1 sent email present in sandbox sent items; HubSpot activity entry dated correctly; sequence not cancelled prematurely
T23
Follow-up sequence day-9 email dispatches and sequence closes
Sandbox contact with follow-up 1 already sent; day-9 interval elapsed in test data
Follow-up email 2 dispatched; sequence closed; HubSpot deal stage updated to 'no response'
Follow-up 2 sent email present; HubSpot deal stage is 'no response'; sequence shows as completed, not active
T24
Reply received between follow-up 1 and follow-up 2 cancels remaining sequence
Inbound reply event fires after follow-up 1 sent but before follow-up 2 dispatch time
Follow-up 2 not sent; HubSpot deal stage updated to 'replied'; Slack alert posted
Zero follow-up 2 emails in sandbox sent items; deal stage updated; Slack payload present with correct contact details
Edge case tests cover inputs and conditions that fall outside the normal happy path, including data quality problems, missing values, tool unavailability, and human timeout scenarios.
ID
Scenario
Condition
Expected Handling
Pass Criteria
E01
Duplicate prospect submitted in same campaign batch
Notion brief triggers Research Agent with a prospect handle already present in the Sheet for the same campaign_id
Agent detects duplicate by handle + campaign_id composite key; skips second write; logs 'duplicate skipped' with row reference
No duplicate Sheet row; no duplicate HubSpot contact; skip event in log with handle and campaign_id
E02
Prospect row missing niche field when Drafting Agent reads Sheet
Sheet row with name, email, handle present but niche column blank
Drafting Agent uses fallback niche label 'content creator' in draft body; flags row in Sheet as 'niche missing, fallback used'; draft still created
Draft created and present in Gmail; body contains fallback label; Sheet row has warning flag in status column
E03
Hunter.io API returns rate limit error (429) mid-batch
Hunter.io sandbox stub returns 429 after the 5th lookup request in a batch of 10
Orchestration layer pauses lookups for 60 seconds; resumes from the 6th row; completes remaining 5 lookups successfully
No rows skipped due to rate limit; pause event logged with timestamp; total batch completes with all 10 rows having a lookup result
E04
Notion webhook fires with an empty brief (no criteria populated)
Webhook payload with campaign_id but all criteria fields null or empty strings
Validation step halts workflow immediately; error written to orchestration log: 'Brief incomplete, workflow aborted'; no downstream steps triggered
Zero Sheet rows written; zero HubSpot records created; error log entry present with campaign_id and field list
E05
HubSpot API unavailable for 5 minutes during contact creation
HubSpot sandbox returns 503 Service Unavailable for all requests during a 5-minute window
Orchestration layer queues contact creation tasks with exponential backoff; retries automatically once HubSpot recovers; no data lost
All contacts eventually created after HubSpot recovery; retry log shows backoff intervals; no duplicate contacts from retry storm
E06
Gmail draft sits unreviewed for more than 72 hours
Draft created timestamp is more than 72 hours old with no approval or rejection action recorded
Orchestration layer sends a Slack reminder to the marketing channel with draft count and oldest draft age; no email sent without approval
Slack reminder message appears in marketing channel with correct draft count; no pitch emails dispatched; draft remains in Gmail drafts
E07
Prospect replies in a language other than English
Inbound reply detected by Follow-Up Agent; reply body is in a non-English language
Sequence cancelled correctly; deal stage updated to 'replied'; Slack alert fires with raw reply snippet and note 'reply language may require manual review'
Sequence cancelled; deal stage updated; Slack message contains language note; no automated response sent
E08
Prospect email address verified by Hunter.io but bounces on send
Gmail returns a bounce notification for a sent pitch email
Bounce event updates HubSpot contact status to 'bounced'; deal stage set to 'invalid contact'; no follow-up sequence enrolled; row flagged in Sheet
No follow-up emails sent to bounced address; HubSpot status is 'bounced'; Sheet row has 'bounced' in status column; bounce event in error log