Skip to content
NEWMarketplace and your team: sell what you build, and get plans and changes that are tested before you see them. See what is new

Library / Email Automation

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

  1. Receive Donor Screening Email
  2. Normalize Screening Intake
  3. Fetch Prior Deferral History
  4. Extractor Model
  5. Extract Donor Risk Flags
  6. Split Out Risk Flags
  7. Calculate Flag Deferral Days
  8. Flag Indicates Permanent Deferral?
  9. Tag Permanent Flag
  10. Tag Temporary Flag
  11. Recombine Flag Results
  12. Aggregate Deferral Flags
  13. Compute Effective Deferral & Release Status
  14. Deferral Status: Permanent or On Hold?

20 steps in total.

Similar automations