Phase 2 validates the handoffs between agents and tests how the full pipeline responds to real-world failure conditions. All cases in this phase still use sandbox credentials. Integration tests continue the T sequence from T19. Edge case tests use the separate E sequence starting at E01.
ID
Scenario
Input
Expected Output
Pass Criteria
T19
Brief Generation Agent completes and triggers Slack writer notification
Notion row moves to 'Brief Ready' after T01 happy path
Slack DM sent to assigned writer channel containing brief URL, target word count, due date, and a receipt confirmation prompt
Slack message received in test writer channel within 90 seconds of Notion status update; all four data fields present in message body
T20
SEO Audit Agent fires correctly on 'Draft Ready' status change
Notion row status manually set to 'Draft Ready' in the test database after a simulated brief cycle
SEO Audit Agent triggers within 30 seconds; Surfer SEO API called with draft content from the correct Google Docs URL stored in the Notion row
Agent trigger timestamp logged within 30 seconds of status change; Surfer SEO sandbox API call recorded with the correct document content
T21
Surfer SEO scorecard Slack message links to the correct Google Docs draft
SEO Audit Agent completes with score 68 and 2 flagged sections
Slack message to content manager channel contains a clickable link to the Google Docs draft plus the score and flagged section names
Link in Slack message resolves to the correct Google Docs file; score shown is 68; both flagged section names appear in the message
T22
CMS Publishing Agent fires only after 'Approved for Publish' status, not on earlier statuses
Notion row cycles through 'Draft Ready', 'In Review', and 'Approved' without reaching 'Approved for Publish'
CMS Publishing Agent does not fire on any status other than 'Approved for Publish'
WordPress staging receives zero API calls during the status cycle; CMS agent run log shows no execution records for the test row
T23
Notion URL write-back after WordPress publish
CMS Publishing Agent successfully creates a staging post; WordPress returns a permalink
Notion row 'Canonical URL' field updated with the WordPress permalink; status updated to 'Published'
Notion row 'Canonical URL' is not empty; value matches the WordPress staging permalink exactly; status field is 'Published'
T24
Brief Generation Agent and SEO Audit Agent run concurrently for two different articles
Two Notion rows set to 'Approved' within 5 seconds of each other, each with a different keyword
Each agent run creates a separate Google Docs brief and logs a separate Surfer SEO score in the correct Notion row
Two distinct Google Docs brief files created; each Notion row's Surfer score field contains only that row's own score; no data cross-contamination between rows
T25
Full three-agent pipeline completes in sandbox from 'Approved' to 'Published' status
Single Notion row progressed manually through all required status changes in the correct sequence
All three agents fire in order; all Notion fields updated at each stage; Slack notifications delivered at brief-ready and scorecard stages; staging WordPress post created
Notion row passes through 'Brief Ready', 'Draft Ready', and 'Published' in order; all agent run logs show success; no manual intervention required between agent steps
T26
SEO Audit Agent does not re-run when Notion row is already in 'Brief Ready' status
Notion row status is 'Brief Ready'; status toggled back to 'Brief Ready' after an accidental edit
SEO Audit Agent does not trigger on 'Brief Ready' status; only triggers on 'Draft Ready'
No Surfer SEO API call recorded for the re-set event; SEO agent run log shows no new execution for that row
T27
CMS Publishing Agent rejects a second 'Approved for Publish' trigger on an already-published row
Notion row with status 'Published' is manually reset to 'Approved for Publish' to simulate an accidental re-trigger
Agent detects that a WordPress post already exists for this slug; exits without creating a duplicate post; logs a warning
No second WordPress post created; warning log entry references 'duplicate slug detected'; Notion status remains 'Published'
ID
Scenario
Input
Expected Output
Pass Criteria
E01
Duplicate Notion row created for the same keyword
Two Notion rows with identical target keyword 'content marketing strategy' both set to 'Approved'
Both rows trigger Brief Generation Agent independently; each creates a separate Google Docs brief; a warning is logged noting duplicate keywords
Two brief documents created; warning log entry references both row IDs and the duplicate keyword; no brief content is shared between documents
E02
Notion row missing the assigned writer field when brief completes
Notion row reaches 'Brief Ready' status but the 'Assigned Writer' field is blank
Slack notification cannot be directed to a named writer; message sent to the general content team channel instead with a flag that writer assignment is missing
Slack message received in general content channel; message body includes 'Writer not assigned' warning; Notion row status remains 'Brief Ready'
E03
Ahrefs API quota exhausted mid-month
Ahrefs sandbox configured to return a 403 quota-exceeded response
Agent halts; Notion status set to 'Brief Error'; Slack alert sent to content manager and SEO lead channels; no partial brief created
No Google Docs brief created; Slack alert received by both channels; error log references 'Ahrefs quota exceeded'; Notion status is 'Brief Error'
E04
Surfer SEO returns a malformed JSON response
Surfer SEO sandbox configured to return an incomplete JSON payload missing the 'score' key
Agent catches the parse error; Notion status set to 'Audit Error'; Slack alert sent; raw response body captured in the error log
Error log contains the raw malformed response; Notion status is 'Audit Error'; Slack alert received; no partial score written to Notion
E05
WordPress staging site is unreachable during CMS publish attempt
WordPress staging URL returns a connection timeout after 30 seconds
Agent retries twice with 2-minute back-off; after both retries fail, Notion status set to 'Publish Error'; Slack alert sent to content manager
Two retry attempts logged with timestamps; total wait time approximately 4 minutes before error state; Notion status is 'Publish Error'; Slack alert received
E06
Notion API webhook delivery fails and is retried by Notion
Notion sends the status-change webhook; the automation platform's webhook endpoint returns 500; Notion retries after 5 minutes
On the retry, the automation platform processes the webhook normally; idempotency check confirms no prior run for this row and event type; agent runs once
Exactly one agent execution recorded for the event; no duplicate outputs; retry gap of approximately 5 minutes visible in the run log
E07
Content manager does not mark 'Approved for Publish' within 14 days of draft ready
Notion row remains in 'In Review' status for 14 calendar days with no status change
A scheduled check fires after 14 days and sends a Slack reminder to the content manager channel referencing the stalled article title
Slack reminder received on day 14; message references the correct article title and the date the draft was submitted; no agent fires; no status change made
E08
Google Docs brief file is moved to a different folder by a team member between brief creation and SEO audit
Brief Generation Agent saves brief to the designated Google Docs folder; a team member moves it to a personal folder before the draft is submitted
SEO Audit Agent attempts to read the file using the stored file ID; Google Docs API returns 200 (file IDs are folder-independent in Google Drive); agent proceeds normally
SEO Audit Agent reads file content successfully using the stored file ID regardless of folder location; Surfer SEO API called normally; no error state set