Google Cloud Pub/Sub Trigger

Google Cloud Pub/Sub Trigger

Certified

Trigger on periodic Pub/Sub pulls

Polls a subscription every interval (default 60s) via the Consume task and starts a Flow when messages are fetched. Use RealtimeTrigger for one-execution-per-message.

yaml
type: io.kestra.plugin.gcp.pubsub.Trigger
yaml
id: gcp_trigger
namespace: company.team

tasks:
  - id: log
    type: io.kestra.plugin.core.log.Log
    message: "Received: {{ trigger.data }}"

triggers:
  - id: trigger
    type: io.kestra.plugin.gcp.pubsub.Trigger
    projectId: test-project-id
    subscription: test-subscription
    topic: test-topic
    maxRecords: 10
Installation

Our standard Docker images already include this plugin. If you use a -slim image or another setup, install it with the following command:

kestractl plugins get io.kestra.plugin:plugin-gcp --compatible-for $KESTRA_VERSION

For kestractl, use your Kestra version with --compatible-for, or specify an exact plugin version.

For Kestra CLI, replace LATEST with a specific version or version range to pin the plugin version.

Properties

The Pub/Sub topic

The Pub/Sub topic. It must be created before executing the task.

Defaultfalse

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

Defaulttrue

Auto-create subscription

Create the subscription when missing; default true

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.

Max duration

Duration limit for a polling run (ISO-8601); optional

Max records

Stop polling iteration after this many messages

The GCP project ID

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

The GCP scopes to be used

DefaultSTRING
Possible Values
STRINGJSON

Serde type

Serializer/deserializer for message payloads; defaults to STRING

The GCP service account

When unset or rendered to an empty value, Application Default Credentials are used (e.g. GOOGLE_APPLICATION_CREDENTIALS or the runtime's attached identity).

SubTypestring
Possible Values
CREATEDSUBMITTEDRUNNINGPAUSEDRESTARTEDKILLINGSUCCESSWARNINGFAILEDKILLEDCANCELLEDQUEUEDRETRYINGRETRIEDSKIPPEDBREAKPOINTRESUBMITTED

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

Subscription

Subscription name; auto-created if autoCreateSubscription is true

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.

Consumed message count

Formaturi

Messages file URI

Kestra storage URI of the file containing consumed messages