How to Use Multiple Condition Listener in Kestra​How to ​Use ​Multiple ​Condition ​Listener in ​Kestra

Use multiple condition listeners together.

This flow will start only if multiplecondition-flow-a and multiplecondition-flow-b are successful during the last 24h.

Activation Process

  • Both multiplecondition-flow-a and multiplecondition-flow-b must have executions in a success state.
  • The trigger condition checks for these successful executions within the defined time window (P1D or 24 hours).
  • If both flow executions meet the success condition within the time window, the flow is triggered.
  • Once triggered, the conditions reset.
    • If multiplecondition-flow-a succeeds again, the trigger will not be reactivated immediately. The trigger will wait for a new execution of multiplecondition-flow-b within the next 24 hours following the success of multiplecondition-flow-a. Only when both conditions are met again within the specified time window will the flow be triggered once more.

You need the two flows multiplecondition-flow-a and multiplecondition-flow-b for it to work.

yaml
id: multiplecondition-listener
namespace: io.kestra.demo

description: |
  This flow will start only if `multiplecondition-flow-a` and `multiplecondition-flow-b` are successful during the last 24h.

tasks:
  - id: only-listener
    type: io.kestra.core.tasks.debugs.Return
    format: "children"

triggers:
  - id: multiple-listen-flow
    type: io.kestra.core.models.triggers.types.Flow
    conditions:
      - type: io.kestra.core.models.conditions.types.ExecutionStatusCondition
        in:
          - SUCCESS
      - id: multiple
        type: io.kestra.core.models.conditions.types.MultipleCondition
        window: P1D
        windowAdvance: P0D
        conditions:
          flow-a:
            type: io.kestra.core.models.conditions.types.ExecutionFlowCondition
            namespace: io.kestra.demo
            flowId: multiplecondition-flow-a
          flow-b:
            type: io.kestra.core.models.conditions.types.ExecutionFlowCondition
            namespace: io.kestra.demo
            flowId: multiplecondition-flow-b