Integration tests verify that data passes correctly between agents and that real tool interactions behave as expected end to end within the sandbox. All IDs continue the T sequence from Phase 1.
ID
Scenario
Input
Expected Output
Pass Criteria
T13
Policy Distribution Agent hands off tracking data to Reminder and Escalation Agent
Policy cycle initiated; tracking sheet seeded by Distribution Agent with 20 rows
Reminder Agent reads Google Sheets correctly on day-5 scheduled run, identifies all pending employees, sends correct reminder count
Reminder Agent log shows 20 employees evaluated. Gmail sandbox shows correct number of reminders matching pending count from Google Sheets. No row skipped or double-processed.
T14
DocuSign completion webhook triggers Completion Agent mid-cycle (partial completions)
5 completion webhooks fired in quick succession within a 10-second window for 5 different employees
Agent processes all 5 webhooks without collision. Each employee's BambooHR record updated and Google Sheets row updated independently.
BambooHR sandbox shows 5 new document attachments. Google Sheets shows 5 rows updated to Signed with distinct timestamps. No duplicate or missing writes. Run log shows 5 successful operations.
T15
Reminder Agent and Completion Agent write to Google Sheets concurrently
Reminder batch update and a DocuSign webhook arrive at the same second
Both writes complete without data corruption. Row-level locking or sequential write queue prevents overwrite.
Google Sheets reflects both updates correctly after concurrent writes. No row shows a blank or overwritten value. Run log shows no collision errors.
T16
DocuSign rate limit hit during bulk envelope send (large employee group)
Distribution Agent attempts to send 150 envelopes in rapid succession against DocuSign sandbox rate limit of 25 requests/minute
Agent detects 429 Too Many Requests response, applies exponential backoff, retries in batches, completes all 150 sends within 10 minutes
All 150 DocuSign sandbox envelopes reach Sent status. No envelopes skipped. Run log shows rate-limit events and retry intervals. Total send time under 12 minutes.
T17
Slack API unavailable during day-10 escalation run
Slack sandbox returns 503 Service Unavailable for all requests during the escalation window
Agent retries Slack calls up to 3 times with 60-second intervals. After final failure, falls back to Gmail escalation to HR Manager. Logs 'Slack unavailable, escalation sent via Gmail'.
Gmail sandbox shows escalation email to HR Manager listing all affected employees. Slack test workspace shows no messages. Run log contains 3 retry attempts and fallback record.
T18
BambooHR webhook payload missing policy version field
Trigger payload received with policy_id=POL-002 but version field absent
Distribution Agent logs a validation warning, uses a default version label of 'Version Unknown', proceeds with distribution, and flags the cycle in Google Sheets as requiring manual version confirmation.
Google Sheets cycle header shows version=Version Unknown with a flag. Distribution proceeds to all employees. HR Manager test email receives a data-quality alert. No agent crash.
T19
Full sandbox end-to-end: trigger through archiving with a 10-person pilot group
Policy trigger fired; 10 sandbox employees; 8 sign on day 3; 2 require day-5 reminders; 1 requires day-10 Slack escalation; all sign by day 11
All three agents execute in correct sequence. Google Sheets reflects each status change in real time. BambooHR sandbox shows 10 signed document attachments. Completion report generated at cycle close.
Zero unhandled errors across all three agents. All 10 BambooHR sandbox records contain signed PDF. Completion report shows 10/10. Reminder and escalation logs match expected employee IDs. Run log timestamps reflect correct day-5 and day-10 timing.
Edge case tests cover boundary conditions, missing data, and failure scenarios that fall outside the happy path but must be handled gracefully.
ID
Scenario
Input
Expected Output
Pass Criteria
E01
Duplicate employee entry in BambooHR employee list
BambooHR sandbox returns EMP-020 twice in the same query result (data quality issue)
Distribution Agent deduplicates the list before sending envelopes. Only one DocuSign envelope sent to EMP-020.
DocuSign sandbox shows exactly one envelope for EMP-020. Google Sheets shows one row for EMP-020. Log records 'Duplicate detected and removed: EMP-020'.
E02
Employee offboarded mid-cycle (terminated in BambooHR after envelope already sent)
EMP-021 terminated in BambooHR sandbox on day 4; envelope still open in DocuSign
On the next scheduled Reminder Agent run, EMP-021 is detected as inactive. Envelope voided in DocuSign. Google Sheets row updated to status=Removed (Offboarded). No further reminders sent.
DocuSign sandbox shows envelope for EMP-021 voided. Google Sheets row status=Removed. No day-5 reminder sent to EMP-021. Log records offboarding detection and void action.
E03
Policy document missing from DocuSign template at send time
DocuSign sandbox template referenced by the automation has been deleted by an administrator
Agent catches template-not-found error (DocuSign API 404 on template fetch), halts distribution, alerts HR Manager with message: 'DocuSign template POL-TMPL-01 not found. Manual action required.'
No envelopes sent. HR Manager test email contains clear error description and template ID. Google Sheets cycle row shows status=DistributionFailed. No silent failure.
E04
Employee submits signed envelope after the cycle deadline has passed
EMP-022 clicks DocuSign link and signs on day 16; cycle deadline was day 14
Completion webhook still fires. Completion Agent archives the signed PDF to BambooHR. Google Sheets row updated to Signed (Late) with signed_at timestamp. Completion report updated if still open; otherwise a late-filing note appended.
BambooHR sandbox record for EMP-022 contains signed PDF. Google Sheets row status=Signed (Late). Late signature logged with timestamp. No document discarded.
E05
HR Manager does not action an escalated non-responder within 5 days of escalation
EMP-023 escalated on day 10; no HR action recorded by day 15
Reminder Agent detects no resolution after 5 days of escalation. Sends a second Slack message to HR Manager flagging the overdue escalation. Google Sheets row shows EscalationOverdue.
Slack test workspace shows second notification to HR Manager mentioning EMP-023. Google Sheets row shows status=EscalationOverdue. No automated resolution applied. Log records secondary escalation event.
E06
Google Sheets API quota exceeded during a large-batch status update
Simultaneous completion webhooks for 50 employees trigger 50 Google Sheets write calls within 60 seconds, exceeding the 60 requests/minute quota
Agent detects quota error (429), queues remaining writes, processes in batches of 20 with 30-second delays. All 50 rows eventually updated.
Google Sheets shows all 50 rows updated to Signed with correct timestamps. No row left in Pending state after queue drains. Run log shows quota events and batch retry behaviour. Total update time under 5 minutes.