diff --git a/docs/core_concepts/25_dedicated_workers/index.mdx b/docs/core_concepts/25_dedicated_workers/index.mdx index 6f9d9320e..fe7efa547 100644 --- a/docs/core_concepts/25_dedicated_workers/index.mdx +++ b/docs/core_concepts/25_dedicated_workers/index.mdx @@ -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" /> + +## 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). diff --git a/docs/flows/12_flow_loops.md b/docs/flows/12_flow_loops.md index 5f8bde70e..be17dd561 100644 --- a/docs/flows/12_flow_loops.md +++ b/docs/flows/12_flow_loops.md @@ -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 @@ -55,12 +61,11 @@ 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. @@ -68,4 +73,4 @@ When a flow has been run or tested, you can inspect the details (arguments, logs className="border-2 rounded-xl object-cover w-full h-full dark:border-gray-800" controls src="/videos/inspect_iteration.mp4" -/> \ No newline at end of file +/> diff --git a/docs/flows/22_while_loops.mdx b/docs/flows/22_while_loops.mdx index 7f8548855..ad729c928 100644 --- a/docs/flows/22_while_loops.mdx +++ b/docs/flows/22_while_loops.mdx @@ -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.