iCloud Calendar icon

iCloud Calendar

Interact with iCloud Calendar via CalDAV.

Overview

The "Get Events" operation of the iCloud Calendar node retrieves calendar events from a specified iCloud calendar within a defined date range. It connects to the iCloud CalDAV API, authenticates using user credentials, and fetches events occurring between a start and end date. If no dates are provided, it defaults to retrieving events from one week ago until about two months ahead.

This operation is useful for workflows that need to process or analyze upcoming or past calendar events, such as syncing calendars with other services, sending reminders, or generating reports based on scheduled events.

Practical examples:

  • Automatically fetching all events in a team calendar for the next month to send summary emails.
  • Retrieving past events to log meeting notes or attendance.
  • Integrating calendar events into project management tools or CRMs.

Properties

Name Meaning
Calendar Name or ID Select the calendar from which to retrieve events. Can be chosen from a list or specified by ID.
Additional Fields Optional parameters to refine event retrieval:
- Start Date The start date/time for event retrieval. Defaults to today if not set.
- End Date The end date/time for event retrieval. Defaults to one month after the start date if not set.
- Limit Maximum number of events to return. Defaults to 50. Minimum value is 1.

Output

The output is an array of JSON objects representing individual calendar events. Each event object includes parsed details such as:

  • uid: Unique identifier of the event.
  • summary: Event title.
  • description: Event description text.
  • location: Location of the event.
  • start, end: Raw start and end date/time strings.
  • startIso, endIso: ISO-formatted start and end timestamps adjusted for timezone.
  • startTimezone, endTimezone: Timezone identifiers for start and end times.
  • isAllDay: Boolean indicating if the event is an all-day event.
  • created, lastModified: Timestamps for creation and last modification.
  • status: Event status (e.g., confirmed, cancelled).
  • sequence: Sequence number for event updates.
  • timestamp: Timestamp of the event data.
  • isRecurring: Boolean indicating if the event has recurrence rules.
  • rruleObject: Parsed recurrence rule details if recurring.
  • url: Associated URL with the event.
  • invitees: Array of attendees with email, name, role, participation status.
  • attachments: Array of attachments with URI and MIME type.

No binary data output is produced by this operation.

Dependencies

  • Requires valid iCloud API credentials (username and password) configured in n8n.
  • Uses the iCloud CalDAV API endpoints for calendar and event data.
  • Relies on external libraries for HTTP requests (axios), XML parsing (xml2js), date-time handling (moment-timezone), and recurrence rule parsing (rrule).

Troubleshooting

  • Authentication errors: Ensure the iCloud API credentials are correct and have necessary permissions. Authentication failures will result in HTTP 401 or 403 errors.
  • Calendar not found: If the specified calendar ID does not exist or is inaccessible, the node will throw an error. Verify the calendar selection.
  • Date range issues: Invalid or improperly formatted start/end dates can cause errors or empty results. Use valid ISO date strings or n8n expressions.
  • API rate limits or network errors: Transient network issues or rate limiting by iCloud may cause request failures. Retry or check network connectivity.
  • Parsing errors: Malformed calendar data might cause parsing exceptions. These are surfaced as node errors with descriptive messages.

Common error messages include:

  • "Could not determine user principal URL": Indicates failure to retrieve or parse the user's CalDAV principal URL.
  • "Failed to parse calendar events": Indicates XML or iCal data could not be parsed correctly.
  • HTTP status errors with descriptions from the iCloud API.

Links and References

Discussion