Sync ERP order-to-cash data between Microsoft SQL Server, Postgres, Slack and Gmail
Ready for 3.0What this workflow does
This workflow has 19 nodes and runs on a schedule (every day at 06:00) (plus 1 other trigger). Along the way it connects Microsoft SQL, Postgres, Slack and Gmail.
How it runs
Trigger: On a schedule (every day at 06:00) (plus 1 other trigger).
- Configure Run (Edit Fields (Set)): sets 6 fields: runId, lookbackDays, highValueThreshold…
- Format Error Payload (Code): runs custom JavaScript code
- ERP: Fetch Open Sales Orders (Microsoft SQL): run a query
- Log Failure to Postgres (Postgres): run a query
- Normalize ERP Rows (Code): runs custom JavaScript code
- Slack: uses Slack
- Batch Over Orders (Loop Over Items (Split in Batches)): loops over the items in batches
- Query Mart Totals (Postgres): run a query
- Upsert Order into Mart (Postgres): run a query
- Build Digest HTML (Code): runs custom JavaScript code
…plus 7 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)
- Schedule Trigger
n8n-nodes-base.scheduleTrigger - Edit Fields (Set)
n8n-nodes-base.set - Microsoft SQL
n8n-nodes-base.microsoftSql - Code
n8n-nodes-base.code - Loop Over Items (Split in Batches)
n8n-nodes-base.splitInBatches - Postgres
n8n-nodes-base.postgres - If
n8n-nodes-base.if - Slack
n8n-nodes-base.slack - Merge
n8n-nodes-base.merge - Gmail
n8n-nodes-base.gmail - Error Trigger
n8n-nodes-base.errorTrigger
From the author
Quick overview This workflow runs daily to pull open sales orders from a Microsoft SQL Server ERP, normalizes and batch-upserts them into a PostgreSQL data mart, alerts Finance in Slack for credit-risk or high-value orders, and sends a daily digest via Gmail…