If you sync two calendars both ways with two workflows (Google → Outlook and Outlook → Google), you’ve probably seen the same thing I did: every event slowly multiplies. Here’s why it happens and how to fix it inside n8n.
Why it loops.
Workflow A copies a new Google event to Outlook. To Outlook, that copy is a brand-new event, so workflow B copies it back to Google, where it’s new again, and so on. Edits make it worse: an update arrives as “event changed”, the workflow can’t tell which copy it belongs to, and creates another one.
The fix has two parts.
Mark every copy you create. When a workflow creates the copy, tag it as a copy: for example put a short marker at the end of the description, or use a category in Outlook. At the start of each workflow, skip any incoming event that carries the marker. This alone stops the ping-pong.
Remember which event is a copy of which. Keep a small lookup table (an n8n Data Table, a Google Sheet or a database) with one row per pair: source calendar, source event ID, target event ID. Before creating, look up the source ID: if a row exists, update the target event instead of creating a new one. On delete, use the row to delete the copy, then remove the row.
Two things that still catch people out:
Recurring events: depending on the trigger, a series can arrive as one event or as every single occurrence. Decide which you want before the first run, or a weekly meeting becomes hundreds of events.
The first run: if your trigger picks up existing events, test on a scratch calendar first, so a mistake doesn’t copy your whole history.
Happy to help if you’re stuck on any of this; post your workflow and tag me.
The loop you describe is the visible half. The half that keeps producing duplicates after you add markers is the gap between “created the copy” and “stored the mapping to the copy”.
Sequence that breaks: workflow A creates the Outlook event (API returns 200), then the workflow dies before writing the mapping row — timeout, a Sheets write, a worker restart. Outlook now holds a copy that Google does not know is a copy. Next run, the marker is there but there is no mapping, so depending on your rule it either re-copies or copies the copy back. Either way you have duplicated events, and nothing failed loudly.
Three changes that closed it for me:
Write the mapping first, then create. Insert the pending row (source id → intended copy) before the API call, and fill in the copy id after. A row with no copy id is a “we may have created something” signal that a reconciliation pass can resolve. This inverts the usual order and looks wrong until you have been bitten once.
Reconcile, do not trust the happy path. A scheduled pass that looks for events created by us (your marker) with no mapping row, and either deletes them or adopts them. That pass is what turns a rare race into a non-event.
Deduplicate on a composite key, not on the event id.(calendar, start, end, normalised subject) catches the copy-of-a-copy case, where the ids differ but the event is the same. Your marker covers copies we made; the composite key covers copies someone else made, or made twice.
The test I would actually run: disable the mapping write on purpose, run a sync, then re-enable it and run again. If you get one extra event, your reconciliation is not wired up yet. That deliberate half-failure is the only way I have found to test this without waiting for production to produce it.
This is a really clear write-up. What stood out to me is that you explained why it loops before jumping to the fix, that “every copy looks like a brand-new event to the other side” framing makes the whole problem click, even for someone who’s only ever seen the symptom and never understood what was causing it.
Your two “still catch people out” notes are the kind of thing you only know from having been burned. The scratch-calendar tip especially, that one line will save someone from copying years of history into the wrong place on their first run. And flagging recurring events early is spot on, because that’s exactly where a tidy little sync quietly turns into hundreds of entries.
Marking the copies plus a small lookup table is also about as simple as this problem gets without giving up reliability, which feels like the right bar for a tips post. Thanks for taking the time to lay it out this cleanly, definitely bookmarking this one to point people at.
Nice write-up. The marker plus ID-map approach is the right one. A few details that save time when you build it:
Mark every copy at creation, not only on edits. The Google Calendar node doesn’t expose private extended properties, so I use an HTTP Request node with the Google Calendar credential. Call POST /calendar/v3/calendars/{id}/events and set "extendedProperties": {"private": {"syncedFrom": "outlook", "srcId": "<outlook event id>"}}. On the Outlook side, a category or a Graph single-value extended property does the same job. At the start of each direction, add an IF node that drops any event carrying the marker.
Keep the ID map as the source of truth. Store the pair (googleId, outlookId) plus a last-synced timestamp. Update when the pair exists, create when it doesn’t, and delete both the copy and the row on delete. Many duplicates come from the trigger firing on the update your own workflow just wrote, so compare updated against the stored timestamp and skip changes that came from you.
Decide up front about recurring series. Syncing the series master only is much simpler than syncing every occurrence. Test the first run on a scratch calendar so your history doesn’t get copied.