Hey everyone! We're thrilled to announce a major enhancement to Workflows—multi-step functions are now in public beta!
This update transforms how you can build and organize complex logic in your workflows by introducing functions that can execute multiple blocks synchronously as a single, reusable unit.
What's new?
Now, when creating a function in a workflow, you can choose whether a function is single-step or multi-step. A multi-step function operates as a self-contained workflow with optional parameters; it has its own control flow and is assembled in the same way as its parent workflow. It supports most available block types, including logic and response blocks, and emits block-level logs.
Why does it matter?
One of the main reasons we decided to build multi-step functions was because we realized we needed a first-class way to compartmentalize and run a “child” workflow within a “parent” workflow. Today, you might be using one of the following workarounds when taking a series of actions against a single set of records: either stringing multiple loops together, or calling a workflow from another workflow (and incurring more runs as a result).
Multi-step functions in a workflow run synchronously by default and emit block-level logs for much more straightforward debugging. Common use cases include nesting multiple actions in a single loop block to perform a “multi-step loop”, and organizing complex, repeated logic on the canvas.
When should I use a multi-step function vs. calling a separate workflow?
Multi-step functions are a high utility primitive, and are generally most helpful when you need to:
- Consolidate all relevant multi-step tasks (ex: data cleanup or formatting) into a single workflow
- Retain visibility into block-level logs for the child workflow within the parent workflow
Your workflow should call another workflow in cases where:
- The parent workflow should continue running without anticipating the response of the child workflow
- You want a separate run associated with the child workflow for monitoring purposes.
Getting started
To begin using multi-step functions, head to the Functions pane in your Workflow editor. You can create new functions there and start building your multi-block logic sequences. These functions can then be called from anywhere in your workflow, making complex operations more manageable and reusable.
Multi-step functions are available now on Retool Cloud, and on self-hosted instances on v3.114+. We'd love to hear your thoughts and experiences with multi-step functions while building, so please share your feedback and any questions in this thread!