Configure triggers
Note
Grafana Workflows is currently in public preview. Grafana Labs offers limited support, 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 when you start it manually. 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. Workflows tests each matching rule 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.
- Select an event, for example, Incident Updated. To match a pattern instead, select Custom event and enter a regular expression in Event Name Regex.
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:
When a workflow triggers on an incident event (