From 1189008ec3022356c483b33f494444127a8ee631 Mon Sep 17 00:00:00 2001 From: Shruti Mantri Date: Tue, 21 Jan 2025 13:51:05 +0530 Subject: [PATCH] feat: add blueprint on executionnamespace flow condition (#38) --- flow-condition-executionnamespace.yaml | 42 ++++++++++++++++++++++++++ 1 file changed, 42 insertions(+) create mode 100644 flow-condition-executionnamespace.yaml diff --git a/flow-condition-executionnamespace.yaml b/flow-condition-executionnamespace.yaml new file mode 100644 index 0000000..c8ba6f1 --- /dev/null +++ b/flow-condition-executionnamespace.yaml @@ -0,0 +1,42 @@ +id: flow-condition-executionnamespace +namespace: demo + +tasks: + - id: send_slack_message + type: io.kestra.plugin.notifications.slack.SlackExecution + url: "{{ secret('SLACK_WEBHOOK') }}" + channel: "#alert-engineering" + executionId: "{{ trigger.executionId }}" + payload: "The workflow execution {{ trigger.executionId }} failed for the flow {{ trigger.flowId }} in the namespace {{ trigger.namespace }}" + +triggers: + - id: flow + type: io.kestra.plugin.core.trigger.Flow + conditions: + - type: io.kestra.plugin.core.condition.ExecutionNamespace + namespace: company.engineering + comparison: PREFIX + states: + - FAILED + +extend: + title: Executes flow on flow trigger with ExecutionNamespace condition + description: >- + This flow trigger executes the flow based on the ExecutionNamespace condition. + When any flow within the namespace as specified under the `namespace` in the + ExecutionNamespace condition enters into the state specified under the `states` + attribute of the Flow trigger, this flow will get triggered. + + In this case, when any flow within namespace having prefix (as `comparison` + attribute is set to `PREFIX`) `company.engineering` enters the `FAILED` state as + defined in the `states` attribute, this flow will get triggered. This flow will send + a slack message about the flow execution that has failed, and in turn resulted in + the triggering of this flow. + + With ExecutionNamespace condition, you can enforce the condition on flow trigger that + is based on the namespace of another flow. + tags: + - Trigger + ee: false + demo: true + meta_description: This flow executes on flow trigger with ExecutionNamespace condition.