Triage emergency patients via chat with GPT-4.1 and hospital systems
Ready for 3.0What this workflow does
This AI workflow has 20 nodes and runs when a chat message arrives. Along the way it connects OpenAI Chat Model and Postgres.
How it runs
Trigger: When a chat message arrives.
- Hospital Triage Agent (AI Agent): runs an AI agent, with model: OpenAI Chat Model; 2 tools (Patient Consent Validator Tool, Department Availability Checker Tool); memory: Conversation Memory; output parser: Structured JSON Output Parser
- Check Confidence Threshold (If): checks a condition and branches into true / false
- Retrieve Patient History (Postgres): run a query
- Prepare Escalation Data (Edit Fields (Set)): sets 3 fields: escalation_reason, escalation_priority, original_confidence
- Enrich with Patient Context (Edit Fields (Set)): sets 2 fields: previous_visits, patient_risk_level
- Format Response to Patient (Edit Fields (Set)): sets 1 field: output
- Validate Business Rules (Code): runs custom JavaScript code
- Route by Intent Type (Switch): routes items into 4 branches
- Check Patient Eligibility (Postgres): run a query
- Log Interaction to Audit DB (Postgres): uses Postgres
…plus 4 more steps. See the full node list below.
Services it uses
Other OpenAI + PostgreSQL templates (191)
Before you upgrade to n8n 3.0
Nothing in this workflow is removed in n8n 3.0, so it should import and run after the upgrade.
Nodes used (12)
- Chat Trigger
@n8n/n8n-nodes-langchain.chatTrigger - AI Agent
@n8n/n8n-nodes-langchain.agent - OpenAI Chat Model
@n8n/n8n-nodes-langchain.lmChatOpenAi - Simple Memory
@n8n/n8n-nodes-langchain.memoryBufferWindow - Structured Output Parser
@n8n/n8n-nodes-langchain.outputParserStructured - If
n8n-nodes-base.if - HTTP Request
n8n-nodes-base.httpRequest - Edit Fields (Set)
n8n-nodes-base.set - Switch
n8n-nodes-base.switch - Postgres
n8n-nodes-base.postgres - Code
n8n-nodes-base.code - Code Tool
@n8n/n8n-nodes-langchain.toolCode
From the author
How It Works This workflow automates hospital emergency department triage by intelligently processing patient intake information through multiple AI-powered assessment stages. Designed for emergency departments, urgent care centers, and hospital admission…