Create Workflow
Creates a new workflow for alert handling and notifications. Workflows define how alerts are processed and routed to various integrations like Slack, PagerDuty, webhooks, etc.
Last updated
curl -L \
--request POST \
--url 'https://api.groundcover.com/api/workflows/create' \
--header 'Authorization: Bearer <YOUR_API_KEY>' \
--header 'Content-Type: text/plain' \
--data 'id: example-workflow
description: Example workflow for API documentation
triggers:
- type: alert
filters:
- key: annotations.example-workflow
value: enabled
name: example-workflow
consts:
severity: keep.dictget({{ alert.annotations }}, "_gc_severity", "info")
title: keep.dictget({{ alert.annotations }}, "_gc_issue_header", "{{ alert.alertname }}")
actions:
- name: webhook-action
provider:
type: webhook
config: "{{ providers.webhook-provider }}"
with:
body:
alert_name: "{{ consts.title }}"
severity: "{{ consts.severity }}"'{
"workflow_id": "xxxxx-xxxx-xxxxx-xxxx-xxxxx",
"status": "created",
"revision": 1
}id: workflow-id
description: Workflow description
triggers:
- type: alert
filters:
- key: filter-key
value: filter-value
name: workflow-name
consts:
variable_name: value
actions:
- name: action-name
provider:
type: provider-type
config: provider-config
with:
action-specific-parametersactions:
- if: '{{ alert.status }} == "firing"'
name: slack-action-firing
provider:
config: '{{ providers.integration-name }}'
type: slack
with:
attachments:
- color: '#FF0000'
footer: 'groundcover.com'
footer_icon: 'https://app.groundcover.com/favicon.ico'
text: 'Alert details here'
title: 'Firing: {{ alert.alertname }}'
ts: keep.utcnowtimestamp()
type: plain_text
message: ' '