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

Allow error block to access {{taskrun.value}} of failed ForEach #5653

Open
paulgrainger85 opened this issue Oct 25, 2024 · 1 comment · May be fixed by #5654
Open

Allow error block to access {{taskrun.value}} of failed ForEach #5653

paulgrainger85 opened this issue Oct 25, 2024 · 1 comment · May be fixed by #5654
Labels
enhancement New feature or request kind/customer-request Requested by one or more customers

Comments

@paulgrainger85
Copy link

Feature description

Take the example flow here. If this flow breaks during an iteration of ForEach, we should be able to access the value at the current {{taskrun.value}} . However currently this is not passed through as we are no longer in the flowable context

id: errors
namespace: demo

variables:
  current_iteration: ""

tasks:
- id: iterateObjects
  type: io.kestra.plugin.core.flow.ForEach
  concurrencyLimit: 1
  values: '["/tmp/kestra-wd/data/good.csv", "/tmp/kestra-wd/data/error.csv"]'
  tasks:
    - id: debugCurrentIteration
      type: io.kestra.plugin.core.debug.Return
      format: "{{ taskrun.value }}"

    - id: printFileName
      type: io.kestra.plugin.core.log.Log
      message: Let's read CSV {{ taskrun.value }}

    - id: downloadFile
      type: io.kestra.plugin.core.http.Download
      uri: '{{ taskrun.value }}'
  errors:
    - id: printErrorMsg
      type: io.kestra.plugin.core.log.Log
      message: Error reading {{ taskrun.value }}
@paulgrainger85 paulgrainger85 added enhancement New feature or request kind/customer-request Requested by one or more customers labels Oct 25, 2024
@anna-geller
Copy link
Member

error.value will be extra information printed for Flowable that do some sort of iteration

  • taskrun.items for ForEachItem
  • taskrun.value for ForEach
  • loop.iterationCount for WaitFor
  • case for Switch task

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
enhancement New feature or request kind/customer-request Requested by one or more customers
Projects
Status: Backlog
Development

Successfully merging a pull request may close this issue.

2 participants