Email Automation
Triage blood donor deferrals and component release with Gmail, OpenAI, and Telegram
When a new email arrives, it handles email with OpenAI / ChatGPT using Data Table, Gmail, Telegram.
What it does
📘 WORKFLOW DETAILS Blood Bank Donor Deferral & Component Release Compliance Engine Value: reads a donor's screening questionnaire email, applies AABB-style deferral rules to every risk flag it finds, takes the longest applicable deferral (as AABB requires), and drafts the donor's own notice — turning a manual questionnaire review into an auditable, minutes-long ledger entry. Who it's for: hospital or community blood bank compliance staff who process donor history questionnaires and must decide, consistently, whether a just-collected component should be quarantined, released, or the donor permanently deferred. How it works: 1. Gmail Trigger picks up the donor questionnaire intake email. 2. Normalize + Fetch Prior Deferral History (HTTP Request) pull the donor's own prior deferral record from the registry for context. 3. Extract Donor Risk Flags (Information Extractor, stage 1 AI) reads the questionnaire text and returns a structured list of AABB risk flags with present/absent booleans. 4. Split Out fans out one item per flag; Calculate Flag Deferral Days (Execute Sub-workflow) calls the AABB Deferral Days Calculator sub-workflow for each flag's real deferral length and permanence. 5. Flag Indicates Permanent Deferral? tags each flag, Merge recombines them, Aggregate rolls them back into one array. 6. Compute Effective Deferral & Release Status (Code, the deterministic middle) applies the AABB longest-deferral-wins rule and any permanent-flag override to produce one deferral_status: Permanent / Hold / Eligible. 7. Deferral Status: Permanent or On Hold? branches into Tag Hold or Tag Eligible, then both converge into Draft Donor Notice (Basic LLM Chain, stage 2 AI) which drafts the actual notice text conditioned on that status — never deciding the status itself. 8. The ledger entry is logged to an n8n Data Table and the lab supervisor is pinged on Telegram. Node summary: Gmail Trigger → Set (normalize) → HTTP Request (prior history) → Information Extractor+Chat Model (flag extraction) → Split Out → Execute Sub-workflow (deferral calc) → If (permanent flag) → Set×2 (tag) → Merge → Aggregate → Code (effective status) → If (hold gate) → Set×2 (tag outcome) → Basic LLM Chain+Chat Model (notice drafting) → Data Table (ledger) → Telegram (notify). Input: donor questionnaire email. Output: an n8n Data Table ledger row per donor/component with deferral_status and compon
The steps
- Receive Donor Screening Email
- Normalize Screening Intake
- Fetch Prior Deferral History
- Extractor Model
- Extract Donor Risk Flags
- Split Out Risk Flags
- Calculate Flag Deferral Days
- Flag Indicates Permanent Deferral?
- Tag Permanent Flag
- Tag Temporary Flag
- Recombine Flag Results
- Aggregate Deferral Flags
- Compute Effective Deferral & Release Status
- Deferral Status: Permanent or On Hold?
20 steps in total.
Similar automations
Email AutomationEmail Blood Test Result Alerts with Claude and OpenAI11 stepsEmail AutomationMonitor app errors and heartbeats with OpenAI triage and Gmail alerts42 stepsEmail AutomationTriage Gmail with Gemini, label emails, log invoices to Sheets, and send Telegram alerts22 stepsEmail AutomationRoute and triage workflow errors with Gmail, Gemini and n8n API160 steps