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/get-started.md (append .md) or send Accept: text/markdown to /docs/grafana-cloud/alerting-and-irm/workflows/get-started/. 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.
Get started with Grafana Workflows
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.
This guide walks you through creating your first workflow in Grafana Workflows. You’ll build an incident response automation that reacts when a critical incident is created, creates a Slack channel, assigns a commander, and posts a summary.
Before you begin
To complete this guide, you need:
- A Grafana Cloud account with Workflows enabled for your stack
- Access to a Slack workspace connected to your Grafana Cloud instance
Create a workflow
- In Grafana, navigate to More apps and open the Workflows app.
- Click New workflow.
- Enter a name for your workflow, for example, “Critical Incident Response”.
Choose a trigger
The first step is to choose when your workflow runs. For this example, you’ll trigger the workflow when an incident is updated.
- Select Event as the trigger type, then choose “Incident updated.”
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 the condition field, enter:
textinputs.data.severity == 'critical'The workflow stops if the condition evaluates to
false.
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}.
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 or user ID of your on-call 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}: ${inputs.data.title} Severity: ${inputs.data.severity} Commander assigned.
Test the workflow
Click Test in the header.
Enter a JSON object as the test input, for example:
JSON{ "incidentID": "123", "title": "Database connection pool exhausted", "severity": "critical" }Click Run. The test executes the workflow and you can view the results in Runs.
Enable the workflow
After testing, toggle the workflow to enabled so it runs automatically when matching events arrive.
View the workflow definition
Click JSON in the header to view the complete workflow definition. The following YAML shows the equivalent definition for the workflow you built:
apiVersion: workflows.ext.grafana.com/v1alpha1
kind: Definition
metadata:
name: critical-incident-response
spec:
name: "Critical Incident Response"
enabled: true
startWhen:
matchingRules:
- eventNameRegex: "grafana_irm_app\\.incident\\.created"
steps:
- id: check-severity
type: filter
inputs:
condition: "inputs.data.severity == '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: "oncall@example.com"
role: "commander"
- id: post-summary
type: slack.message.post
inputs:
channelID: "${steps.create-channel.outputs.channelID}"
messageText: "Incident ${inputs.data.incidentID}: ${inputs.data.title}\nSeverity: ${inputs.data.severity}\nCommander assigned."Next steps
Was this page helpful?
Related resources from Grafana Labs


