Hourly or daily
Sync an outside calendar feed into Google Calendar
Events from a feed or another tool appear in your calendar and stay up to date as they change or get cancelled.
- Runs
- Hourly or daily
- Apps
- Google Calendar
- AI
- Not needed
- Access
- read+write (calendar.events)
Send this to your assistant
Create a ClickRuntime automation: every morning at 6am, read this ICS feed and copy its events into my Imports calendar: add new ones, update changed ones and remove cancelled ones.
First time? Adding ClickRuntime to your assistant takes about two minutes.
Why use it
Why teams use this automation
A community center publishes classes on its own website, a sports league keeps fixtures in a spreadsheet, and a conference lists sessions in an ICS feed. A parent who wants these in Google Calendar subscribes to some, copies others by hand, and never notices when a match is moved or a class is cancelled. The calendar shows the original time, and someone turns up at the wrong hour.
Hourly or daily, ClickRuntime fetches the source, whether an ICS feed, an API or a web page, and turns each item into a calendar event with a stable ID. New items are inserted, changed items updated and removed items deleted, so your Google Calendar keeps matching the source.
Event organizers and clubs use it to give members a calendar that always shows the latest schedule.
What you get out of it
The calendar stays current
When a fixture moves, your event moves with it. People stop turning up at the wrong time because the calendar showed an outdated entry. Parents, volunteers and members all rely on it being right.
Works with sources that have no feed
Pages and APIs that do not offer a calendar subscription can still be imported. That includes club websites and booking systems that only display a list of upcoming dates. That covers club sites and booking systems.
Cancellations actually disappear
Removed items are deleted from your calendar, not left to confuse you. Anyone relying on the calendar sees the real schedule, which is critical for parents and volunteers. That matters most for volunteers and parents who plan around the calendar.
No duplicates after updates
Each event has a stable ID, so a changed time updates the existing entry. You never end up with two copies of the same class with different hours. One event, one entry, always.
One calendar for many sources
Classes, fixtures and sessions from different places end up in one view. Planning a week no longer involves checking four websites and a spreadsheet. Nothing else needs to be consulted when planning the week, and you stop discovering conflicts after the fact.
How it works
What happens, step by step
Every hour or every day ClickRuntime downloads the outside calendar feed you subscribed to.
It matches each event in the feed with the copy it made last time in your Google Calendar.
New events are added, changed ones are updated and cancelled ones are removed.
Your Google Calendar stays in step with the outside feed, without duplicates.
Before it runs live
- Connect Google Calendar
What you get
Build your own
Need it to work differently?
Your own rules
Conditions, thresholds, filters and exceptions, written the way you'd explain them to a colleague.
Any number of apps
One automation can read from one app and update several others. Over 248 apps are ready, and anything with an API works too.
AI where it helps
Summaries, classification, extraction and drafts use ClickRuntime's built-in AI, with no extra key.
On a schedule or on each event
Runs as often as every 5 minutes, or the moment an app sends an event, and keeps track of what it already handled.
Changes you can ask for
- Run it at a different time, more or less often, or only on weekdays
- Add an AI step, for example to summarize, sort or draft a reply
- Add another app, for example also send it to Slack
- Combine it with other Google Calendar steps into one automation
Under the hood
The code that runs this automation
from google.oauth2.credentials import Credentials
from googleapiclient.discovery import build
from clickruntime import on_trigger, credentials, http
ICS_URL = "https://example.com/events.ics"
CALENDAR_ID = "imports-calendar-id@group.calendar.google.com"
def parse_ics(text):
text = text.replace("\r\n ", "").replace("\n ", "")
for block in text.split("BEGIN:VEVENT")[1:]:
fields = dict(l.split(":", 1) for l in block.split("END:VEVENT")[0].splitlines() if ":" in l)
yield {k.split(";")[0]: v for k, v in fields.items()}
def when(v):
if "T" not in v:
return {"date": f"{v[:4]}-{v[4:6]}-{v[6:8]}"}
return {"dateTime": f"{v[:4]}-{v[4:6]}-{v[6:8]}T{v[9:11]}:{v[11:13]}:{v[13:15]}" + ("Z" if v.endswith("Z") else ""),
"timeZone": "UTC"}
@on_trigger
def run(event):
cal = build("calendar", "v3", credentials=Credentials(credentials.connection("google", "work")), cache_discovery=False)
feed = {e["UID"]: e for e in parse_ics(http.get(ICS_URL).text)}
existing = {e["extendedProperties"]["private"]["uid"]: e for e in cal.events().list(
calendarId=CALENDAR_ID, privateExtendedProperty="source=ics", maxResults=2500).execute()["items"]}
added = updated = removed = 0
for uid, e in feed.items():
body = {"summary": e.get("SUMMARY", ""), "location": e.get("LOCATION", ""),
"start": when(e["DTSTART"]), "end": when(e.get("DTEND", e["DTSTART"])),
"extendedProperties": {"private": {"source": "ics", "uid": uid}}}
if uid not in existing:
cal.events().insert(calendarId=CALENDAR_ID, body=body).execute(); added += 1
elif existing[uid]["summary"] != body["summary"] or existing[uid]["start"] != body["start"]:
cal.events().patch(calendarId=CALENDAR_ID, eventId=existing[uid]["id"], body=body).execute(); updated += 1
for uid in existing.keys() - feed.keys():
cal.events().delete(calendarId=CALENDAR_ID, eventId=existing[uid]["id"]).execute(); removed += 1
return {"added": added, "updated": updated, "removed": removed}FAQ
Common questions
How often does the calendar refresh?
What if the source does not give each event a unique ID?
Can I import into a separate calendar so it does not clutter mine?
What permissions does it need?
Does it need AI?
How many runs does it use?
Can I change how it works?
Related
You might also like
See who on your team is away this week
Each Monday you get a list of who is off and when, taken from your team's calendars.
See how it worksBlock focus time on busy days
On days full of meetings, a focus block is added to your first free gap.
See how it worksPost your team's daily agenda to Slack
Each weekday morning your team channel gets today's events from the shared calendar.
See how it worksKeep exploring
Set up “Sync an outside calendar feed into Google Calendar” from your assistant
Copy the prompt above, or connect your assistant first. Free plan, no credit card.