Integration test cases verify that data passes correctly between agents in sequence, that outputs from one agent serve as valid inputs to the next, and that the end-to-end sandbox run produces a consistent audit trail. All cases below use sandbox credentials and a controlled record set.
ID
Scenario
Input
Expected output
Pass criteria
T16
Deduplication Agent output feeds Enrichment Agent correctly
Deduplication Agent completes a run producing a merged record set; Enrichment Agent triggered immediately after
Enrichment Agent receives the post-merge record list; does not attempt to enrich records that were removed in the merge step
No enrichment attempt on deleted secondary records; Enrichment Agent processes only surviving records
T17
Enrichment Agent output feeds Deal Hygiene Agent correctly
Enrichment Agent completes; updated records written to sandbox CRM; Deal Hygiene Agent fires
Deal Hygiene Agent reads the enriched record set from the CRM; stale deal and suppression logic applies to the updated data
Deal Hygiene Agent uses post-enrichment field values; no stale data from a prior snapshot used
T18
Full sequential run: trigger to Google Sheets log
Weekly schedule trigger fires in sandbox at the configured Monday 7am window
All three agents execute in sequence; Slack digest posted; Google Sheets row appended with accurate run counts
Run completes without manual intervention; Sheets row contains date, records processed, duplicates merged, fields enriched, deals flagged
T19
New contact creation trigger path
A new contact is created in the sandbox CRM mid-week (outside the scheduled run)
Deduplication Agent fires immediately for the new contact only; Enrichment Agent processes the new record; Deal Hygiene Agent skips (no new deal context)
Only the new record is scanned; no full-database rescan triggered; enrichment attempted for the new record
T20
Borderline duplicate handed off to Slack review
Deduplication Agent flags a borderline pair; auto-merge withheld; Slack message posted
Slack message includes both record IDs, the confidence score, and a clear prompt for the ops person to review
Slack message format matches the agreed template; no merge executed; records remain separate in CRM
T21
Enrichment failure count passed to exceptions digest
Five contacts return no Clearbit match during the Enrichment Agent run
Deal Hygiene Agent receives the failure count; Slack digest includes an enrichment failure section listing the five contact IDs
Slack digest section present with correct count; no enrichment failure silently dropped
T22
Stale deal rep confirmation loop
Deal Hygiene Agent flags a stale deal; rep is notified via Slack; rep confirms the deal should remain open
Rep response is captured; deal remains open; no closed-lost action taken; audit log updated with rep decision
Deal status unchanged after rep confirmation; Sheets log records the human decision with timestamp
T23
Google Sheets append: multiple runs in the same week
Two runs occur in the same week (one scheduled, one triggered by a new contact creation)
Google Sheets receives two separate appended rows, one per run, each with accurate and independent counts
Two distinct rows present in Sheets; neither row contains combined or duplicated counts from the other run
T24
Deduplication Agent fails; downstream agents do not run
HubSpot sandbox API returns a 500 error during the Deduplication Agent record pull
Orchestration layer detects the failure; Enrichment Agent and Deal Hygiene Agent are not triggered; error alert posted to Slack
No downstream agent runs; Slack error alert contains the failed step name and error code; run log records the failure
Edge case tests cover scenarios that fall outside the happy path but are realistic given the data volumes and tool dependencies in this process. IDs E01 through E07 run independently of the integration sequence above.
ID
Scenario
Input
Expected output
Pass criteria
E01
True duplicate: same contact created twice in rapid succession
Two identical contacts submitted within 90 seconds of each other via a form and an import
Deduplication Agent scores the pair on the next run; auto-merges if confidence is above threshold; no data lost from either submission
Merged record retains all field values from both submissions; no field is silently discarded
E02
Contact record with all priority fields missing
Contact has no email, no phone, no job title, no company name
Deduplication Agent cannot score the record; record is passed to enrichment with a low-data flag; Clearbit lookup attempted on whatever data is available
No agent crash; low-data flag recorded; enrichment attempted; failure logged if Clearbit returns no match
E03
Clearbit API entirely unavailable
Clearbit returns a 503 for all requests during a run
Enrichment Agent retries three times with exponential backoff; gives up gracefully; all contacts added to the enrichment failure list in the Slack digest
No partial enrichment writes; all affected contacts listed in digest; error logged with timestamp and HTTP status
E04
Slack API unavailable when digest is ready to post
Slack returns a 503 when the Deal Hygiene Agent attempts to post the exceptions digest
Automation platform retries the Slack post up to three times; if all retries fail, the digest content is written to the Google Sheets audit log as a fallback
Digest content preserved in Sheets even if Slack post fails; run does not error out; failure noted in run log
E05
Human reviewer does not act on a borderline duplicate within 7 days
A borderline duplicate pair is posted to Slack; no action taken by the ops person for 7 calendar days
On the next scheduled run the pair appears again in the Slack digest with a staleness indicator noting the number of days unreviewed
Re-flagged correctly on the next run; no automatic merge triggered due to inactivity; ops person prompted again
E06
Enrichment would overwrite an existing custom field
Contact has a manually maintained custom field (e.g. preferred_name) that conflicts with a Clearbit-returned value
Enrichment Agent detects the field is already populated; skips the write for that field; writes only to genuinely blank priority fields
Custom field value unchanged after enrichment run; overwrite protection confirmed for all non-blank fields
E07
Monthly Clearbit lookup cap reached mid-run
The configured monthly lookup cap is hit partway through an enrichment batch
Enrichment Agent stops sending new lookups immediately; remaining contacts in the batch are flagged in the Slack digest for manual follow-up; run completes without error
No lookups submitted beyond the cap; digest lists unfulfilled contacts; cap breach event recorded in run log