Skip to content

Google Calendar Activities

Version: 1.0.5  ·  ID: zoan-packages-googlecalendar  ·  Author: Zoan Software

The Google Calendar package creates, updates, searches and responds to events, and manages their guests, directly through Google’s API: book meetings from requests, reschedule in bulk, read the day’s agenda to prepare work or send invitations without opening the calendar.

Everything starts with Google Calendar — Connect, which supports two modes in authType:

ModeWhat you needWhen it fits
oauth (default)A Zoan Cloud Google OAuth connection authorized with the Calendar permission (https://www.googleapis.com/auth/calendar). Pass it in credential as credential("code-name"); Zoan Cloud refreshes the token for you.The robot manages the agenda of a person or a team account.
service-accountA service account key (full JSON) stored as a credential, in serviceAccount. With impersonateUser (domain-wide delegation) it works on that Workspace user’s calendar; without it, only on calendars shared with the service account’s email.Unattended runs with no person’s consent.

Place the other activities inside Connect’s body so they inherit the session (ZoanGoogleCalendarSession) and it closes by itself at the end.

  • calendarId: primary by default, the account’s main calendar. For another calendar use its ID, which you get from Get calendars (it usually looks like an email).
  • Dates: pass a DateTime directly (e.g. DateTime.Today.AddDays(1)) or ISO 8601 text (2026-06-15T14:30:00). They do not depend on the machine’s language or regional settings: they are sent to Google with an explicit offset. Since version 1.0.5.
    • A time without an offset (a plain DateTime or text without Z or -05:00) is read in the timeZone zone or, if empty, in the calendar’s zone; never in the robot machine’s zone.
    • With an offset (2026-06-15T14:30:00-05:00, a DateTimeOffset or a UTC DateTime) the exact instant is kept.
    • Text like 04/03/2026 is rejected: it is ambiguous (day/month or month/day).
  • All day: with allDay = true only the date is used. In Google the end date of an all-day event is exclusive: a June 15 event goes from 2026-06-15 to 2026-06-16.
  • notify: decides whether Google emails the guests on create, change or cancel. Keep it off while testing so no real invitations go out.

Create event, Update event, Get events, Get event by ID, Add attendee and Respond return each event as a Dictionary with these keys:

KeyTypeContent
idstringEvent ID. For recurring events, each occurrence has its own ID.
summarystringTitle.
descriptionstringDescription (null if none).
locationstringLocation (null if none).
startstringStart: ISO 8601 with offset (e.g. 2026-06-15T14:30:00.0000000-05:00) or just a date (2026-06-15) for all-day events.
endstringEnd, same format. For all-day events the date is exclusive (the day after the last one).
allDaybooltrue for an all-day event.
statusstringconfirmed, tentative or cancelled.
organizerstringOrganizer’s email.
attendeesListGuests: each one a Dictionary with email (string), response (string: needsAction, accepted, declined or tentative) and optional (bool). Null if the event has no guests.
htmlLinkstringLink to the event in Google Calendar.
meetLinkstringGoogle Meet link, if the event has one; otherwise null.
ActivityTypeOutputDescription
Google Calendar — Connectgooglecalendar-connectZoanGoogleCalendarSessionOpens an authenticated Google Calendar session
Google Calendar — Create eventgooglecalendar-create-eventDictionary<string,object>Creates an event on a calendar
Google Calendar — Update eventgooglecalendar-update-eventDictionary<string,object>Updates fields of an existing event (only the ones you set)
Google Calendar — Get eventsgooglecalendar-get-eventsList<Dictionary<string,object>>Lists or searches events within a date range
Google Calendar — Get event by IDgooglecalendar-get-eventDictionary<string,object>Gets a single event by its ID
Google Calendar — Get calendarsgooglecalendar-get-calendarsList<Dictionary<string,object>>Lists the calendars the account can access
Google Calendar — Add attendeegooglecalendar-add-attendeeDictionary<string,object>Adds one or more guests to an event (keeps existing ones)
Google Calendar — Respond (RSVP)googlecalendar-respondDictionary<string,object>Responds to an invitation: accept, decline or tentative
Google Calendar — Delete eventgooglecalendar-delete-event—Deletes an event from a calendar
Google Calendar — Closegooglecalendar-close—Closes a Google Calendar session

When Google rejects a call, the activity fails with a GoogleApiException whose message starts with The service calendar has thrown an exception. HttpStatusCode is … followed by Google’s text:

CodeUsual causeWhat to do
NotFoundThe calendarId or eventId does not exist, or the account cannot see that calendar.Check the IDs with Get calendars and Get events.
GoneThe event was already deleted.If you wanted it deleted, the outcome is already what you expected: catch it and continue.
BadRequestRejected data: end before or equal to start (The specified time range is empty), invalid guest email, unknown time zone.Review dates, emails and timeZone.
ForbiddenThe account can only read that calendar, is not the event organizer, the connection lacks the Calendar permission, or a quota was exceeded.Use a calendar where the account can edit, or re-authorize the connection.
UnauthorizedThe token is no longer valid (access revoked, connection expired).Reconnect the connection in Zoan Cloud.
TooManyRequestsGoogle’s per-minute request quota was exceeded.Wrap the activity in Retry with a delay.

Catch any of them with Try / Catch; error.Type is GoogleApiException.