Google Workspace SheetModifiedTrigger

Google Workspace SheetModifiedTrigger

Certified

Poll for Google Sheet modifications

Polls a spreadsheet for new Drive revisions and triggers when changes occur (cells, rows/columns, sheet tabs). Requires service account with spreadsheets.readonly and drive.metadata.readonly. Optional filters for sheet name/range. Interval default PT5M.

yaml
type: io.kestra.plugin.googleworkspace.sheets.SheetModifiedTrigger

Monitor entire spreadsheet for changes

yaml
id: monitor_spreadsheet
namespace: company.team

tasks:
  - id: log_changes
    type: io.kestra.plugin.core.log.Log
    message: |
      {% if trigger.count > 0 %}
      Spreadsheet '{{ trigger.modifications[0].spreadsheetTitle }}' was modified by {{ trigger.modifications[0].lastModifyingUser }}.
      Detected {{ trigger.count }} modification(s).
      {% else %}
      No modifications detected in spreadsheet.
      {% endif %}

triggers:
  - id: watch_sheet
    type: io.kestra.plugin.googleworkspace.sheets.SheetModifiedTrigger
    interval: PT5M
    spreadsheetId: "1U4AoiUrqiVaSIVcm_TwDc9RoKOdCULNGWxuC1vmDT_A"
    serviceAccount: "{{ secret('GCP_SERVICE_ACCOUNT_JSON') }}"

Monitor specific sheet tab with range filter

yaml
id: monitor_orders_sheet
namespace: company.team

tasks:
  - id: process_changes
    type: io.kestra.plugin.core.debug.Return
    format: |
      {% if trigger.count > 0 %}
      Changes detected in sheet:
      - Modified at: {{ trigger.modifications[0].modifiedTime }}
      - Modified by: {{ trigger.modifications[0].lastModifyingUser }}
      - Revision ID: {{ trigger.modifications[0].revisionId }}
      {% else %}
      No modifications detected in Orders sheet.
      {% endif %}

triggers:
  - id: watch_orders
    type: io.kestra.plugin.googleworkspace.sheets.SheetModifiedTrigger
    interval: PT2M
    spreadsheetId: "1U4AoiUrqiVaSIVcm_TwDc9RoKOdCULNGWxuC1vmDT_A"
    serviceAccount: "{{ secret('GCP_SERVICE_ACCOUNT_JSON') }}"
    sheetName: "Orders"
    includeDetails: true

Track only new revisions (CREATE mode)

yaml
id: track_new_revisions
namespace: company.team

tasks:
  - id: notify
    type: io.kestra.plugin.slack.notifications.SlackIncomingWebhook
    url: "{{ secret('SLACK_WEBHOOK') }}"
    payload: |
      {
        "text": "{% if trigger.count > 0 %}Spreadsheet '{{ trigger.modifications[0].spreadsheetTitle }}' was modified by {{ trigger.modifications[0].lastModifyingUser }}{% else %}No changes detected{% endif %}"
      }

triggers:
  - id: watch
    type: io.kestra.plugin.googleworkspace.sheets.SheetModifiedTrigger
    interval: PT1M
    spreadsheetId: "{{ vars.spreadsheet_id }}"
    serviceAccount: "{{ secret('GCP_SERVICE_ACCOUNT_JSON') }}"
    on: CREATE
    includeDetails: true
Properties

Spreadsheet ID

Spreadsheet identifier from the URL (docs.google.com/spreadsheets/d/{ID}/...)

Defaultfalse

Specifies whether a trigger is allowed to start a new execution even if a previous run is still in progress.

Defaultfalse

Include change details

If true, fetches sheet data for a lightweight diff summary; increases API calls

DefaultPT5M
Formatduration

Polling interval

How often to check for sheet modifications; default PT5M

DefaultCREATE_OR_UPDATE
Possible Values
CREATEUPDATECREATE_OR_UPDATE

Trigger mode

CREATE (new revisions only), UPDATE, or CREATE_OR_UPDATE (default)

Range filter

Optional A1 range (e.g., A1: D10) to scope change checks

SubTypestring
Default["https://www.googleapis.com/auth/spreadsheets.readonly","https://www.googleapis.com/auth/drive.metadata.readonly"]

OAuth scopes

Scopes applied to the service account credentials; defaults to Sheets readonly and Drive metadata readonly

Service account key

Service account JSON with Sheets and Drive access; must cover spreadsheets.readonly and drive.metadata.readonly scopes

Sheet name filter

Optional tab name to monitor; monitors all tabs when empty

State key

Custom key for state storage; defaults to trigger ID

State TTL

Optional TTL for stored revisions, e.g., P7D

SubTypestring
Possible Values
CREATEDSUBMITTEDRUNNINGPAUSEDRESTARTEDKILLINGSUCCESSWARNINGFAILEDKILLEDCANCELLEDQUEUEDRETRYINGRETRIEDSKIPPEDBREAKPOINTRESUBMITTED

List of execution states after which a trigger should be stopped (a.k.a. disabled).

Defaulttrue

A condition that determines whether the trigger should run.

A Pebble expression evaluated at trigger time. The trigger fires only when the expression evaluates to a truthy value (true, a non-empty string, a non-zero number). Use this to gate trigger execution on dynamic runtime values such as execution labels, flow variables, or environment conditions.

Modification count

Number of revisions that fired this cycle

Sheet modifications

New revisions detected in this poll

Definitions
changeDetails

Change details

Basic range/size info when includeDetails=true

affectedRangestring

Affected range

A1 range evaluated for change details

columnCountinteger

Column count

Columns present in the range

hasDataboolean

Has data

True if any cell in the range contains data

rowCountinteger

Row count

Rows present in the range

lastModifyingUserstring

Last modifying user

Display name of the editor if available

modifiedTimestring
Formatdate-time

Modified time

When the revision was created

revisionIdstring

Revision ID

Drive revision identifier

sheetNamestring

Sheet name

Tab name when filter applied

spreadsheetIdstring

Spreadsheet ID

spreadsheetTitlestring

Spreadsheet title