New to Kestra?
Use blueprints to kickstart your first workflows.
Run a scheduled BigQuery aggregation, then publish a structured completion event to a Google Cloud Pub/Sub topic so downstream services and Kestra flows react in real time.
Turn a finished pipeline into an event other systems can react to. This blueprint runs a scheduled Google BigQuery aggregation, then publishes a structured completion event (run id, status, row count) to a Google Cloud Pub/Sub topic. Instead of polling for "is the pipeline done yet?", downstream services and other Kestra flows subscribe to the topic and act the moment the event lands. It solves the classic event-driven orchestration gap: a batch job finishes, but nothing downstream knows until someone wires up a fragile cron offset or a manual handoff.
io.kestra.plugin.core.trigger.Schedule trigger fires on a cron cadence (default 0 7 * * *, shipped disabled so you can review it first).run_aggregation task (io.kestra.plugin.gcp.bigquery.Query) runs the pipeline's SQL with fetchOne: true and captures a row_count.publish_event task (io.kestra.plugin.gcp.pubsub.Publish) publishes a message to the pipeline-events topic using serdeType: JSON. The data object carries run_id, status, and row_count, while attributes (source, flow) ride alongside for subscriber-side filtering.notify task (io.kestra.plugin.email.MailSend) emails the data team to confirm the publish.errors handler (alert_on_failure) emails the data team if the publish fails.GCP authentication is centralized through pluginDefaults, injecting projectId and serviceAccount into every io.kestra.plugin.gcp task.
pluginDefaults.Pub/Sub moves messages but has no scheduler, no aggregation step, and no notion of a pipeline run. Kestra supplies the missing orchestration layer: an event-driven Schedule trigger, automatic retries on transient publish failures, end-to-end execution lineage from query to publish to notification, and a fully declarative YAML definition you can version and review. The completion event becomes a first-class, observable step rather than a side effect buried in application code.
pipeline-events and a source table analytics.daily_orders.GCP_PROJECT_ID: GCP project hosting the Pub/Sub topic and BigQuery dataset.GCP_SERVICE_ACCOUNT: service account key JSON with Pub/Sub publish and BigQuery access.SMTP_HOST: SMTP server host.SMTP_USERNAME: SMTP account username.SMTP_PASSWORD: SMTP account password.topic and the BigQuery sql at your own resources.daily Schedule trigger (it ships disabled: true) and adjust the cron.data object and attributes to match what your consumers expect.pipeline-events with the Pub/Sub trigger to chain pipelines.attributes so each consumer only sees relevant events.