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/platform/workflows/get-started.md, or by sending Accept: text/markdown to https://grafana.com/docs/grafana-cloud/platform/workflows/get-started/. 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.
Get started with Grafana Workflows
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.
This guide walks you through creating your first workflow in Grafana Workflows. You’ll build an incident response automation that runs when a critical incident is declared, creates a Slack channel, assigns a commander, and posts a summary.
Before you begin
To complete this guide, you need:
- The Editor basic role and
workflows:write. For details, refer to Manage access. - A Grafana folder you can edit. Every workflow is saved in a folder, and you can’t save one until a folder exists.
- Grafana IRM with Slack connected. For details, refer to Configure Slack for Grafana IRM.
- The email address of the person you want to assign as commander.
- A critical incident to test with. A drill incident works.
Create a workflow
- In Grafana Cloud, open the Workflows app.
- Go to Manage workflows and click New workflow.
- In the Create workflow dialog box, click Start from scratch.
- Click the workflow title and enter a name, for example, “Critical Incident Response”.
Choose a trigger
The trigger decides when your workflow runs. For this example, the workflow runs when an incident is declared. IRM sends an Incident Updated event for every change to an incident, so a filter on the trigger keeps only the event IRM sends when an incident is declared.
Click the trigger node, select Event, then select Incident Updated.
In the Filter field, enter:
textinputs.data.eventKind == 'incident_created'
Load the incident
An incident event carries the incident ID and a description of what changed, but not the full incident.
Fields such as the title and severity come from the incident itself, which Workflows loads as resources.incident.event.
Workflows loads it for you when an IRM event starts the workflow, but not when you start a run with Run.
Declare the incident so it loads in both cases.
- Open the More menu in the editor header and select Settings.
- Select the Resources tab and click Add Resource.
- Set the type to Incident, the name to
event, and the URI toincident://id/${inputs.data.incidentID}.
Add a filter step
To respond only to critical incidents, add a filter step.
Click + on the last node in the workflow tree.
Search for “Filter” in the action palette and select it.
In Condition, enter:
textresources.incident.event.severity.matches('(?i)^critical$')The workflow stops if the condition evaluates to
false. Severity holds the display label, for example,Critical, so the condition ignores case.
Add a Slack channel step
- Click + to add another step.
- Search for “Create Slack Channel” and select it.
- Set the channel name to
inc-${inputs.data.incidentID}. - Open the step’s menu, select Open editor, and set Step ID to
create_channel.
Later steps use the step ID to read this step’s outputs. Step IDs need at least 5 characters. Use lowercase letters, digits, hyphens, or underscores, and start with a letter.
Add a commander assignment step
- Click + to add another step.
- Search for “Add Participant to Incident” and select it.
- Set the incident ID to
${inputs.data.incidentID}. - Set the user ID to the email address of the person you want to assign as commander.
- Set the role to
commander.
Add a notification step
Click + to add another step.
Search for “Post Message to Slack Channel” and select it.
Set the channel ID to
${steps.create_channel.outputs.channelID}to post to the channel you just created.Set the message text to:
textIncident ${inputs.data.incidentID}: ${resources.incident.event.title} Severity: ${resources.incident.event.severity} Commander assigned.
Save and enable the workflow
You need to save and enable the workflow before you can run it.
- Click Save. In the Select a folder dialog box, choose the folder for the workflow. Every workflow belongs to a folder, and the folder controls who can read and edit it. For details, refer to Place a workflow in a folder.
- Turn on Enable.
- Click Save again.
The workflow runs automatically when a critical incident is declared.
Test the workflow
Run the workflow once with your test incident to check each step.
Warning
The test creates a real Slack channel and assigns a real commander to the incident. Manual runs skip the trigger filter, so the filter step is the only check that runs. Use a critical incident, or the workflow stops at the filter step.
Click Run in the editor header.
In the Trigger Workflow dialog box, select an event in Example Event or replace the event with the following JSON. Replace INCIDENT_ID with the ID of your test incident, then click Trigger Workflow.
JSON{ "id": "example-message-id", "type": "grafana_irm_app.incident.updated", "source": "grafana_irm_app/100", "time": "2026-05-21T15:00:00Z", "data": { "incidentID": "<INCIDENT_ID>", "eventKind": "incident_created" } }Workflows expects an event in CloudEvents shape. The fields under
databecome available in your steps asinputs.data.*. The other fields (id,type,source,time) describe the event itself. Workflows loads the incident with this ID from Grafana IRM, so the ID must belong to a real incident. For the fields a real incident event includes, refer to Sample event payloads.To see the results, click the arrow next to Run to open the Latest runs panel. Select the run to inspect each step’s inputs and outputs.
View the workflow definition
Open the More menu in the editor header and select View JSON to view the complete workflow definition. The following YAML shows the equivalent definition for the workflow you built:
apiVersion: workflows.ext.grafana.app/v1alpha1
kind: Definition
metadata:
name: critical-incident-response
annotations:
grafana.app/folder: <FOLDER_UID>
spec:
name: "Critical Incident Response"
enabled: true
startWhen:
matchingRules:
- eventNameRegex: "grafana_irm_app\\.incident\\.updated"
filter: "inputs.data.eventKind == 'incident_created'"
schedules: []
resources:
incidents:
event: "incident://id/${inputs.data.incidentID}"
steps:
- id: check-severity
type: filter
inputs:
condition: "resources.incident.event.severity.matches('(?i)^critical$')"
- id: create_channel
type: slack.channel.create
inputs:
channelName: "inc-${inputs.data.incidentID}"
- id: assign-commander
type: incident.add-participant
inputs:
incidentID: "${inputs.data.incidentID}"
userID: "commander@example.com"
role: "commander"
- id: post-summary
type: slack.message.post
inputs:
channelID: "${steps.create_channel.outputs.channelID}"
messageText: "Incident ${inputs.data.incidentID}: ${resources.incident.event.title}\nSeverity: ${resources.incident.event.severity}\nCommander assigned."Next steps
Was this page helpful?
Related resources from Grafana Labs


