Phase 2 tests the handoffs between agents and tool steps in sequence, verifying that outputs produced by the Exception Triage Agent are correctly consumed by the Resolution Agent and that all downstream tool actions fire in the right order. IDs continue from Phase 1.
ID
Scenario
Input
Expected Output
Pass Criteria
T15
Full handoff: Triage Agent to Resolution Agent on address issue
ShipStation webhook with ADDRESS_ISSUE code; sandbox Shopify order #2001 value $55
Triage Agent output record consumed by Resolution Agent; Gmail sent; Gorgias ticket opened; reship or correction path initiated
Resolution Agent reads all four classification fields from Triage Agent output without mapping errors; no null fields passed
T16
Full handoff: Triage Agent to Resolution Agent on customs hold
ShipStation webhook CUSTOMS_HOLD; sandbox order #2002 value $90
Exception classified as customs_hold; Gmail template for customs delay sent; Gorgias ticket tagged customs_hold; workflow pauses for carrier update
Correct Gmail template variant sent; Gorgias tag = customs_hold; no premature Shopify action taken
T17
Gorgias ticket created before Gmail send
Valid exception record from Triage Agent; sandbox Gorgias and Gmail credentials active
Gorgias ticket ID generated and stored in workflow context before Gmail send step executes
Gorgias ticket ID present in workflow context at time of Gmail step; Gmail message body includes Gorgias ticket reference number
T18
Slack approval followed by Shopify write followed by Google Sheets log
High-value exception; manager approval via Slack test channel; order value $410
Shopify reship order created after Slack approval; Google Sheets row written with resolution_type, timestamp, and order value; Slack summary posted
All three downstream steps execute in correct sequence after Slack approval event; Google Sheets row contains all required columns with no blanks
T19
Google Sheets log row schema validation
Completed exception resolution record passed to Sheets step
Row written with columns: order_id, exception_type, resolution_type, customer_email (masked), timestamp, resolved_by (system or manager_name), order_value
All seven columns present and non-null; customer_email stored as domain-masked value only (e.g. c***@example.com)
T20
Slack channel summary message format
Resolved exception record with resolution_type = refund; order #2005
Slack message posted to fulfilment test channel: order number, exception type, resolution applied, timestamp, Gorgias ticket link
Message appears in test Slack channel within 30 seconds of Sheets write; all five fields present in message body
T21
ShipStation polling fallback triggers correctly
15-minute polling job fires; ShipStation returns two new exception events not previously received via webhook
Both exceptions processed through full workflow as if received by webhook; no duplication with existing records
Two new Gorgias tickets created; two Gmail notifications sent; no duplicate records for orders already in Sheets log
T22
Manager rejection via Slack routes to manual review
High-value exception Slack prompt; manager selects reject action on test channel message
Workflow flags case as manual_review_required; Gorgias ticket updated with note; no Shopify action taken; Slack message updated to show rejected status
No Shopify order or refund created; Gorgias ticket note contains rejection timestamp and action = manual_review; Slack message status updated
Edge-case tests cover scenarios that fall outside normal happy-path and failure-mode behaviour: duplicate events, structurally incomplete data, tool outages, and human timeout conditions.
ID
Scenario
Input
Expected Output
Pass Criteria
E01
Duplicate webhook for same shipment within 5 minutes
Two identical ShipStation webhooks received for tracking number TN-88001 within 3 minutes
Second webhook detected as duplicate using tracking number deduplication check; second run suppressed; one Gorgias ticket and one Gmail send only
Execution log shows deduplication triggered on second webhook; only one Gorgias ticket and one Sheets row for TN-88001
E02
Shopify order record missing customer email
Valid webhook; Shopify order found but customer.email field is null
Gmail step skipped; Gorgias ticket created with note 'Customer email unavailable'; Slack alert posted to test channel; exception still logged to Sheets
Gmail step does not fire; Gorgias note present; Sheets row written with customer_email = NULL flagged; Slack alert received
E03
ShipStation webhook received but ShipStation API unreachable for enrichment
Webhook payload received; ShipStation API returns timeout on enrichment call
Workflow uses payload data only; enrichment marked as unavailable; Gorgias ticket opened with available data; error note added to ticket
Workflow does not halt; Gorgias ticket created with partial data and enrichment_status = unavailable note; no duplicate triggered on retry
E04
Shopify API rate limit hit during reship order creation
Resolution Agent attempts to create reship order; Shopify returns 429 Too Many Requests
Exponential backoff applied: retry at 5 seconds, 20 seconds, 60 seconds; if all retries fail, Gorgias ticket updated with note and Slack alert sent
Retry sequence visible in execution log with correct intervals; Shopify order created on successful retry, or Slack alert and Gorgias note confirmed if all retries fail
E05
Manager Slack approval prompt times out with no response after 24 hours
High-value exception Slack prompt sent; no manager action taken within 24-hour window
Workflow escalates: second Slack reminder sent; Gorgias ticket priority updated to urgent; case flagged in Sheets as awaiting_approval_overdue
Second Slack message sent at 24-hour mark; Gorgias ticket priority = urgent; Sheets row shows status = awaiting_approval_overdue
E06
Exception arrives for an order that has already been refunded in Shopify
ShipStation webhook for order #2099; Shopify lookup returns order status = refunded
Workflow detects refunded status; no Shopify action taken; Gorgias ticket opened with note 'Order already refunded'; Slack alert posted; Sheets row written with resolution_type = already_resolved
No Shopify refund or reship attempted; Gorgias note and Sheets row both reflect already_resolved status; Slack alert received in test channel