Grafana Cloud
Last reviewed: March 30, 2026

Configure triggers

Note

Grafana Workflows is currently in private preview. Grafana Labs offers support on a best-effort basis, and breaking changes might occur prior to the feature being made generally available.

Triggers define when a workflow starts. A workflow can have an event-based trigger, a schedule-based trigger, or run only through manual execution. You can also combine event and schedule triggers in a single workflow.

Configure event triggers

Event triggers start a workflow when an event matches a pattern. Events follow the naming format {app}.{resource-type}.{event-type}.

You define event triggers using matching rules. Each matching rule contains a regular expression that the engine tests against incoming event names. If any rule matches, the workflow starts.

Add an event trigger in the editor

  1. Select Event as the trigger type when creating or editing a workflow.
  2. In the configuration panel, enter a regular expression pattern.

For example, a pattern of grafana_irm_app\.incident\..* triggers the workflow on any incident event.

Add event triggers in YAML

Define matching rules in the startWhen.matchingRules section of the workflow definition:

YAML
startWhen:
  matchingRules:
    - eventNameRegex: "grafana_irm_app\\.incident\\.created"

You can define multiple matching rules. The workflow triggers if any rule matches:

YAML
startWhen:
  matchingRules:
    - eventNameRegex: "grafana_irm_app\\.incident\\.updated"
    - eventNameRegex: "grafana_irm_app\\.alert_groups\\.fired"

Identify available event sources

The following table lists the available event sources:

AppResourceEvent typesExample event name
grafana_irm_appincidentcreated, updated, and other state changesgrafana_irm_app.incident.created
grafana_irm_appalert_groupsfired and other alert group eventsgrafana_irm_app.alert_groups.fired

Event names follow the pattern {app}.{resource-type}.{event-type}.

When a workflow triggers on an incident event (grafana_irm_app.incident.*), the engine automatically loads the full incident data into the workflow context. Steps can reference it using ${resources.incident.event.title} and similar expressions. For details, refer to Load incident data.

Similarly, when a workflow triggers on an alert group event (grafana_irm_app.alertgroup.*), the engine automatically loads the full alert group data into the workflow context. Steps can reference it using ${resources.alertgroup.event.title} and similar expressions. For details, refer to Load alert group data.

Configure schedule triggers

Schedule triggers start a workflow at recurring times using cron syntax. Schedules follow the standard five-field Unix cron format and run in UTC.

text
minute  hour  day-of-month  month  day-of-week

Add a schedule trigger in the editor

  1. Select Schedule as the trigger type when creating or editing a workflow.
  2. In the configuration panel, enter a cron expression.

Add schedule triggers in YAML

Define schedules in the startWhen.schedules section of the workflow definition:

YAML
startWhen:
  schedules:
    - "0 9 * * 1-5"

Understand cron syntax

Cron fields support wildcards (*), ranges (1-5), steps (*/10), and lists (1,3,5):

FieldRangeSpecial characters
Minute0-59*, ,, -, /
Hour0-23*, ,, -, /
Day of month1-31*, ,, -, /
Month1-12*, ,, -, /
Day of week0-7 (0 and 7 are Sunday)*, ,, -, /

The following examples show common schedule patterns:

ScheduleMeaning
0 9 * * 1-5Every weekday at 9:00 AM UTC
*/30 * * * *Every 30 minutes
0 0 1 * *First day of every month at midnight UTC

Trigger workflows manually

You can trigger any workflow manually through the UI or the API, regardless of whether it has event or schedule triggers configured. Manual triggers are useful for testing workflows before enabling them for automatic execution.

To manually trigger a workflow in the editor, click Test and provide sample input data as a JSON object.

Deduplicate workflow runs

The runOnceFor option prevents duplicate workflow executions for the same logical event. It takes a template string that renders against the event data to produce a deduplication key. Use ${...} segments for CEL expressions inside the template.

For example, setting runOnceFor to incident:${inputs.data.incidentID} means that if multiple events arrive for the same incident ID, the workflow runs only for the first event. This is useful when you want to react to an incident exactly once, even if the system produces several related events in quick succession.

YAML
spec:
  runOnceFor: "incident:${inputs.data.incidentID}"
  startWhen:
    matchingRules:
      - eventNameRegex: "grafana_irm_app\\.incident\\..*"

Next steps