Flow
type: "io.kestra.plugin.core.trigger.Flow"
Trigger a flow in response to a state change in one or more other flows.
You can trigger a flow as soon as another flow ends. This allows you to add implicit dependencies between multiple flows, which can often be managed by different teams.
If you don't provide any conditions, the flow will be triggered for EVERY execution of EVERY flow on your instance.
Examples
This flow will be triggered after each successful execution of flow
company.team.trigger_flow
and forward theuri
ofmy_task
taskId outputs.
id: trigger_flow_listener
namespace: company.team
inputs:
- id: from_parent
type: STRING
tasks:
- id: only_no_input
type: io.kestra.plugin.core.debug.Return
format: "v1: {{ trigger.executionId }}"
triggers:
- id: listen_flow
type: io.kestra.plugin.core.trigger.Flow
inputs:
from-parent: '{{ outputs.my_task.uri }}'
conditions:
- type: io.kestra.plugin.core.condition.ExecutionFlowCondition
namespace: company.team
flowId: trigger_flow
- type: io.kestra.plugin.core.condition.ExecutionStatusCondition
in:
- SUCCESS
Properties
conditions
- Type: array
- SubType: Condition
- Dynamic: ❌
- Required: ❌
List of conditions in order to limit the flow trigger.
inputs
- Type: object
- Dynamic: ❌
- Required: ❌
Fill input of this flow based on output of current flow.
Fill input of this flow based on output of current flow, allowing to pass data or file to the triggered flow
If you provide invalid input, the flow will not be created! Since there is no task started, you can't log any reason that's visible on the Execution UI. So you will need to go to the Logs tabs on the UI to understand the error.
states
- Type: array
- SubType: string
- Dynamic: ❓
- Required: ❌
- Default:
[SUCCESS, WARNING, FAILED, KILLED, CANCELLED, RETRIED]
List of execution states that will be evaluated by the trigger
By default, only executions in a terminal state will be evaluated. If you use a condition of type
ExecutionStatusCondition
it will be evaluated after this list.The trigger will be evaluated on each execution state change, this means that, for non-terminal state, they can be observed multiple times. For example, if a flow has two
Pause
tasks, the execution will transition two times from PAUSED to RUNNING so theses states will be observed two times.
You cannot evaluate on the CREATED state.
stopAfter
- Type: array
- SubType: string
- Dynamic: ❌
- Required: ❌
List of execution states after which a trigger should be stopped (a.k.a. disabled).
Outputs
executionId
- Type: string
- Required: ✔️
The execution ID that triggered the current flow.
flowId
- Type: string
- Required: ✔️
The flow ID whose execution triggered the current flow.
flowRevision
- Type: integer
- Required: ✔️
The flow revision that triggered the current flow.
namespace
- Type: string
- Required: ✔️
The namespace of the flow that triggered the current flow.
state
- Type: string
- Required: ✔️
- Possible Values:
CREATED
RUNNING
PAUSED
RESTARTED
KILLING
SUCCESS
WARNING
FAILED
KILLED
CANCELLED
QUEUED
RETRYING
RETRIED
The execution state.
Definitions
Was this page helpful?