Documentation for automated readers
A curated documentation index is available at: https://grafana.com/llms.txt
A complete documentation index is available at: https://grafana.com/llms-full.txt
These indexes can help with page discovery before fetching individual documents.
This page is also available in Markdown, which may be easier for automated readers and AI tools to parse than HTML. The Markdown version is available at https://grafana.com/docs/grafana-cloud/alerting-and-irm/workflows/configure-triggers.md, or by sending Accept: text/markdown to https://grafana.com/docs/grafana-cloud/alerting-and-irm/workflows/configure-triggers/. For broader documentation discovery, the curated index is available at https://grafana.com/llms.txt and the complete index is available at https://grafana.com/llms-full.txt.
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 incoming event matches a regular expression pattern.
How event matching works
Events are named according to the pattern {app}.{resource-type}.{event-type}, for example, grafana_irm_app,incident.updated. Workflow matching rules are tested against this name.
Each matching rule is a regular expression. If any rule matches the incoming event name, the workflow starts.
Add an event trigger in the editor
- Select Event as the trigger type when creating or editing a workflow.
- 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:
startWhen:
matchingRules:
- eventNameRegex: "grafana_irm_app\\.incident\\.updated"You can define multiple matching rules. The workflow triggers if any rule matches:
startWhen:
matchingRules:
- eventNameRegex: "grafana_irm_app\\.incident\\.updated"
- eventNameRegex: "grafana_irm_app\\.alertgroup\\.updated"Identify available event sources
The following table lists the available event sources:
| App | Resource | Event | Example event name | Description |
|---|---|---|---|---|
grafana_irm_app | incident | updated | grafana_irm_app.incident.updated | Fires any time an incident is updated. |
grafana_irm_app | alertgroup | updated | grafana_irm_app.alertgroup.updated | Fires any time an alert group is updated. |
grafana_irm_app | schedule | updated | grafana_irm_app.schedule.updated | Fires when the current on-call users change. |
Event names follow the pattern {app}.{resource-type}.{event-type}.
When a workflow triggers on an incident event (grafana_irm_app.incident.*), the engine loads the
incident into the workflow context. Steps can reference it using ${resources.incident.event.title} and similar
expressions. For details, refer to Load incident data.
When a workflow triggers on an alert group event (grafana_irm_app.alertgroup.*), the engine automatically loads the
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 default to UTC.
minute hour day-of-month month day-of-weekAdd a schedule trigger in the editor
- Select Schedule as the trigger type when creating or editing a workflow.
- In the configuration panel, enter a cron expression.
Add schedule triggers in YAML
Define schedules in the startWhen.schedules section of the workflow definition:
startWhen:
schedules:
- "0 9 * * 1-5"Run a schedule in a specific timezone
To run a schedule in a timezone other than UTC, prefix the expression with CRON_TZ=<IANA zone>.
For example, the following schedule runs at 9:00 AM Eastern time on weekdays, accounting for daylight saving time:
startWhen:
schedules:
- "CRON_TZ=America/New_York 0 9 * * 1-5"Use any IANA timezone name, for example, America/Los_Angeles, Europe/London, or Asia/Tokyo.
Bare expressions without a CRON_TZ= prefix run in UTC.
Understand cron syntax
Cron fields support wildcards (*), ranges (1-5), steps (*/10), and lists (1,3,5):
| Field | Range | Special characters |
|---|---|---|
| Minute | 0-59 | *, ,, -, / |
| Hour | 0-23 | *, ,, -, / |
| Day of month | 1-31 | *, ,, -, / |
| Month | 1-12 | *, ,, -, / |
| Day of week | 0-7 (0 and 7 are Sunday) | *, ,, -, / |
The following examples show common schedule patterns:
| Schedule | Meaning |
|---|---|
0 9 * * 1-5 | Every weekday at 9:00 AM UTC |
CRON_TZ=America/New_York 0 9 * * 1-5 | Every weekday at 9:00 AM Eastern time |
*/30 * * * * | Every 30 minutes |
0 0 1 * * | First day of every month at midnight UTC |
Trigger workflows manually
You can manually trigger any workflow from the editor, 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 Run in the editor header.
- In the Trigger Workflow dialog, edit the JSON event payload as needed and click Trigger Workflow.
Workflows expects an event in CloudEvents shape. The fields under data become available in your steps as inputs.data.*. The other fields (id, type, source, time) describe the event itself.
To create a workflow that runs only when manually triggered, leave both matchingRules and schedules empty:
startWhen:
matchingRules: []
schedules: []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.
spec:
runOnceFor: "incident:${inputs.data.incidentID}"
startWhen:
matchingRules:
- eventNameRegex: "grafana_irm_app\\.incident\\..*"Note
runOnceForis not allowed on workflows that use schedule triggers. Scheduled workflows are already deduplicated by their tick timestamp, so combining the two is redundant and the engine rejects it at validation time.
Combine event and schedule triggers
A workflow can have both event and schedule triggers. The workflow starts when any matching rule matches an incoming event or when any schedule fires.
startWhen:
matchingRules:
- eventNameRegex: "grafana_irm_app\\.incident\\.updated"
schedules:
- "0 9 * * 1-5"Next steps
Was this page helpful?
Related resources from Grafana Labs


