-
Notifications
You must be signed in to change notification settings - Fork 2
/
create-linear-issue-on-failure.yaml
61 lines (52 loc) · 1.87 KB
/
create-linear-issue-on-failure.yaml
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
id: create-linear-issue-on-failure
namespace: system
tasks:
- id: linear
type: io.kestra.plugin.linear.issues.Create
token: your_api_token
team: MyTeamName
title: Workflow failed
description: "{{ trigger.executionId }} has failed on {{ taskrun.startDate }}.
See the link below for more details"
labels:
- Bug
- Workflow
triggers:
- id: on_failure
type: io.kestra.plugin.core.trigger.Flow
conditions:
- type: io.kestra.plugin.core.condition.ExecutionStatusCondition
in:
- FAILED
- WARNING
- type: io.kestra.plugin.core.condition.ExecutionNamespaceCondition
namespace: company
comparison: PREFIX
extend:
title: Create an issue in Linear when a workflow fails
description: >-
This system flow will create an issue in Linear anytime a workflow in a
`company` namespace (or any nested child namespace) fails.
Using this pattern, you can track your Kestra workflow execution incidents
alongside other issues in Linear.
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](https://kestra.io/docs/administrator-guide/monitoring).
Let's create a flow in the namespace with prefix `company` that will always
fail.
```yaml
id: failure_flow
namespace: company.team
tasks:
- id: always_fails
type: io.kestra.plugin.core.execution.Fail
```
Whenever you run the `failure_flow` flow, it will fail. This will result in
the triggering of the `create_linear_issue_on_failure` flow, and it will
create the issue in Linear describing the failed flow by its execution ID
and start date.
tags: []
ee: false
demo: false
meta_description: Create Linear issue on flow execution failure