Stop Double-Booking: Build a Two-Way Sync Workflow for Google Calendar and Microsoft 365 with n8n
The Challenge: Juggling Multiple Calendars
For freelancers, consultants, and anyone working in a modern company, managing multiple digital calendars is a common reality. Your personal life runs on Google Calendar, while your professional appointments are locked in a corporate Microsoft 365 (Outlook) account. This digital divide often leads to manual, error-prone duplication of events, and worse, the dreaded double-booking.
The constant switching between apps to check availability is a significant productivity drain. While some calendar apps offer basic subscription features, they are often one-way, read-only, and suffer from sync delays. What you need is a true, real-time, two-way synchronization system that you control.
This guide will walk you through building a robust two-way calendar sync workflow with n8n. You'll connect Google Calendar and Microsoft 365 so that a new event in one is automatically created in the other, giving you a single, unified view of your time.
Who is this workflow for?
- Freelancers and Consultants: Manage client meetings in Microsoft 365 and personal appointments in Google Calendar seamlessly.
- Employees in Mixed-Tech Environments: Keep your corporate Outlook calendar and personal Google Calendar in perfect harmony.
- Anyone Seeking Productivity: Eliminate the manual task of copying events and reduce the mental overhead of tracking multiple schedules.
The Core Logic: How to Avoid an Infinite Sync Loop
The biggest challenge in a two-way sync is preventing an infinite loop. Consider this scenario:
-
An event is created in Google Calendar.
-
Your workflow detects it and creates a corresponding event in Microsoft 365.
-
Your workflow, also watching Microsoft 365, detects this new event and tries to create it back in Google Calendar.
-
This cycle repeats forever, flooding your calendars and API quotas.
To solve this, we will implement a simple but effective control mechanism: a sync identifier. When our workflow creates a duplicate event, it will add a specific tag (e.g., [SYNC]) to the event's title. Before syncing any new event, the workflow will first check if this tag exists. If it does, the workflow stops, successfully breaking the loop.
Example n8n Workflow: Building Your Two-Way Sync
This workflow consists of two parallel execution paths. The first path watches Google Calendar and syncs to Microsoft 365. The second does the reverse.
Prerequisites
-
An active n8n instance (Cloud or self-hosted).
-
Credentials for your Google account (OAuth2).
-
Credentials for your Microsoft 365 account (OAuth2).
Path 1: Google Calendar to Microsoft 365
This path triggers when a new event is added to your specified Google Calendar.
1. Trigger: Google Calendar Node
- Node:
Google Calendar Trigger - Authentication: Connect your Google account using OAuth2.
- Calendar: Select the personal calendar you want to monitor.
- Trigger On:
Event Created
2. Filter: IF Node
- Node:
IF - Purpose: This is our loop prevention step.
- Condition: Set the condition to check if the event title (summary) from the Google Calendar node does not contain our sync identifier.
- Value 1:
{{ $json.summary }} - Operation:
String > Does not contain - Value 2:
[SYNC] - If the condition is true (the title does not have
[SYNC]), the workflow proceeds down thetruebranch. Otherwise, it stops.
3. Action: Microsoft 365 Calendar Node
- Node:
Microsoft 365 Calendar - Authentication: Connect your Microsoft 365 account.
- Resource:
Event - Operation:
Create - Calendar: Select the work calendar where you want to create the event.
- Title: Map the title from the Google Calendar trigger node and add your sync tag. Expression:
{{ $json.summary }} [SYNC] - Start Time:
{{ $json.start.dateTime }} - End Time:
{{ $json.end.dateTime }} - Body: You can map the description:
{{ $json.description }}
Path 2: Microsoft 365 to Google Calendar
This path is the mirror image of the first, ensuring events created in your work calendar appear in your personal one.
1. Trigger: Microsoft 365 Calendar Trigger
- Node:
Microsoft 365 Calendar Trigger - Authentication: Use the same Microsoft 365 credentials.
- Calendar: Select the work calendar you want to monitor.
- Trigger On:
Event Created
2. Filter: IF Node
- Node:
IF - Condition: Check if the event subject from the Microsoft 365 node does not contain the sync identifier.
- Value 1:
{{ $json.subject }} - Operation:
String > Does not contain - Value 2:
[SYNC]
3. Action: Google Calendar Node
- Node:
Google Calendar - Authentication: Use the same Google credentials.
- Resource:
Event - Operation:
Create - Calendar: Select your personal calendar.
- Title: Map the subject and add the sync tag. Expression:
{{ $json.subject }} [SYNC] - Start Time:
{{ $json.start.dateTime }} - End Time:
{{ $json.end.dateTime }} - Description: Map the body content:
{{ $json.body.content }}
Once both paths are configured and the workflow is active, you will have a fully functional two-way synchronization for new events.
Practical Tips and Next Steps
- Handling Privacy: If you don't want detailed work meeting titles on your personal calendar, use a
Setnode before theGoogle Calendarcreate node. You can set the title to a generic value like"Work Event [SYNC]"while still blocking off the correct time. - Managing Updates and Deletions: This guide covers event creation. To handle updates and deletions, you need to store a mapping between the Google event ID and the Microsoft event ID. A simple way to do this is to use a
Google SheetsorAirtablenode to log the ID of the original event and its synced counterpart. Your update/delete workflow would then use this log to find and modify the correct event in the other calendar. - Start One-Way: When first building, activate only one path (e.g., Google to Microsoft). Test it thoroughly to ensure authentication and event creation work as expected before enabling the second path.
- Error Handling: Add an error workflow path (the
On-Error-Triggersetting) to send you a notification via Slack or email if an API call fails. This helps you catch issues with authentication or API changes quickly.
By implementing this n8n workflow, you can finally unify your digital schedules, reduce manual data entry, and reclaim the time and focus lost to calendar management.
Enjoyed this article?
Share it with others who might find it useful