Regex-powered immigration document triage workflow that watches incoming mail logs, classifies documents into high, standard, or unknown priority, and sends tiered Discord and Gmail notifications while logging processing status and errors in Google Sheets.
n8n · workflow canvasproduction build
Context
Immigration teams needed a dependable way to monitor incoming mail logs, classify document types quickly, notify clients and legal staff by urgency, and avoid processing duplicates or incomplete rows manually.
Approach
Built two connected n8n workflows: the main flow watches a Google Sheets mail log, skips incomplete or already-processed rows, normalizes fields, calculates deadlines, classifies documents with regex rules, and sends HP, SP, or manual-review outcomes to the correct channels; a separate error logger appends failures to a Sheets error log.
Architecture
Google Sheets rowAdded trigger
Row completeness check
Incomplete/already processed: skip
Complete
normalize + calculate deadline
Regex classification
HP: Discord Legal Team alert + Gmail client email + mark processed
SP
Gmail client email + mark processed
Unknown
manual review flag
Error Trigger
Prepare error data
Google Sheets error log
Results
~4 hrs/weekDocument triage time saved
Minutes, down from manual mail reviewHigh-priority filing response