Phase 2 verifies that the three agents hand off correctly to each other in sequence and that the full sandbox chain produces the expected combined output. Integration test IDs continue from the Phase 1 sequence.
ID
Scenario
Input
Expected Output
Pass Criteria
T16
Handoff Trigger Agent to Workspace Provisioning Agent: successful handoff
T01 passes; Handoff Trigger Agent emits confirmed deal object to the orchestration layer
Workspace Provisioning Agent receives deal object within 5 seconds; Drive folder and Notion page created; signed PDF uploaded
No data loss between agents; all HubSpot field values from T01 appear unchanged in the Notion page and Drive folder name
T17
Workspace Provisioning Agent to Communications Agent: successful handoff
T07 passes; Workspace Provisioning Agent emits confirmation with Drive URL and Notion URL
Communications Agent receives confirmation; Slack message includes valid Drive and Notion hyperlinks; Gmail email body includes Notion URL as a clickable link
Both URLs in Slack message and email resolve to the correct sandbox folder and page; links are not broken or malformed
T18
End-to-end sandbox chain: all agents in sequence, happy path
Single synthetic DocuSign webhook payload with all required fields; no errors injected
Full sequence completes: HubSpot updated, Drive folder created, Notion page populated, PDF uploaded, Slack message posted, welcome email sent, HubSpot audit note logged
All six outputs present within 3 minutes of webhook receipt; HubSpot timeline note is the final entry; no error events in the run log
T19
Workspace Provisioning Agent fails mid-run: Communications Agent must not fire
Valid DocuSign payload; Notion API configured to return 503 on all retries during this test run
Workspace Provisioning Agent exhausts retries and halts; Communications Agent does not receive a trigger signal; no Slack or email sent; error alert raised
Communications Agent run log shows no execution record; Slack channel has no new message; error alert in #automation-errors references workspace step failure
T20
HubSpot data completeness gate: incomplete fields trigger manual step prompt
DocuSign payload where contract value field maps to a blank HubSpot deal field
Automation pauses at completeness gate; Slack prompt posted to sales rep requesting missing field; workflow resumes after field is populated (simulated by manually updating the sandbox deal)
Pause event logged with deal ID and missing field name; Slack prompt delivered to correct sandbox user; workflow resumes within 60 seconds of sandbox field update
T21
Retry logic: transient API failure on Google Drive, recovers on second attempt
Valid deal data; Drive API configured to return 503 on first call only, then 200
Agent retries Drive call after 30 seconds; folder created successfully on second attempt; no error alert raised; run continues to Notion step
Run log shows one retry event; Drive folder exists; no error Slack message; total additional latency under 35 seconds
T22
HubSpot audit log entry written as final step after Communications Agent completes
Full sandbox chain completes (T18 scenario)
HubSpot deal timeline contains a timestamped note reading 'Onboarding handoff sequence completed: workspace created, brief sent, welcome email delivered'
HubSpot API confirms note creation via timeline activity endpoint; note body matches expected template text; timestamp is within 10 seconds of Gmail send confirmation
T23
Multi-client concurrency: two webhooks received within 30 seconds of each other
Two distinct synthetic DocuSign payloads with different envelope IDs and client names, delivered 20 seconds apart
Both onboarding sequences run independently and in parallel; outputs for Client A and Client B are fully separated in Drive, Notion, Slack, and HubSpot; no field crossover between records
Two distinct Drive folders created with correct client names; two separate Notion pages; two separate Slack messages; two separate HubSpot notes; no field from Client A appears in Client B record or vice versa
Edge case tests verify behaviour at the boundaries of expected input. These are tested in sandbox only. Each case must resolve to a defined, observable state with no silent failures.
ID
Scenario
Input
Expected Output
Pass Criteria
E01
Duplicate contract: same client onboarded twice within 24 hours
Two DocuSign payloads with the same client name and same contact email but different envelope IDs (e.g. re-sign scenario)
Both envelopes processed; second run creates a new Drive folder with a suffix (e.g. '[ClientName] - Onboarding 2'); HubSpot note on second run flags potential duplicate for review
No merge or overwrite of first run's assets; second folder name is unique; HubSpot note on second deal contains text 'Possible duplicate: review before proceeding'
E02
Missing deal data: all optional HubSpot fields blank, only required fields present
Deal record with only client name, contact email, and envelope ID populated; contract value, scope, and account manager all null
Workspace created with available data; Notion template fields for missing values display '[Not provided]' placeholder; Slack message omits missing sections cleanly; Gmail sent from fallback address
No agent crash; all three agents complete; output artefacts contain placeholder text for missing fields; run log notes which fields were absent
E03
Unavailable tool: Notion API returns 503 for entire test window (15 minutes)
Valid deal data; Notion API endpoint configured unreachable for duration of test
Handoff Trigger Agent and Drive steps complete; Notion step retries three times then halts; error alert sent; Drive folder and PDF remain intact; Communications Agent does not fire
Drive assets preserved; Notion not created; error alert in #automation-errors includes deal ID, Drive URL, and instruction to create Notion page manually; Communications Agent shows no execution
E04
Unavailable tool: Slack API unreachable
Valid deal data; Slack API configured to return connection timeout
Gmail welcome email sent successfully; Slack message retried twice then logged as failed; error alert delivered via a secondary channel (email to support@gofullspec.com in test config); HubSpot note still written
Gmail email delivered; Slack message absent; error email sent to configured fallback address; HubSpot note includes text 'Slack delivery failed: manual handoff brief required'
E05
Human timeout: sales rep does not complete missing CRM fields within 24 hours
DocuSign payload triggering completeness gate pause (T20 scenario); sandbox deal field left blank for simulated 24-hour window
Automation remains paused; a reminder Slack message is sent to the sales rep at the 24-hour mark; if still unresolved after 48 hours, escalation alert sent to the configured operations lead
Reminder message delivered at correct interval (verified using fast-forward simulation in sandbox); escalation alert contains deal ID, missing field, and operations lead name
E06
Malformed DocuSign payload: JSON structure valid but required keys absent
DocuSign webhook payload that is valid JSON but lacks the 'envelopeId' and 'recipients' keys entirely
Agent rejects payload at validation step; logs rejection with raw payload hash; no downstream action triggered; error alert posted to #automation-errors
No HubSpot write; no Drive, Notion, Slack, or Gmail action; error log contains payload hash and list of missing keys; alert delivered within 30 seconds
E07
Google Drive storage quota reached on test account
Valid deal data; Drive sandbox account configured at storage limit
Drive folder creation fails with quota error; agent logs error with account identifier and quota message; Notion and Communications steps do not proceed; error alert instructs reviewer to clear Drive space
Drive folder absent; error log contains 'STORAGE_QUOTA_EXCEEDED' string; Slack alert delivered; Notion and Gmail steps show no execution record