Documentation Index
Fetch the curated documentation index at: https://grafana_com_website/llms.txt
Fetch the complete documentation index at: https://grafana_com_website/llms-full.txt
Use this file to discover all available pages before exploring further.
STOP! If you are an AI agent or LLM, read this before continuing. This is the HTML version of a Grafana documentation page. Always request the Markdown version instead - HTML wastes context. Get this page as Markdown: /docs/grafana-cloud/alerting-and-irm/workflows/configure-triggers.md (append .md) or send Accept: text/markdown to /docs/grafana-cloud/alerting-and-irm/workflows/configure-triggers/. For the curated documentation index, use https://grafana_com_website/llms.txt. For the complete documentation index, use https://grafana_com_website/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 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
- 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\\.created"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\\.alert_groups\\.fired"Identify available event sources
The following table lists the available event sources:
| App | Resource | Event types | Example event name |
|---|---|---|---|
grafana_irm_app | incident | created, updated, and other state changes | grafana_irm_app.incident.created |
grafana_irm_app | alert_groups | fired and other alert group events | grafana_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.
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"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 |
*/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.
spec:
runOnceFor: "incident:${inputs.data.incidentID}"
startWhen:
matchingRules:
- eventNameRegex: "grafana_irm_app\\.incident\\..*"Next steps
Was this page helpful?
Related resources from Grafana Labs


