GoogleChatExecution icon
Flow icon
ExecutionStatus icon
ExecutionNamespace icon

Send a Google Chat notification when a workflow fails

Send a Google Chat notification when a Kestra workflow fails. Automate real-time failure alerts to keep your team informed of pipeline issues.

Categories
Core
id: failure-alert-googlechat
namespace: company.team

tasks:
  - id: send_notification
    type: io.kestra.plugin.googleworkspace.chat.GoogleChatExecution
    url: "{{ secret('GOOGLE_WEBHOOK') }}"
    text: "Kestra Workflow Failure: {{ trigger.executionId }} has failed on {{
      taskrun.startDate }}"
    executionId: "{{ trigger.executionId }}"

triggers:
  - id: on_failure
    type: io.kestra.plugin.core.trigger.Flow
    conditions:
      - type: io.kestra.plugin.core.condition.ExecutionStatus
        in:
          - FAILED
          - WARNING
      - type: io.kestra.plugin.core.condition.ExecutionNamespace
        namespace: company
        comparison: PREFIX

Get instant Google Chat failure alerts for your Kestra pipelines. This system flow watches every execution across a namespace and its children, and posts a message to a Google Chat space the moment any workflow fails or completes with a warning. It removes the need for manual log checking and gives your team real-time visibility into broken data pipelines, scheduled jobs, and orchestration tasks.

How it works

The flow is triggered by a io.kestra.plugin.core.trigger.Flow trigger rather than a schedule, so it reacts to other executions as they happen.

  1. The trigger uses an io.kestra.plugin.core.condition.ExecutionStatus condition to match executions ending in FAILED or WARNING.
  2. A second io.kestra.plugin.core.condition.ExecutionNamespace condition with comparison: PREFIX scopes the listener to the company namespace and all nested child namespaces.
  3. When both conditions match, the send_notification task of type io.kestra.plugin.googleworkspace.chat.GoogleChatExecution posts a message to your Google Chat space.
  4. The message text embeds {{ trigger.executionId }} and {{ taskrun.startDate }}, and the task passes the failed executionId through so the alert points back to the exact run.

What you get

  • Real-time Google Chat alerts for failed and warning executions.
  • One central listener covering an entire namespace tree, no per-flow setup.
  • Direct reference to the failing execution ID for fast triage.
  • A reusable system flow pattern you can drop into any environment.

Who it's for

  • Data and platform engineers who own pipeline reliability.
  • On-call and SRE teams that triage failures in chat.
  • Teams that already collaborate in Google Chat and want alerts where they work.

Why orchestrate this with Kestra

Google Chat has no awareness of your pipelines and no scheduler that can detect a failed job. Kestra fills that gap. The event-driven Flow trigger fires on execution state changes across many flows at once, something a cron-based tool cannot do. You also get retries, full execution lineage, and a declarative YAML definition that is versioned and reviewable, so your alerting logic lives next to the workflows it monitors.

Prerequisites

  • A Kestra instance (open source or Enterprise).
  • A Google Chat space with an incoming webhook configured.

Secrets

  • GOOGLE_WEBHOOK: the incoming webhook URL for the target Google Chat space.

Quick start

  1. Create an incoming webhook in your Google Chat space and copy its URL.
  2. Store it as the GOOGLE_WEBHOOK secret in Kestra.
  3. Update the namespace value in the ExecutionNamespace condition to match your own namespace prefix.
  4. Add this flow to Kestra and run any flow under that namespace that fails to confirm the alert.

How to extend

  • Add SUCCESS or other statuses to the ExecutionStatus condition to broaden coverage.
  • Enrich the message with links, labels, or {{ trigger.namespace }} and {{ trigger.flowId }} for more context.
  • Chain additional tasks (for example email or PagerDuty) to fan out alerts to multiple channels.
  • Adjust the namespace prefix to monitor different teams or environments.

Links

See How

New to Kestra?

Use blueprints to kickstart your first workflows.