06 · Intermediate
Routes urgent leads to Slack and queues everything else in Sheets for follow-up.
Webhook
IF
Slack
Sheets
n8n canvas preview
IF Priority Router
Canvas via n8n-demo · import JSON into n8n.io → Workflows → Import from File
Writeup
POST /priority → IF $json.body.priority equals “urgent” → Slack #alerts, else Google Sheets append queue.
Step by step — how to build it
01
Add Webhook
POST, Path priority, Respond When Last Node Finishes.
02
Add IF
Connect Webhook → IF. Condition: String → {{$json.body.priority}} equals urgent (strict, case-sensitive).
03
True branch → Slack
From IF true output → Slack → channel alerts → text :rotating_light: Urgent inbound. Attach Slack credential.
04
False branch → Sheets
From IF false output → Google Sheets → Append → autoMapInputData. Attach Google credential + pick spreadsheet.
05
Prepare #alerts and the Sheet
Invite the bot to #alerts. Sheet headers should match fields you POST (priority, email, …).
06
Test both branches
POST {"priority":"urgent"} → Slack only. POST {"priority":"normal"} → Sheets row only.
How it functions
1 · Webhook
POST path priority, responseMode lastNode.
2 · IF Urgent?
Strict string equals: {{$json.body.priority}} === "urgent" (case-sensitive).
3a · Slack Urgent (true)
Channel alerts, text “:rotating_light: Urgent inbound”.
3b · Sheets Queue (false)
Google Sheets append with autoMapInputData — non-urgent rows land in the sheet.
Setup notes
Import + credentials
Import JSON. Attach Slack + Google Sheets. Create #alerts and a queue spreadsheet.
Match the payload
Caller must send JSON with body.priority (n8n webhook wraps POST JSON under body).
Map the Sheet
Sheets Queue → pick Document + Sheet; autoMap works once headers exist, or set columns manually.
Tips
priority must be exactly urgent — lowercase; normalize upstream if clients send Urgent.
True branch does not append Sheets; false does not Slack — by design in this export.
Import into n8n.io → Workflows → Import from File, attach credentials, activate.