Skip to content

If statement condition evaluation fail #5812

Closed
@wrussell1999

Description

Describe the issue

Example flow:

id: for_loop_example
namespace: company.team

tasks:
  - id: for_each
    type: io.kestra.plugin.core.flow.ForEach
    values: ["value 1", "value 2", "value 3"]
    tasks:
      - id: before_if
        type: io.kestra.plugin.core.debug.Return
        format: "Before if: {{ taskrun.value }}"
      - id: if
        type: io.kestra.plugin.core.flow.If
        condition: "{{ taskrun.value equals 'value 2' }}"
        then:
          - id: after_if
            type: io.kestra.plugin.core.debug.Return
            format: "After if: {{ parent.taskrun.value }}"

This works on latest 19.8. But on develop, it throws the following error when it gets to the if task.

Unable to resolve state from the Flowable task: Unable to find the 'evaluationResult' output, this may indicate that the condition evaluation fail, check your execution logs for more information.

I tried replacing the condition with just true to remove any issues with the taskrun expression but the same error. I was able to get an if statement working without ForEach. Example used below:

Example that worked with an if statement
id: if
namespace: company.team

inputs:
  - id: string
    type: STRING
    required: true

tasks:
  - id: if
    type: io.kestra.plugin.core.flow.If
    condition: "{{ inputs.string == 'Condition' }}"
    then:
      - id: when_true
        type: io.kestra.plugin.core.log.Log
        message: "Condition was true"
    else:
      - id: when_false
        type: io.kestra.plugin.core.log.Log
        message: "Condition was false"

Environment

  • Kestra Version: develop
  • Commit Hash: 4259466
  • Edition: OSS

Metadata

Assignees

Labels

area/backendNeeds backend code changesbugSomething isn't working

Type

No type

Projects

  • Status

    Done

Milestone

No milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions