
Google Cloud Trigger
CertifiedTrigger on new or updated GCS objects
Google Cloud Trigger
Trigger on new or updated GCS objects
Polls GCS every interval (default 60s) under from with optional regex. Detects CREATE or UPDATE (configurable), downloads matching files to internal storage, and can MOVE or DELETE them to avoid retriggering.
type: io.kestra.plugin.gcp.gcs.TriggerExamples
Wait for a list of files on a GCS bucket, and iterate through the files
id: gcs_listen
namespace: company.team
tasks:
- id: each
type: io.kestra.plugin.core.flow.ForEach
values: "{{ trigger.blobs | jq('.[].uri') }}"
tasks:
- id: return
type: io.kestra.plugin.core.debug.Return
format: "{{ taskrun.value }}"
triggers:
- id: watch
type: io.kestra.plugin.gcp.gcs.Trigger
interval: "PT5M"
from: gs://my-bucket/kestra/listen/
action: MOVE
moveDirectory: gs://my-bucket/kestra/archive/
Wait for a list of files on a GCS bucket and iterate through the files. Delete files manually after processing to prevent infinite triggering
id: gcs_listen
namespace: company.team
tasks:
- id: each
type: io.kestra.plugin.core.flow.ForEach
values: "{{ trigger.blobs | jq('.[].uri') }}"
tasks:
- id: return
type: io.kestra.plugin.core.debug.Return
format: "{{ taskrun.value }}"
- id: delete
type: io.kestra.plugin.gcp.gcs.Delete
uri: "{{ taskrun.value }}"
triggers:
- id: watch
type: io.kestra.plugin.gcp.gcs.Trigger
interval: "PT5M"
from: gs://my-bucket/kestra/listen/
action: NONE
Properties
from *Requiredstring
Source prefix
gs:// path to poll for new or updated objects
action string
NONEMOVEDELETENONEPost-detection action
NONE (default), MOVE (requires moveDirectory), or DELETE on source objects after download
allowConcurrent Non-dynamicboolean
falseSpecifies whether a trigger is allowed to start a new execution even if a previous run is still in progress.
impersonatedServiceAccount string
The GCP service account to impersonate
interval Non-dynamicstring
PT1MdurationInterval between polling.
The interval between 2 different polls of schedule, this can avoid to overload the remote system with too many calls. For most of the triggers that depend on external systems, a minimal interval must be at least PT30S. See ISO_8601 Durations for more information of available interval values.
listingType string
DIRECTORYRECURSIVEDIRECTORYListing type
DIRECTORY lists only immediate children; RECURSIVE traverses all descendants. Default DIRECTORY.
maxFiles integerstring
25Max files
The maximum number of files to retrieve at once
moveDirectory string
Move destination
Target gs:// prefix when action is MOVE
on string
CREATE_OR_UPDATECREATEUPDATECREATE_OR_UPDATETrigger event type
Defines when the trigger fires.
CREATE: only for newly discovered entities.UPDATE: only when an already-seen entity changes.CREATE_OR_UPDATE: fires on either event.
projectId string
The GCP project ID
regExp string
Regex filter
Optional regex applied to full object path (e.g., .*2020-01-0.\.csv)
scopes array
["https://www.googleapis.com/auth/cloud-platform"]The GCP scopes to be used
serviceAccount string
The GCP service account
stateKey string
State key
Override key used to persist trigger state; defaults to namespace/flow/id
stateTtl string
State TTL
Optional TTL for trigger state entries
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
blobs array
List of blobs that triggered the flow, each with its change type
io.kestra.plugin.gcp.gcs.Trigger-TriggeredBlob
CREATEUPDATEdate-timedate-timedate-timedate-timedate-timeuri