Closed rtl-perse closed 3 weeks ago
sorry, please transfer issue into main kestra repo
This is more complex that it appears, today we only check dependent flow triggers when a flow execution ends, so it's not mandatory to add an ExecutionStatusCondition as the flow trigger will be evaluated only on terminated flow by default.
Which means that this flow:
id: trigger_by_pause
namespace: company.myteam
tasks:
- id: log_trigger_state
type: io.kestra.plugin.core.log.Log
message: "state: {{ trigger.state }}"
triggers:
- id: test_trigger
type: io.kestra.plugin.core.trigger.Flow
conditions:
- type: io.kestra.plugin.core.condition.ExecutionFlowCondition
namespace: company.myteam
flowId: do_pause
Is equivalent to:
id: trigger_by_pause
namespace: company.myteam
tasks:
- id: log_trigger_state
type: io.kestra.plugin.core.log.Log
message: "state: {{ trigger.state }}"
triggers:
- id: test_trigger
type: io.kestra.plugin.core.trigger.Flow
conditions:
- type: io.kestra.plugin.core.condition.ExecutionFlowCondition
namespace: company.myteam
flowId: do_pause
- type: io.kestra.plugin.core.condition.ExecutionStatusCondition
in:
- FAILED
- SUCCESS
- CANCELED
- WARNING
To allow non-terminal status in an ExecutionStatusCondition we would need to evaluate flow triggers for each status change, which means that our default would change to all terminated state to any states, which will be a breaking change and a bad default (a trigger with no restriction on any status will be executed on each state change).
We will need to think internally about what we can offer to meet your needs.
For now I can workaround this issue. I will let you know if this changes. Thank you.
@rtl-perse can you give us more details about your workaround :) ?
Quick fix is not to use trigger but add a send notification task just before the pause task. Eventually I move to another workaround, where I fetch all PAUSED tasks from specific namespace using your REST-API.
Issue description
My goal was to use a Flow trigger with
ExecutionFlowCondition
to get notified via Teams/Slack forPAUSED
human in the loop executions.From my investigation, the
ExecutionFlowCondition
does currently only work with terminal states. Can you add support for transient states such asPAUSED
orQUEUED
? Or if this is not possible, please add this information the documentation.Example Execution Flow:
Trigger Flow (never triggered):