Skip to content

When using if and loop together, the if only seems to apply to the first iteration. #858

Closed
@graza-io

Description

I would expect that the below would result in the step test not being run, but seemingly it runs.

mod "local" {
  title = "if-loop"
}

pipeline "test" {

  param "messages" {
    type = list(string)
    default = ["a", "b", "c"]
  }

  step "message" "test" {
    notifier = notifier["default"]
    if = false
    loop {
      until = loop.index == length(param.messages)-1
    }
    text = param.messages[loop.index]
  }
}

Output:

❯ flowpipe pipeline run test
[flowpipe] Execution ID: exec_cpp8ubqhc8a7fgmhlkdg
[test] Starting pipeline
[test.test[0]] Skipped
[test.test[1]] Starting message: b
[test.test[1]] Arg text = b
[test.test[1]] Complete 1ms
[test.test[2]] Starting message: c
[test.test[2]] Arg text = c
[test.test[2]] Complete 0ms
[test] Complete 52ms exec_cpp8ubqhc8a7fgmhlkdg

Activity

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Assignees

No one assigned

    Labels

    bugSomething isn't workingstale

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions