Source
id: opsgenie-notify-on-failure
namespace: company.team
tasks:
- id: send_notification
type: io.kestra.plugin.notifications.opsgenie.OpsgenieExecution
url: "{{ secret('OPSGENIE_REQUEST') }}"
message: "Kestra Workflow Failure: {{ trigger.executionId }} has failed on {{
taskrun.startDate }}"
alias: ExecutionError
responders:
4513b7ea-3b91-438f-b7e4-e3e54af9147c: team
bb4d9938-c3c2-455d-aaab-727aa701c0d8: user
aee8a0de-c80f-4515-a232-501c0bc9d715: escalation
80564037-1984-4f38-b98e-8a1f662df552: schedule
visibleTo:
4513b7ea-3b91-438f-b7e4-e3e54af9147c: team
bb4d9938-c3c2-455d-aaab-727aa701c0d8: user
priority: P1
tags:
- ExecutionError
- Error
- Fail
- Execution
authorizationToken: sampleAuthorizationToken
executionId: "{{ trigger.executionId }}"
triggers:
- id: on_failure
type: io.kestra.plugin.core.trigger.Flow
conditions:
- type: io.kestra.plugin.core.condition.ExecutionStatus
in:
- FAILED
- WARNING
- type: io.kestra.plugin.core.condition.ExecutionNamespace
namespace: company
comparison: PREFIX
About this blueprint
System Notifications
This system flow will send a notification via Opsgenie anytime a workflow in a company
namespace (or any nested child namespace) fails.
Using this pattern, you can send notifications for Kestra workflow execution failures alongside other notifications.
You can customize that system flow by modifying the task, adding more tasks to the flow or adjusting the trigger conditions. Read more about that pattern in the Administrator Guide.
Let's create a flow in the namespace with prefix company
that will always fail.
tasks:
- id: always_fails
type: io.kestra.plugin.core.execution.Fail
Whenever you run the failure_flow
, it will trigger an execution of the opsgenie_notify_on_failure
flow. As a result, a notification will be sent using Opsgenie so that prompt action can be taken.
More Related Blueprints