Triage hospital FHIR observations with Google Gemini, Google Sheets, and Slack
Go to WorkflowDescription
Quick overview
Youtube Video: https://youtu.be/hq4jZv8EZYg?si=aU_0S13Zvbo30IS-
This workflow runs every 15 minutes to poll FHIR Observation data from mock.health, uses Google Gemini to triage each new observation, escalates high-severity findings to Slack, and logs all processed observations and recommendations to a Google Sheets tracking sheet.
How it works
Runs every 15 minutes on a schedule.
Reads the last successful sync timestamp from workflow static data and polls the mock.health FHIR Observation endpoint for the most recently updated records since that time.
Parses the FHIR bundle, normalizes each Observation into a consistent alert payload, and stops if no valid observations are returned.
Checks Google Sheets for matching observationId values and filters out observations already marked as processed.
Sends each unprocessed observation to Google Gemini to assign a severity, headline, clinical rationale, and recommended action, then merges the triage back into the observation record.
Routes CRITICAL and HIGH observations to Slack as an escalation message, then restores the original payload for downstream logging.
Appends or updates the observation in Google Sheets (marking it processed) and advances the stored sync cursor to the newest processed observation timestamp.
Setup
Create or select a mock.health API bearer token credential and ensure it can access the FHIR Observation endpoint used in the HTTP request.
Add a Google Gemini (Google PaLM) API credential for the Gemini chat model used to generate triage JSON.
Add a Google Sheets Service Account credential, grant it access to the target spreadsheet, and ensure the “Observations” sheet has columns matching the fields written (including observationId and processed).
Add a Slack OAuth credential and set the target channel for escalations (the workflow currently posts to channel ID C0B8VH1M5PX).
This workflow was created by iamvaar and shared publicly on the n8n community template library. n8nFind indexes it for discovery — the workflow remains the property of its original creator.