
Google Workspace SheetModifiedTrigger
CertifiedPoll for Google Sheet modifications
Google Workspace SheetModifiedTrigger
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.
type: io.kestra.plugin.googleworkspace.sheets.SheetModifiedTriggerExamples
Monitor entire spreadsheet for changes
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
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)
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
spreadsheetId *Requiredstring
Spreadsheet ID
Spreadsheet identifier from the URL (docs.google.com/spreadsheets/d/{ID}/...)
allowConcurrent Non-dynamicboolean
falseSpecifies whether a trigger is allowed to start a new execution even if a previous run is still in progress.
includeDetails booleanstring
falseInclude change details
If true, fetches sheet data for a lightweight diff summary; increases API calls
interval Non-dynamicstring
PT5MdurationPolling interval
How often to check for sheet modifications; default PT5M
on string
CREATE_OR_UPDATECREATEUPDATECREATE_OR_UPDATETrigger mode
CREATE (new revisions only), UPDATE, or CREATE_OR_UPDATE (default)
range string
Range filter
Optional A1 range (e.g., A1: D10) to scope change checks
scopes array
["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
serviceAccount string
Service account key
Service account JSON with Sheets and Drive access; must cover spreadsheets.readonly and drive.metadata.readonly scopes
sheetName string
Sheet name filter
Optional tab name to monitor; monitors all tabs when empty
stateKey string
State key
Custom key for state storage; defaults to trigger ID
stateTtl string
State TTL
Optional TTL for stored revisions, e.g., P7D
stopAfter Non-dynamicarray
CREATEDSUBMITTEDRUNNINGPAUSEDRESTARTEDKILLINGSUCCESSWARNINGFAILEDKILLEDCANCELLEDQUEUEDRETRYINGRETRIEDSKIPPEDBREAKPOINTRESUBMITTEDList of execution states after which a trigger should be stopped (a.k.a. disabled).
when string
trueA 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.
Outputs
count integer
Modification count
Number of revisions that fired this cycle
modifications array
Sheet modifications
New revisions detected in this poll
io.kestra.plugin.googleworkspace.sheets.SheetModifiedTrigger-ModificationOutput
Change details
Basic range/size info when includeDetails=true
io.kestra.plugin.googleworkspace.sheets.SheetModifiedTrigger-ChangeDetails
Affected range
A1 range evaluated for change details
Column count
Columns present in the range
Has data
True if any cell in the range contains data
Row count
Rows present in the range
Last modifying user
Display name of the editor if available
date-timeModified time
When the revision was created
Revision ID
Drive revision identifier
Sheet name
Tab name when filter applied
Spreadsheet ID
Spreadsheet title