# Sync PostgreSQL changes to SharePoint lists: n8n workflow

> Started by a clock, and works across Postgres. 19 steps, 3 branches, 1 loop or waits: a working afternoon to understand properly.

Source: https://millionrounds.com/workflow/sync-postgresql-changes-to-sharepoint-lists (Millionrounds; every figure on the page links to its filing or article)

[Automation library](https://millionrounds.com/workflows) · [Alerts and monitoring](https://millionrounds.com/workflows?category=Alerts+and+monitoring#library)

# Sync PostgreSQL changes to SharePoint lists

Started by a clock, and works across Postgres. 19 steps, 3 branches, 1 loop or waits: a working afternoon to understand properly.

Medium

[Download free](https://millionrounds.com/login?next=%2Fapp%2Fworkflow%2Fsync-postgresql-changes-to-sharepoint-lists)

**19 steps** Medium: a working afternoon

**3** Branches: places the flow splits

**1** Loop or waits

**1** Service it connects to

## The flow

Starts it 1 Logic 14 Service 4

The steps in the order they run, from what starts it.

- 1 **Every 15 Minutes Trigger** Schedule trigger *Starts it*
- 2 **Set Configuration Parameters** Set *Logic*
- 3 **Fetch Last Run Timestamp** Code *Logic*
- 4 **Query Updated Rows from Postgres** Postgres *Service*
- 5 **Aggregate Postgres Results** Code *Logic*
- 6 **Check Rows to Sync** If *Logic*
- 7 **Construct Graph Batch Payloads** Code *Logic*
- 8 **Update Timestamp No Rows** Code *Logic*
- 9 **Loop Over Batch Payloads** Split In Batches *Logic*
- 10 **Dispatch Sync Summary Note** Microsoft Teams *Service*
- 11 **Post Batch to Graph API** Http Request *Service*
- 12 **Process Looped Results** Code *Logic*
- 13 **Verify Batch API Response** Code *Logic*
- 14 **Check for Errors in Run** If *Logic*
- 15 **Prepare Next Batch** No Op *Logic*
- 16 **Remove Duplicate Alerts** Code *Logic*
- 17 **Refresh Last Run Timestamp** Code *Logic*
- 18 **Check for New Alert** If *Logic*
- 19 **Send Sync Error Alert** Microsoft Teams *Service*

## How it's built

- **Starts on:** A clock
- **Steps:** 19, with 3 branches, 1 loop or waits
- **Size:** Medium: a working afternoon
- **Connects to:** Postgres
- **Model:** None. This is plumbing, not judgement

## Questions

What does it need to run?

An n8n account, plus your own Postgres account. You connect your own accounts after importing it; none are included.

What starts it?

It starts on a clock.

Does it use AI?

No. Every step is fixed logic or a call to a service, so it does the same thing every time.

How long does it take to set up?

Plan an afternoon. 19 steps is enough that you should read each one before running it.

How do I import it?

Copy the workflow, open a new workflow in n8n and paste. The steps appear on the canvas, ready for your own accounts.

**Before you run it**

Nothing here has been tested by us. It is somebody's working automation, read and described from its own steps. Treat the connections it wants as a list of accounts it will touch, and read the 19 steps before you point it at anything that matters.

## Run it in n8n

- **Create your n8n account** Free to start. n8n is where the workflow runs. [Create an n8n account ↗](https://millionrounds.com/n8n)
- **Download the workflow** Free with a Millionrounds account. [Download free](https://millionrounds.com/login?next=%2Fapp%2Fworkflow%2Fsync-postgresql-changes-to-sharepoint-lists)
- **Paste it into n8n** Open a new workflow in n8n and paste. Then connect your own accounts.

Stored with the author's traces removed: canvas notes, instance identifiers, saved credential names and any live document they had left behind.

## Connects to

Each opens the other workflows that use it.

[Postgres](https://millionrounds.com/workflows?service=Postgres#library)

## Workflows like it

Also alerts and monitoring, with the same services where possible, closest in size first.

- [**Keyboard interest checker: GeekHack forum** 19 steps · Postgres, RSS](https://millionrounds.com/workflow/keyboard-interest-checker-geekhack-forum)
- [**Create dynamic crypto market monitors with Gemini** 20 steps · Postgres, Telegram](https://millionrounds.com/workflow/create-dynamic-crypto-market-monitors-with-gemini)
- [**Reconcile Postgres records with HTTP API and Slack** 20 steps · Postgres, Slack](https://millionrounds.com/workflow/reconcile-postgres-records-with-http-api-and-slack)
- [**Automate peer review assignments with Slack** 20 steps · calls a model · Email, Postgres](https://millionrounds.com/workflow/automate-peer-review-assignments-with-slack)
- [**Real-time oil price crisis detection with Qwq-32b AI** 20 steps · calls a model · Gmail, Postgres](https://millionrounds.com/workflow/real-time-oil-price-crisis-detection-with-qwq-32b-ai)
- [**AI Qwen-Vl-Plus powered car fleet maintenance alert system** 17 steps · calls a model · Postgres, Slack](https://millionrounds.com/workflow/ai-qwen-vl-plus-powered-car-fleet-maintenance-alert-system)
