Route purchase approvals by spend, department and vendor risk with Postgres, email and Slack
Ready for 3.0What this workflow does
This workflow has 24 nodes and runs manually, when you click “Execute workflow” (plus 1 other trigger). Along the way it connects Postgres.
How it runs
Trigger: Manually, when you click “Execute workflow” (plus 1 other trigger).
- Postgres: run a query
- Set Approval Policy (Edit Fields (Set)): sets 10 fields: currencyRates, spendTiers, approvers…
- Code: runs custom JavaScript code
- Request Valid? (If): checks a condition and branches into true / false
- Postgres: run a query
- Respond - Validation Error (Respond to Webhook): sends the response back to the webhook caller
- Code: runs custom JavaScript code
- Postgres: run a query
- Respond - Request Received (Respond to Webhook): sends the response back to the webhook caller
- Switch: routes items into 3 branches
…plus 12 more steps. See the full node list below.
Services it uses
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 (11)
- Manual Trigger
n8n-nodes-base.manualTrigger - Postgres
n8n-nodes-base.postgres - Webhook
n8n-nodes-base.webhook - Edit Fields (Set)
n8n-nodes-base.set - Code
n8n-nodes-base.code - If
n8n-nodes-base.if - Respond to Webhook
n8n-nodes-base.respondToWebhook - Switch
n8n-nodes-base.switch - Send Email
n8n-nodes-base.emailSend - HTTP Request
n8n-nodes-base.httpRequest - Wait
n8n-nodes-base.wait
From the author
Quick overview This workflow receives purchase requests via webhook, evaluates spend tiers, department budget status, and vendor risk using Postgres data, then either auto-approves, rejects, or runs a sequential email approval chain, finally notifying the…