Document Classification Agent — build estimated at 10 hours, complexity: Moderate.
ID
Scenario
Input
Expected Output
Pass Criteria
T01
Happy path: supplier invoice via Gmail
Sandbox Gmail message with a single PDF attachment labelled 'INV-2025-0042.pdf', body text referencing supplier name 'Acme Supplies'
Metadata object: { document_type: 'Invoice', party_name: 'Acme Supplies', document_date: '2025-06-15' }
All three metadata fields populated; confidence score above threshold; no exception flag raised
T02
Happy path: signed contract via DocuSign
DocuSign sandbox webhook payload for a completed envelope containing a PDF contract between two named parties
Metadata object: { document_type: 'Contract', party_name: '[Party Name from envelope]', document_date: '[Completion date]' }
Document type returned as 'Contract'; party name matches envelope recipient; date matches completion timestamp
T03
Happy path: HR form via Gmail
Sandbox Gmail message with a DOCX attachment titled 'LeaveRequest_JessHuang.docx'
Metadata object: { document_type: 'HR Form', party_name: 'Jess Huang', document_date: '[Email received date]' }
document_type is 'HR Form'; party_name extracted from filename and/or body text; no exception raised
T04
Happy path: compliance certificate via Gmail
Sandbox Gmail message with a PDF attachment referencing an ISO certification and a certificate date in the body
Metadata object: { document_type: 'Compliance Certificate', party_name: '[Issuing body name]', document_date: '[Certificate date]' }
All three fields correctly extracted; confidence above threshold; output passed to Filing and Routing Agent stub
T05
Failure mode: unreadable or password-protected PDF
Sandbox Gmail attachment that is a password-protected PDF with no accessible text layer
Agent sets confidence below threshold; triggers exception flag; does not produce a metadata object
Exception flag raised; Slack alert payload generated; no metadata object emitted; no silent failure
T06
Failure mode: email with no attachment
Sandbox Gmail message with no file attachment and body text that does not reference a document
Agent detects no attachment; workflow exits gracefully with a log entry; no classification attempted
No metadata object produced; no exception Slack alert raised (not an error condition); execution log records 'no attachment detected'
T07
Failure mode: ambiguous document type
Sandbox PDF that contains both invoice line items and contract clauses with no clear header
Agent confidence score falls below threshold; exception flag triggered
Exception flag raised; document attached to Slack alert payload; reason string populated with 'ambiguous document type'
T08
Failure mode: missing party name
Sandbox PDF invoice with all party name fields blank or redacted
Agent extracts document_type and document_date but cannot populate party_name; confidence drops below threshold
Exception flag raised; reason string reads 'party name not identified'; document routed to manual review path
T09
Failure mode: DocuSign webhook payload malformed
Simulated DocuSign webhook POST with a missing 'envelopeId' field
Agent rejects the payload; logs a structured error; does not attempt classification
Error logged with payload dump; no classification attempted; no exception Slack alert sent (infrastructure error, not a document exception)
T10
Happy path: multi-page contract PDF with clear header
Sandbox 12-page PDF contract with a clear title page naming both parties and a contract date
Metadata object: { document_type: 'Contract', party_name: '[Client name from title page]', document_date: '[Date from title page]' }
Correct extraction from title page only; remaining pages do not cause confusion; confidence above threshold
Filing and Routing Agent — build estimated at 12 hours, complexity: Moderate.
ID
Scenario
Input
Expected Output
Pass Criteria
T11
Happy path: invoice filed to correct Drive folder
Metadata object from T01 stub: { document_type: 'Invoice', party_name: 'Acme Supplies', document_date: '2025-06-15' }
File renamed to 'AcmeSupplies_Invoice_2025-06-15.pdf'; uploaded to sandbox Drive path /Invoices/2025/; Notion row created; Slack confirmation sent to test channel
File appears in correct sandbox Drive folder; filename matches naming convention exactly; Notion row contains all five required fields; Slack message received in test channel within 30 seconds
T12
Happy path: contract filed and logged
Metadata object: { document_type: 'Contract', party_name: 'Beta Corp', document_date: '2025-06-10' }
File renamed to 'BetaCorp_Contract_2025-06-10.pdf'; filed to /Contracts/2025/; Notion row created with direct Drive link; Slack message sent
Naming convention correct; Drive path correct; Notion row includes file name, type, date, folder path, and Drive link; Slack message includes Drive link
T13
Happy path: HR form filed with correct subfolder routing
Metadata object: { document_type: 'HR Form', party_name: 'Jess Huang', document_date: '2025-06-12' }
File renamed to 'JessHuang_HRForm_2025-06-12.docx'; filed to /HR/Forms/2025/; Notion and Slack steps complete
Correct subfolder used for HR; filename uses DOCX extension not PDF; all downstream steps execute