Integration tests verify that data flows correctly between the Ticket Classification Agent and the Routing and Notification Agent, and that each tool connection behaves as expected when both agents are running in sequence. IDs continue from Phase 1.
ID
Scenario
Input
Expected output
Pass criteria
T15
Full handoff: classification output consumed by routing agent
New ticket created in Zendesk sandbox. Classification agent runs and writes category=Billing, priority=High. Routing agent fires on field update.
Routing agent reads category and priority fields written by classification agent without any manual intervention. Assignment executes correctly.
Routing agent trigger fires within 5 seconds of classification agent writing fields. No manual step required between agents.
T16
HubSpot data passed through handoff intact
Ticket from Enterprise customer. HubSpot data fetched in step 2 of pipeline. Data referenced in internal context note by routing agent.
Context note written by routing agent contains plan tier sourced from HubSpot lookup performed earlier in the pipeline.
Plan tier in context note matches HubSpot sandbox record. Data not re-fetched by routing agent (single lookup per ticket confirmed in logs).
T17
Human review path handoff: ambiguous ticket re-enters pipeline after manual review
Ticket flagged ambiguous by classification agent. Team Lead updates category and priority manually in Zendesk sandbox. Routing agent fires on field update.
Routing agent detects manual field update and executes assignment, note, Slack, and Gmail steps as normal.
Routing agent completes all four downstream actions after manual update. Logs confirm trigger source was manual field update, not classification agent.
T18
Routing rules loaded correctly from Notion
Routing agent initialises. Notion routing rules document queried at runtime.
Correct agent-to-category mappings applied. Billing to billing agent, Technical to technical agent, Account Access to senior agent queue.
All three category-to-agent mappings resolve correctly against Notion document. No hardcoded fallback used.
T19
Multiple tickets in rapid succession: no cross-contamination
Three tickets created in Zendesk sandbox within 10 seconds. Each has a different category and customer.
Each ticket classified and routed independently. No ticket receives another ticket's category, assignee, or customer data.
Three separate execution logs. Each log contains only the ticket ID and customer data corresponding to that ticket. Zero data bleed confirmed.
T20
End-to-end latency within SLA target
New ticket created in Zendesk sandbox. Timer starts at ticket creation.
Ticket fully assigned, noted, Slack sent, and Gmail acknowledgement dispatched within 120 seconds of ticket creation.
Execution log timestamps show total pipeline duration under 120 seconds for a standard ticket (non-ambiguous, HubSpot record found).
T21
Routing rule missing for ticket category
Ticket classified as category=Feature Request, which has no routing rule in Notion document.
Ticket routed to default fallback queue. Internal note states no specific routing rule matched. Team Lead notified via Slack.
Fallback queue receives ticket. Note body contains explicit statement of unmatched category. Slack alert sent to Team Lead Slack ID.
T22
Notion routing rules document updated mid-run: next ticket uses updated rules
Routing rules updated in Notion sandbox to reassign Technical tickets to a different agent. Next ticket submitted as Technical.
Routing agent applies updated rules on the next ticket without requiring a pipeline restart.
Technical ticket assigned to newly configured agent. Previous ticket unaffected. No restart required.
Edge case tests — the following scenarios cover failure modes, malformed data, and human timeout situations that fall outside the normal happy path.
ID
Scenario
Input
Expected output
Pass criteria
E01
Duplicate ticket: same customer submits identical ticket twice within 5 minutes
Two tickets with identical subject, body, and sender email created in Zendesk sandbox within 5 minutes.
Both tickets processed independently. Duplicate flag added to second ticket's internal note. Neither ticket suppressed.
Second ticket note contains duplicate flag. Both tickets assigned and routed. No ticket silently dropped.
E02
Missing customer email on ticket: HubSpot lookup cannot execute
Ticket created in Zendesk sandbox with no requester email (submitted via API without email field).
Classification proceeds on ticket body alone. HubSpot lookup skipped. Plan tier defaults to Unknown. Ticket classified and routed.
Pipeline completes without error. Execution log notes HubSpot lookup skipped due to missing email. Internal note states plan tier unknown.
E03
Zendesk webhook unavailable: trigger does not fire
Zendesk sandbox webhook endpoint returns 503 for 60 seconds then recovers.
Automation platform detects webhook failure and retries delivery up to three times with exponential backoff. Ticket processed on recovery.
Retry log shows three attempts. Ticket processed within 30 seconds of webhook recovery. No duplicate processing on retry.
E04
HubSpot API rate limit hit: lookup returns 429
Inject 429 Too Many Requests from HubSpot sandbox API.
Classification agent waits for retry window specified in Retry-After header (or 60 seconds default), then retries once. If second attempt fails, ticket classified without CRM data.
Retry-After header respected. Second attempt made after wait period. On second failure, ticket proceeds with plan tier Unknown. Error logged.
E05
Human review timeout: Team Lead does not update ambiguous ticket within 30 minutes
Ticket flagged ambiguous and placed in human review queue. No manual update made within 30 minutes.
Escalation Slack alert sent to Team Lead with ticket link and urgency note. Ticket remains in human review queue. No auto-assignment.
Escalation Slack message received at Team Lead Slack ID at the 30-minute mark. Ticket not auto-assigned. Escalation event logged.
E06
Ticket body contains no text: empty or whitespace-only body
Ticket created in Zendesk sandbox with subject 'Help' and empty body.
Classification agent detects insufficient content. Confidence below threshold. Ticket routed to human review queue. No category or priority written.
Human review queue receives ticket. Classification metadata notes empty body detected. No fields overwritten. Team Lead alert triggered.