π§ Publish a live calendar feed from Google Sheets to Google, Apple and Outlook
β‘ 2 views Β· π§ Miscellaneous
Description
Quick Overview
This workflow serves a token-protected iCalendar (.ics) feed from a Google Sheets βeventsβ tab, so Google Calendar, Apple Calendar, and Outlook can subscribe to a live calendar URL.
How it works
- Receives an incoming webhook request for
calendar.icsand checks the?token=query parameter against the configured feed token. - Looks up a short-lived cached .ics response and immediately serves it when it is still fresh.
- If the cache is stale, reads event rows from a Google Sheets document and continues even if the sheet read errors.
- Validates and normalizes each row (including all-day vs timed events, status values, and a past/future time window) and drops malformed or out-of-window entries.
- Renders the remaining events into an RFC 5545 iCalendar text body (with correct escaping, CRLF line endings, and UTC timestamps) and optionally adds a βfeed healthβ event.
- Stores the generated .ics in workflow static data for caching and responds with
text/calendar, serving the last known good calendar when a sheet read/render failure occurs or returning 404/503 on unauthorized/unavailable requests.
Setup
- Add Google Sheets OAuth credentials, select the target spreadsheet in the Google Sheets read step, and create a tab named
eventswith the required headers (uid, title, start_date, start_time, end_date, end_time, location, description, status, updated_at, rrule). - In the feed configuration, replace
feed_tokenwith a long random secret, set a uniquefeed_namespace, and review timezone/window/default duration settings to match your spreadsheet and desired publish range. - Activate the workflow, copy the production webhook URL for
calendar.ics, append?token=YOUR_TOKEN, and use that URL to subscribe from Google Calendar, Apple Calendar, or Outlook.
π Nodes Used
Google Sheets, Webhook
π₯ Import
Download workflow.json and import into n8n:
Workflow menu β Import from File