Integration tests verify that data passes correctly between agents and that the full workflow executes without data loss or state corruption at handoff points. All tests remain in sandbox environment.
ID
Scenario
Agents Involved
Input
Expected Output
Pass Criteria
T14
Full handoff: Booking Intake to CRM and Payment Agent, no deposit
Booking Intake Agent, CRM and Payment Agent
Valid Calendly webhook; slot available; deposit_required = false
Booking record passed intact; HubSpot contact created; deal logged as Confirmed
All fields from Intake Agent output present in CRM Agent input; HubSpot sandbox record matches booking data
T15
Full handoff: Booking Intake to CRM and Payment Agent, deposit required
Booking Intake Agent, CRM and Payment Agent
Valid Calendly webhook; slot available; deposit_required = true
Stripe link generated; HubSpot deal = 'Awaiting Payment'; Gmail link email delivered
deposit_required flag preserved across handoff; Stripe test link created; HubSpot and Gmail sandbox both updated
T16
Full handoff: CRM and Payment Agent to Reminder and Follow-Up Agent after payment confirmed
CRM and Payment Agent, Reminder and Follow-Up Agent
Stripe payment.succeeded webhook received; booking marked Confirmed
Reminder schedule activated; T-48h and T-2h reminders queued in test scheduler
Reminder Agent receives confirmed booking record; test scheduler shows two reminder jobs queued at correct offsets
T17
Partial handoff failure: CRM Agent fails mid-run, Reminder Agent does not activate
CRM and Payment Agent, Reminder and Follow-Up Agent
Valid booking record; HubSpot API returns 500 on deal creation attempt
CRM Agent errors and halts; Reminder Agent is not triggered; error log captures failure point
Reminder Agent execution log shows no invocation; CRM error logged with step 'deal_create'; no reminder jobs queued
T18
Twilio SMS delivery failure falls back to Gmail reminder only
Reminder and Follow-Up Agent
Confirmed booking record; Twilio test sandbox returns 400 on SMS send
SMS failure logged; Gmail reminder email sent as fallback; HubSpot note added: 'SMS failed, email reminder sent'
Twilio error captured in log; Gmail sandbox shows reminder email delivered; HubSpot sandbox shows note on contact
T19
No-show follow-up correctly updates HubSpot after Reminder Agent completes
Reminder and Follow-Up Agent
Appointment window passed; no completion status set; both reminders previously sent
No-show email sent; HubSpot deal status = 'No Show'; log entry records detection timestamp
Gmail sandbox shows follow-up email; HubSpot sandbox deal status updated; timestamps consistent with appointment datetime
T20
Complete three-agent sandbox run: intake through no-show follow-up
All three agents in sequence
Full Calendly webhook; deposit_required = true; payment confirmed; appointment passes without completion update
Confirmation email, calendar event, HubSpot record, Stripe link, payment confirmation, two reminders, and no-show follow-up all execute in sequence
All sandbox outputs present and correctly populated; no errors in execution log; all agent handoffs logged with correct timestamps
Edge case tests cover boundary conditions and failure scenarios that fall outside the standard booking flow. These must all be tested before Phase 3 is authorised.
ID
Scenario
Input
Expected Output
Pass Criteria
E01
Duplicate booking submission: same client submits the same slot twice within 60 seconds
Two identical Calendly webhooks for the same client email and appointment datetime
First submission processed normally; second submission detected as duplicate and discarded; single HubSpot record created
Execution log shows deduplication check triggered on second webhook; only one HubSpot contact and one calendar event created
E02
Missing client phone number: SMS reminder cannot be sent
Booking record with client_mobile = null; email present
SMS step skipped with warning logged; email reminder sent via Gmail; HubSpot note added: 'No mobile number on record'
Twilio step not invoked; Gmail reminder delivered; HubSpot note visible in sandbox contact timeline
E03
Missing deposit amount in booking record when deposit flag is true
Booking record with deposit_required = true; deposit_amount = null
Stripe link not generated; workflow halts at payment step; error logged with field 'deposit_amount'; booking flagged for manual review
No Stripe link created; error log entry present; HubSpot deal status = 'Requires Manual Action'
E04
Gmail API unavailable during confirmation send
Valid booking; Gmail API returns 503
Retry up to 3 times; if all fail, booking record held in pending state; alert generated; no calendar event created until confirmation is sent
Three retries logged; pending state flag set; alert message generated; calendar event creation blocked
E05
HubSpot contact exists with conflicting email domain (sandbox deduplication edge case)
Booking record email matches existing HubSpot contact but with different capitalisation
Case-insensitive match detected; existing contact updated rather than duplicate created
HubSpot sandbox shows one contact updated, not two contacts created; match method logged as 'case_insensitive_email'
E06
Appointment marked complete before no-show window expires
Booking datetime passed; completion status set to 'Complete' within 30-minute window
No-show follow-up branch not triggered; Reminder Agent closes the booking record cleanly; HubSpot deal = 'Completed'
No follow-up email in Gmail sandbox; HubSpot sandbox deal status = 'Completed'; no-show branch execution log shows skipped
E07
Human review timeout: complex reschedule flagged but no staff response within 4 hours
Reschedule request flagged for manual handling; no staff action recorded after 4-hour window
Escalation alert sent to Operations Coordinator email; HubSpot deal note added with timestamp and escalation flag
Gmail sandbox shows escalation alert addressed to coordinator; HubSpot sandbox note shows escalation timestamp; booking status remains 'Pending Manual Review'