Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Explore whether we should move the new Flow trigger conditions to preconditions as currently they behave differently than the regular conditions (they require id) #5837

Closed
anna-geller opened this issue Nov 7, 2024 · 3 comments
Labels
area/backend Needs backend code changes enhancement New feature or request

Comments

@anna-geller
Copy link
Member

Feature description

Only those three conditions are currently possible for Flow trigger, this might be a bug

image

if you remove the ID, all conditions appear:
image

@anna-geller anna-geller added area/backend Needs backend code changes enhancement New feature or request labels Nov 7, 2024
@github-project-automation github-project-automation bot moved this to Backlog in Issues Nov 7, 2024
@Ben8t
Copy link
Member

Ben8t commented Nov 8, 2024

What would be the differences between precondition and condition then 🤔 Isn't just a matter of fixing this id behavior ?

Is that condition will be evaluate when execution is actually triggered upstream, working like a if/else condition ? While precondition is the actual trigger definition ?

@anna-geller
Copy link
Member Author

don't worry about the naming - can be executionsCondition, it's a matter of finding a technical solution to ensure that conditions related to flow trigger show up there + find a way to have the ExecutionsWindow or FilteredExecutionsWindow as a map (single condition) instead as a list (multiple conditions)

we keep iterating on this #5856

next meeting to discuss it is on Tuesday
image

@anna-geller anna-geller moved this from Backlog to In progress in Issues Nov 8, 2024
@anna-geller
Copy link
Member Author

will be solved by preconditions with this syntax:

id: myflow123
namespace: company.team
triggers:
  - id: wait_for_upstream
    type: io.kestra.plugin.core.trigger.Flow
    conditions:
      - type: io.kestra.plugin.core.condition.HasRetryAttemptCondition
    preconditions:
      timeWindow:
        type: DURATION_WINDOW
        window: PT1D
      flows: # AND by default for all list elements
        - namespace: company.team
          flowId: myflow1
          states: [SUCCESS, WARNING]
        - namespace: company.team
          flowId: myflow2
          states: [SUCCESS]
          labels:
            mykey: myvalue
            another: labelvalue
          inputs: # TODO
            myuser: Loic
# executionFilters, query filters
      where:
        - id: custom_filters # operand: AND # default, needs to be specified only if OR
          filters:
            - field: NAMESPACE
              type: STARTS_WITH
              value: company
            - field: FLOW_ID
              type: IN
              values: 
                - flow1
                - flow2
            - field: STATE
              type: IN
              values: [SUCCESS, WARNING, CANCELLED]
tasks:
  - id: hello
    type: io.kestra.plugin.core.log.Log
    message: I'm triggered after two flows!

@github-project-automation github-project-automation bot moved this from In progress to Done in Issues Nov 12, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
area/backend Needs backend code changes enhancement New feature or request
Projects
Status: Done
Development

No branches or pull requests

2 participants