-
Notifications
You must be signed in to change notification settings - Fork 2
/
failed-alert-gmail.yaml
52 lines (44 loc) · 1.79 KB
/
failed-alert-gmail.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
id: failed-alert-gmail
namespace: system
tasks:
- id: notify
type: io.kestra.plugin.notifications.mail.MailSend
from: [email protected]
username: "{{ secret('G_EMAIL') }}"
password: "{{ secret('G_APP_PASSWORD') }}"
host: smtp.gmail.com
port: 465
subject: Failed Execution - {{ trigger.executionId }}
htmlTextContent: "{{ trigger.executionId }}"
triggers:
- id: on_failure
type: io.kestra.plugin.core.trigger.Flow
conditions:
- type: io.kestra.plugin.core.condition.ExecutionStatusCondition
in:
- FAILED
- WARNING
extend:
title: Set up alerts for failed workflow executions using Gmail
description: >
This system flow will help you set up alerts for failed workflow executions.
Using this pattern, you can manage alerts on failure in one place.
This flow sends an email alert with Gmail whenever a flow execution fails.
If you have 2FA setup on your Google account, you'll need to set up an [App
password](https://myaccount.google.com/apppasswords). Once you've generated
an App password, save it as a secret which you can reference in the
`password` property.
For more information on creating App passwords, check out the guide
[here](https://knowledge.workspace.google.com/kb/how-to-create-app-passwords-000009237).
## Restricting alerts using conditions
You can restrict the flow to only send alerts for specific namespaces by
adding an `ExecutionNamespaceCondition` to the trigger. You can read more
about that in the [Administrator
Guide](https://kestra.io/docs/administrator-guide/monitoring).
tags:
- System
- Notifications
ee: false
demo: false
meta_description: Create an issue in Linear whenever a workflow execution fails in Kestra