EachSequential EachSequential

yaml
type: "io.kestra.core.tasks.flows.EachSequential"

For each value in the list, execute one or more tasks sequentially.

The list of tasks will be executed for each item sequentially. The value must be a valid JSON string representing an array, e.g. a list of strings ["value1", "value2"] or a list of dictionaries [{"key": "value1"}, {"key": "value2"}].

You can access the current iteration value using the variable null. The task list will be executed sequentially for each item.

We highly recommend triggering a subflow for each value. This allows much better scalability and modularity. Check the flow best practices documentation and the following Blueprint for more details.

Examples

yaml
id: "each_sequential"
type: "io.kestra.core.tasks.flows.EachSequential"
value: '["value 1", "value 2", "value 3"]'
tasks:
  - id: each-value
    type: io.kestra.core.tasks.debugs.Return
    format: "{{ task.id }} with current value '{{ taskrun.value }}'"
yaml
id: "each_sequential"
type: "io.kestra.core.tasks.flows.EachSequential"
value: 
- value 1
- value 2
- value 3
tasks:
  - id: each-value
    type: io.kestra.core.tasks.debugs.Return
    format: "{{ task.id }} with current value '{{ taskrun.value }}'"

Properties

tasks

  • Type: array
  • SubType: Task
  • Dynamic:
  • Required: ✔️
  • Min items: 1

value

  • Type:stringarray
  • Dynamic: ✔️
  • Required: ✔️

The list of values for this task

The value car be passed as a String, a list of String, or a list of objects

errors

  • Type: array
  • SubType: Task
  • Dynamic:
  • Required:

List of tasks to run if any tasks failed on this FlowableTask