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/load-alert-group-data.md (append .md) or send Accept: text/markdown to /docs/grafana-cloud/alerting-and-irm/workflows/load-alert-group-data/. 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.
Load alert group data
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.
Alert group resources let workflows load full Grafana IRM alert group data and reference individual fields in step inputs. The engine fetches alert groups at the start of workflow execution, before any steps run.
There are two ways alert groups are loaded:
- Automatically for workflows triggered by alert group events
- Explicitly through the
resources.alertgroupssection of the workflow definition
Automatic loading for alert group events
When a workflow triggers on an alert group event (any event matching grafana_irm_app.alertgroup.*), the engine
automatically fetches the full alert group and makes it available under the key event:
spec:
name: Respond to alert group
startWhen:
matchingRules:
- eventNameRegex: "grafana_irm_app\\.alertgroup\\..*"
steps:
- id: notify
type: slack.message.post
inputs:
channelID: "C0123456789"
messageText: "Alert group ${resources.alertgroup.event.title} is ${resources.alertgroup.event.state}"No configuration is required. The engine detects the alert group event, extracts the alert group ID from the event payload, and fetches the current alert group data from the Grafana OnCall API.
Declare alert group resources explicitly
To load alert groups that are not part of the triggering event, declare them in the resources.alertgroups section. Each
entry maps a reference name to an alert group URI using the alertgroup://id/ scheme:
spec:
resources:
alertgroups:
related: "alertgroup://id/IXXDXP5KHEGRY"
current: "alertgroup://id/${inputs.alertGroupID}"Values must use the alertgroup://id/ URI prefix followed by the alert group ID. The id/ path segment
distinguishes ID lookups from future URI types. CEL expressions are supported in the path and are evaluated before the
URI is parsed:
- Literal URIs: A constant alert group URI such as
"alertgroup://id/IXXDXP5KHEGRY". - CEL expressions in the URI: Use
${expression}in the path, for example"alertgroup://id/${inputs.alertGroupID}"to pull the ID from the triggering event data.
Reference alert group fields in step inputs
Access alert group fields using ${resources.alertgroup.<key>.<field>} syntax in step inputs:
steps:
- id: post-summary
type: slack.message.post
inputs:
channelID: "C0123456789"
messageText: |
Alert Group: ${resources.alertgroup.event.title}
State: ${resources.alertgroup.event.state}
Alerts: ${resources.alertgroup.event.alerts_count}Available fields
The alert group object contains fields from the Grafana OnCall API. Common fields include:
| Field | Type | Description |
|---|---|---|
id | string | The alert group identifier. |
title | string | The alert group title. |
state | string | Current state, for example firing or resolved. |
alerts_count | int | Number of alerts in the group. |
created_at | string | When the alert group was created (RFC 3339). |
resolved_at | string | When the alert group was resolved (RFC 3339). |
acknowledged_at | string | When the alert group was acknowledged (RFC 3339). |
silenced_at | string | When the alert group was silenced (RFC 3339). |
The exact fields available depend on the OnCall API response. Refer to the Grafana OnCall API documentation for the complete schema.
Combine automatic and explicit resources
A workflow can use both automatic and explicit alert group resources. When a workflow triggers on an alert group event and also
declares explicit resources, both are available. If an explicit entry uses the key event, it overrides the
auto-loaded alert group:
spec:
startWhen:
matchingRules:
- eventNameRegex: "grafana_irm_app\\.alertgroup\\.updated"
resources:
alertgroups:
related: "alertgroup://id/IXXDXP5KHEGRY"
steps:
- id: compare
type: transform
inputs:
template: "Event alert group: ${resources.alertgroup.event.title}, Related: ${resources.alertgroup.related.title}"In this example, resources.alertgroup.event is auto-loaded from the triggering alert group event, and
resources.alertgroup.related is loaded from the explicitly declared ID.
Error handling
If any alert group fails to load (invalid ID, API unreachable, or authentication failure), the workflow fails immediately before any steps execute. This applies to both auto-loaded and explicitly declared alert groups.
Next steps
Was this page helpful?
Related resources from Grafana Labs


