ID
Scenario
Input
Expected output
Pass criteria
T16
Deal Ingestion Agent output triggers Commission Calculation Agent correctly
Deal Ingestion Agent completes and writes a clean 10-row deal list to the designated Google Sheets tab
Commission Calculation Agent triggers automatically within 30 seconds of sheet write completing; reads all 10 rows without manual intervention
Commission Calculation Agent execution log shows trigger timestamp within 30 seconds of sheet write; input row count in log equals 10
T17
Commission Calculation Agent output triggers Payout Distribution Agent after approval
Commission Calculation Agent completes payout summary; Slack approval message delivered; manager approves
Payout Distribution Agent triggers within 60 seconds of approval click; reads the approved payout summary from Google Sheets
Payout Distribution Agent execution log shows trigger event as manager_approval_confirmed; payout summary row count matches Commission Calculation Agent output
T18
Partial Google Sheets write: ingestion agent fails mid-write
Ingestion agent begins writing to Google Sheets but the connection drops after 5 rows are written (simulated by cutting the test session mid-execution)
Workflow detects the incomplete write on resume, clears the partial data, and retries the full fetch-and-write cycle from the beginning
On retry, Google Sheets tab contains only a complete fresh dataset with no duplicate or partial rows; retry log entry present
T19
Commission Calculation Agent reads stale rate table version
Rate table sheet has a locked version header; agent reads a tab that was accidentally left at a prior period's rates
Agent detects the version mismatch via the version_date cell in the rate table header, flags the issue, and sends a Slack alert to the monitoring channel without proceeding to calculation
Slack monitoring alert received noting rate_table_version_mismatch; calculation does not run; payout summary tab remains blank
T20
Gusto employee ID not found for one rep
Payout Distribution Agent attempts to push 4 rep entries to Gusto; one rep's Gusto employee ID field in the mapping table is blank
3 Gusto entries created successfully; 1 entry fails and is written to the exceptions log with flag: gusto_employee_id_missing; Slack alert sent to monitoring channel
Gusto test environment shows 3 entries; exceptions log contains 1 row with gusto_employee_id_missing; Slack alert received; no unhandled exception thrown
T21
Xero API rate limit hit during journal entry creation
Xero demo company API is configured to return HTTP 429 after the first request in a test session
Workflow catches the 429 response, waits the retry-after interval (60 seconds), retries the journal entry creation once, succeeds on retry
Xero journal entry present after retry; execution log shows one 429 event followed by a 60-second wait and successful retry; no duplicate journal entry created
T22
Slack DM delivery fails for one rep
4 reps in payout summary; one rep's Slack user ID is invalid in the sandbox workspace
3 Slack DMs delivered successfully; 1 delivery failure logged with flag: slack_user_not_found; monitoring channel alerted; workflow completes without halting
3 DMs received in sandbox; exceptions log contains 1 row with slack_user_not_found for the affected rep; monitoring alert received
T23
Full pipeline run in sandbox with 40 deal records
Sandbox HubSpot contains 40 closed-won deals across 6 reps, including one split deal, one clawback, and one unmatched rate tier
Payout summary produced for 6 reps; split deal correctly allocated; clawback deducted; unmatched deal in exceptions tab; Slack approval message sent; on approval, Gusto entries, Xero journal, and rep DMs all created
Payout summary row count equals 6; exceptions tab contains 1 row; Gusto has 6 entries; Xero journal entry total matches sum of gross commissions; 6 Slack DMs received
T24
Manager clicks Flag instead of Approve
Payout summary has 4 reps; manager clicks Flag in the Slack approval message
Workflow pauses; a follow-up Slack message is sent to the manager asking for specific exception details; Payout Distribution Agent does not trigger; payout summary tab is locked from further agent writes
Payout Distribution Agent execution log shows no trigger event after flag click; follow-up Slack message received by manager; payout summary tab status cell reads flagged_pending_review
ID
Scenario
Input
Expected output
Pass criteria
E01
Duplicate deal IDs in HubSpot export
HubSpot sandbox returns 10 deals including 2 records with identical deal IDs (simulating a CRM data quality issue)
Ingestion agent detects duplicate deal IDs, retains the record with the most recent close date, writes the duplicate to the exceptions tab with flag: duplicate_deal_id
Main sheet has 9 unique deal rows; exceptions tab contains 1 row with duplicate_deal_id; no duplicate appears in commission calculation input
E02
Deal value field contains non-numeric data
One deal record has deal value entered as the string 'TBC' in HubSpot
Ingestion agent flags the record in the exceptions tab with flag: non_numeric_deal_value; the record is excluded from calculation
Exceptions tab contains the record with non_numeric_deal_value; main calculation proceeds on remaining clean deals without error
E03
Google Sheets rate table is empty
Commission Calculation Agent triggers but the rate table tab in Google Sheets contains only headers and no data rows
Agent detects empty rate table, halts calculation, sends Slack alert to monitoring channel with flag: rate_table_empty, and does not write to payout summary tab
Payout summary tab is empty; Slack monitoring alert received with flag rate_table_empty; execution log shows halt at rate_table_validation step
E04
HubSpot API unavailable during scheduled trigger
Scheduled pay period trigger fires but HubSpot sandbox API returns HTTP 503
Workflow retries the HubSpot request up to 3 times with exponential backoff (30 seconds, 60 seconds, 120 seconds); after 3 failures, a Slack alert is sent and the workflow halts
Execution log shows 3 retry attempts with correct intervals; Slack alert received after third failure; no partial data written to Google Sheets
E05
Manager does not respond to Slack approval message within the timeout window
Payout Distribution Agent sends Slack approval message; manager takes no action for the configured timeout period (set to 48 hours in test, simulated by fast-forwarding the workflow clock)
Workflow sends a Slack reminder to the manager at the 24-hour mark; at 48 hours, sends a final alert to the monitoring channel and pauses indefinitely without proceeding to Gusto or Xero
Reminder message received at 24-hour mark; monitoring alert received at 48-hour mark; Gusto and Xero remain unmodified; workflow status shows approval_timeout
E06
Pay period triggers twice in the same period due to misconfigured schedule
Workflow trigger fires a second time within an already-processed pay period (same period label)
Workflow detects that the current period label already has a completed run in the run log, skips execution, and sends a Slack alert to the monitoring channel with flag: duplicate_period_run
No new data written to Google Sheets; no Gusto entries created; Slack monitoring alert received with duplicate_period_run; existing payout data unmodified
E07
Rep has zero qualifying deals in the period
Commission Calculation Agent processes a period where Rep G is on the rep master list but has no closed-won deals assigned to them
Rep G appears in payout summary with $0 gross commission and a note of zero_qualifying_deals; no Gusto additional earnings entry is created for Rep G; Rep G Slack DM states zero commission for the period
Rep G row in payout summary shows $0 and zero_qualifying_deals note; Gusto entries do not include Rep G; Rep G receives a Slack DM confirming zero commission