Google Cloud Trigger

Google Cloud Trigger

Certified

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.

yaml
type: io.kestra.plugin.gcp.gcs.Trigger

Wait for a list of files on a GCS bucket, and iterate through the files

yaml
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

yaml
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

Source prefix

gs:// path to poll for new or updated objects

DefaultNONE
Possible Values
MOVEDELETENONE

Post-detection action

NONE (default), MOVE (requires moveDirectory), or DELETE on source objects after download

Defaultfalse

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

The GCP service account to impersonate

DefaultPT1M
Formatduration

Interval 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.

DefaultDIRECTORY
Possible Values
RECURSIVEDIRECTORY

Listing type

DIRECTORY lists only immediate children; RECURSIVE traverses all descendants. Default DIRECTORY.

Default25

Max files

The maximum number of files to retrieve at once

Move destination

Target gs:// prefix when action is MOVE

DefaultCREATE_OR_UPDATE
Possible Values
CREATEUPDATECREATE_OR_UPDATE

Trigger 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.

The GCP project ID

Regex filter

Optional regex applied to full object path (e.g., .*2020-01-0.\.csv)

SubTypestring
Default["https://www.googleapis.com/auth/cloud-platform"]

The GCP scopes to be used

The GCP service account

State key

Override key used to persist trigger state; defaults to namespace/flow/id

State TTL

Optional TTL for trigger state entries

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.

List of blobs that triggered the flow, each with its change type

Definitions
changeTypestring
Possible Values
CREATEUPDATE
bucketstring
cacheControlstring
componentCountinteger
contentDispositionstring
contentEncodingstring
contentLanguagestring
contentTypestring
crc32cstring
createTimestring
Formatdate-time
customTimestring
Formatdate-time
deleteTimestring
Formatdate-time
etagstring
eventBasedHoldboolean
generatedIdstring
isDirectoryboolean
kmsKeyNamestring
md5string
mediaLinkstring
metaGenerationinteger
metadataobject
SubTypestring
namestring
retentionExpirationTimeinteger
selfLinkstring
sizeinteger
temporaryHoldboolean
timeStorageClassUpdatedstring
Formatdate-time
updateTimestring
Formatdate-time
uristring
Formaturi