Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
7 changes: 7 additions & 0 deletions docs/core_concepts/25_dedicated_workers/index.mdx
Original file line number Diff line number Diff line change
Expand Up @@ -50,3 +50,10 @@ Each [run](../5_monitor_past_and_future_runs/index.mdx) will have a Worker group
href="/docs/core_concepts/worker_groups"
/>
</div>

## Dedicated workers for flows

Dedicated workers can also be assigned to a flow. In that case, the dedicated worker will start one runner for each flow step that supports it ([TypeScript](../../getting_started/0_scripts_quickstart/1_typescript_quickstart/index.mdx) and [Python](../../getting_started/0_scripts_quickstart/2_python_quickstart/index.mdx)), eliminating cold start between each execution.
Other steps will be run on the same worker but without any optimization.

To enable it, the process is the same as for scripts, but the "Dedicated Workers" option for that flow has to be enabled in the [flow Settings](../../flows/3_editor_components.mdx#settings).
13 changes: 9 additions & 4 deletions docs/flows/12_flow_loops.md
Original file line number Diff line number Diff line change
Expand Up @@ -42,7 +42,13 @@ Iif set to `true`, all iterations will be run in parallel.

Assign a maximum number of branches run in parallel to control huge for-loops.

![For loop step](../assets/flows/flow_for_loop.png.webp "For loop step")
![For loop step](../assets/flows/flow_for_loop.png.webp 'For loop step')

### Squash

If set to `true`, all iterations will be run on the same worker.
In addition, for supported languages ([TypeScript](../getting_started/0_scripts_quickstart/1_typescript_quickstart/index.mdx) and [Python](../getting_started/0_scripts_quickstart/2_python_quickstart/index.mdx)), a single runner per step will be used for the entire loop, eliminating cold starts between iterations.
We use the same logic as for [Dedicated workers](../core_concepts/25_dedicated_workers/index.mdx), but the worker is only "dedicated" to the flow steps for the duration of the loop.

## Test an iteration

Expand All @@ -55,17 +61,16 @@ You can get a [test](../core_concepts/23_instant_preview/index.mdx) of the curre
description="Test an iteration"
/>


## Iterate on steps

Steps within the flow can use both the iteration index and value. For example with iterator expression `["Paris", "Lausanne", "Lille"]`, for iteration index "1", "Lausanne" is the value.

![Iter value & index](../assets/flows/iter_value_index.png.webp "Iter value & index")
![Iter value & index](../assets/flows/iter_value_index.png.webp 'Iter value & index')

When a flow has been run or tested, you can inspect the details (arguments, logs, results) of each iteration directly from the graph. The forloop detail page lists every iteration status, even if you have a thousand one without having to load them all.

<video
className="border-2 rounded-xl object-cover w-full h-full dark:border-gray-800"
controls
src="/videos/inspect_iteration.mp4"
/>
/>
6 changes: 6 additions & 0 deletions docs/flows/22_while_loops.mdx
Original file line number Diff line number Diff line change
Expand Up @@ -67,6 +67,12 @@ For each step of the flow, an early stop can be defined. The result of the step

If set to `true`, the loop will continue to the next item even if the current item failed.

## Squash

If set to `true`, all iterations will be run on the same worker.
In addition, for supported languages ([TypeScript](../getting_started/0_scripts_quickstart/1_typescript_quickstart/index.mdx) and [Python](../getting_started/0_scripts_quickstart/2_python_quickstart/index.mdx)), a single runner per step will be used for the entire loop, eliminating cold starts between iterations.
We use the same logic as for [Dedicated workers](../core_concepts/25_dedicated_workers/index.mdx), but the worker is only "dedicated" to the flow steps for the duration of the loop.

## Test an iteration

You can get a [test](../core_concepts/23_instant_preview/index.mdx) of the current iteration by clicking on the `Test an iteration` button.
Expand Down