Skip to content

Conversation

@Shadterra
Copy link
Contributor

@Shadterra Shadterra commented Oct 16, 2025

Closes #275.

Google Calendar EventCreated Trigger Implementation

Adds a new trigger that monitors Google Calendar for newly created events and executes workflows automatically when new events are detected.

FEATURES

• Monitor single or multiple calendars
• Filter by organizer, keywords, or event status
• Configurable polling intervals (minimum 1 minute)
• Access to complete event data
• Automatic duplicate prevention
• Rich event metadata available in workflow variables

COMPONENTS

• AbstractCalendarTrigger.java - Base class for calendar triggers with flexible scope support
• EventCreatedTrigger.java - Main trigger implementation with inline @Schema documentation
• EventCreatedTriggerTest.java - Test suite with CI compatibility

USAGE EXAMPLES

Simple example - Watch your main calendar:

id: calendar_event_monitor
namespace: company.team

tasks:
  - id: log_new_event
    type: io.kestra.plugin.core.log.Log
    message: "New event: {{ trigger.summary }} at {{ trigger.start.dateTime }}"

triggers:
  - id: watch_primary_calendar
    type: io.kestra.plugin.googleworkspace.calendar.EventCreatedTrigger
    serviceAccount: "{{ secret('GCP_SERVICE_ACCOUNT_JSON') }}"
    calendarIds:
      - primary
    interval: PT5M

Advanced example - Multiple calendars with filtering:

id: team_meeting_monitor
namespace: company.team

tasks:
  - id: notify_slack
    type: io.kestra.plugin.notifications.slack.SlackIncomingWebhook
    url: "{{ secret('SLACK_WEBHOOK') }}"
    payload: |
      {
        "text": "New meeting: {{ trigger.summary }}\nOrganizer: {{ trigger.organizer.displayName }}\nTime: {{ trigger.start.dateTime }}"
      }

triggers:
  - id: watch_team_meetings
    type: io.kestra.plugin.googleworkspace.calendar.EventCreatedTrigger
    serviceAccount: "{{ secret('GCP_SERVICE_ACCOUNT_JSON') }}"
    calendarIds:
      - "[email protected]"
      - "[email protected]"
    searchQuery: "meeting"
    organizerEmail: "[email protected]"
    eventStatus: CONFIRMED
    interval: PT10M

SETUP REQUIREMENTS

• Google Cloud project with Calendar API enabled
• Service account with calendar read permissions (scope: https://www.googleapis.com/auth/calendar)
• Service account JSON key stored as Kestra secret
• Share target calendars with the service account's email address

AVAILABLE EVENT DATA

When the trigger fires, your workflow gets access to complete event information including:
• id, summary, description, location, status, htmlLink
• created and updated timestamps
• start/end times with timezone information
• organizer details (email, displayName)
• visibility and eventType

Access this data in workflows using {{ trigger.summary }}, {{ trigger.organizer.email }}, etc.

Screenshot from 2025-10-29 16-19-32

@github-project-automation github-project-automation bot moved this to To review in Pull Requests Oct 16, 2025
@MilosPaunovic
Copy link
Member

Just a small note for the future, if you could use GitHub Keywords when opening PRs to connect it to the proper issue (to automate the entire process a bit more), it would be super helpful to us. You can read a bit more about it here (I've added closing keyword for this particular issue).

@MilosPaunovic MilosPaunovic requested review from a team and Malaydewangan09 October 17, 2025 06:51
@Shadterra
Copy link
Contributor Author

When can i expect feedback ?

@Malaydewangan09
Copy link
Member

Hey @Shadterra, thanks for your contribution, we'll review this shortly!

@Shadterra
Copy link
Contributor Author

Damn. Hmm I'm not sure i understand the problem why the checks have failed. Would you please enlighten me ?

@fdelbrayelle
Copy link
Contributor

Checks failed because you need a review approval @Shadterra :)

@Malaydewangan09 Malaydewangan09 force-pushed the googlecalendar-event-trigger branch from 9888ada to 332223d Compare October 21, 2025 07:44
@MilosPaunovic MilosPaunovic added kind/external Pull requests raised by community contributors area/plugin Plugin-related issue or feature request labels Oct 22, 2025
@fdelbrayelle
Copy link
Contributor

Hello @Shadterra 👋 Did you have time to address the feedback please 🙏 ?

@Shadterra
Copy link
Contributor Author

Sorry i will do it tomorrow. I was busy with school these last 2 days and i didn't have time

@Shadterra
Copy link
Contributor Author

I fixed all things pointed out in review 👀

Copy link
Member

@Malaydewangan09 Malaydewangan09 left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Hey @Shadterra 👋, thanks for the contribution!

  • Could you please, mark as "Resolved" the discussions where you did the changes.
  • I see most of the tests dont actually run maybe you could take some ref from here, on how we test Triggers?
  • Also, would be great if you could provide some QA/test screenshots of the plugin using UI.

@Shadterra
Copy link
Contributor Author

Resolved discussions and i updated tests.

@Shadterra Shadterra closed this Oct 29, 2025
@github-project-automation github-project-automation bot moved this from To review to Done in Pull Requests Oct 29, 2025
@Shadterra Shadterra reopened this Oct 29, 2025
@github-project-automation github-project-automation bot moved this from Done to To review in Pull Requests Oct 29, 2025
@Malaydewangan09
Copy link
Member

Hey @Shadterra, it seems CI is failing could you please have a look at it? Thanks!

@Shadterra
Copy link
Contributor Author

Hello @Malaydewangan09 , I don't know what the problem is. And all errors i see on github are: no JSON input found. Could you send me your CI output ?

@Shadterra
Copy link
Contributor Author

#286 (comment)

i just found that have similar errors like here but i dont think i can do anything about it

@fdelbrayelle
Copy link
Contributor

Hi @Shadterra 👋
The "no JSON input found" is normal because you don't have the service account on your fork repository.
This error will disappear once merged on the main CI.

@fdelbrayelle fdelbrayelle changed the title feat(calendar): add EventCreated trigger for Google Calendar monitoring feat(calendar): add EventCreated trigger Nov 14, 2025
@fdelbrayelle fdelbrayelle changed the title feat(calendar): add EventCreated trigger feat(calendar): introduce EventCreatedTrigger Nov 14, 2025
@fdelbrayelle fdelbrayelle merged commit f44bdfa into kestra-io:main Nov 14, 2025
1 check failed
@github-project-automation github-project-automation bot moved this from To review to Done in Pull Requests Nov 14, 2025
@Shadterra
Copy link
Contributor Author

Hi @fdelbrayelle
I see you have closed the issue
So is everything good and does it work as intended ?

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

area/plugin Plugin-related issue or feature request kind/external Pull requests raised by community contributors

Projects

Status: Done

Development

Successfully merging this pull request may close these issues.

Add a Google Calendar "Event Created" Trigger for Kestra

4 participants