Sync PostgreSQL changes to SharePoint lists via Microsoft Graph with Teams alerts
Ready for 3.0What this workflow does
This workflow has 19 nodes and runs on a schedule (every 15 minutes). Along the way it connects Postgres and Microsoft Teams. It also calls graph.microsoft.com over HTTP.
How it runs
Trigger: On a schedule (every 15 minutes).
- Set Configuration Parameters (Edit Fields (Set)): sets 5 fields: sharepointSiteId, sharepointListId, batchSize…
- Fetch Last Run Timestamp (Code): runs custom JavaScript code
- Query Updated Rows from Postgres (Postgres): run a query
- Aggregate Postgres Results (Code): runs custom JavaScript code
- Check Rows to Sync (If): checks a condition and branches into true / false
- Construct Graph Batch Payloads (Code): runs custom JavaScript code
- Update Timestamp No Rows (Code): runs custom JavaScript code
- Loop Over Batch Payloads (Loop Over Items (Split in Batches)): loops over the items in batches
- Dispatch Sync Summary Note (Microsoft Teams): work with channel message
- Post Batch to Graph API (HTTP Request): calls graph.microsoft.com (POST)
…plus 7 more steps. See the full node list below.
Services it uses
HTTP calls to: graph.microsoft.com
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 (9)
- Schedule Trigger
n8n-nodes-base.scheduleTrigger - Edit Fields (Set)
n8n-nodes-base.set - Code
n8n-nodes-base.code - Postgres
n8n-nodes-base.postgres - If
n8n-nodes-base.if - Loop Over Items (Split in Batches)
n8n-nodes-base.splitInBatches - HTTP Request
n8n-nodes-base.httpRequest - No Operation, do nothing
n8n-nodes-base.noOp - Microsoft Teams
n8n-nodes-base.microsoftTeams
From the author
Quick overview This workflow runs every 15 minutes and uses a watermark to incrementally sync recently updated rows from PostgreSQL to a Microsoft SharePoint list via the Microsoft Graph $batch API, posting run summaries and deduplicated error alerts to a…