Skip to content

Commit

Permalink
fix(docs): foreach vs foreachitem
Browse files Browse the repository at this point in the history
  • Loading branch information
wrussell1999 committed Nov 18, 2024
1 parent 8451b33 commit be3238c
Showing 1 changed file with 13 additions and 0 deletions.
13 changes: 13 additions & 0 deletions content/docs/04.workflow-components/01.tasks/00.flowable-tasks.md
Original file line number Diff line number Diff line change
Expand Up @@ -270,6 +270,19 @@ tasks:
[ForEachItem Task documentation](/plugins/core/tasks/flows/io.kestra.plugin.core.flow.ForEachItem)
::

#### `ForEach` vs `ForEachItem`

Both `ForEach` and `ForEachItem` are similar, but there are specific use cases that suit one over the other:
- `ForEach` generates a lot of [Task Runs](./02.taskruns.md) which can impact performance.
- `ForEachItem` generates separate executions using [Subflows](../10.subflows.md) for the group of tasks. This scales better for larger datasets.

Read more about performance optimization [here](../../14.best-practices/0.flows.md#task-in-the-same-execution).

<div class="video-container">
<iframe src="https://www.youtube.com/embed/JD671J65eGE?si=E2JdGFnssSemXIud" title="YouTube video player" frameborder="0" allow="accelerometer; autoplay; clipboard-write; encrypted-media; gyroscope; picture-in-picture; web-share" referrerpolicy="strict-origin-when-cross-origin" allowfullscreen></iframe>
</div>

---

### AllowFailure

Expand Down

0 comments on commit be3238c

Please sign in to comment.