How to use the Alteryx Block Until Done Tool

The Block Until Done Tool in Alteryx is used to control the sequence of workflow execution and helps prevent errors, especially when writing to multiple tabs of the same Excel workbook. In recent versions of Alteryx, Control Containers can also be used for more granular control over the order of workflow execution when there is not a single point of commonality.

The Alteryx Block Until Done Tool allows you to sequence workflow tool order execution and has recently been augmented with control containers

We’ll explain how to use the Alteryx Block Until Done Tool, how to overcome some of it’s limitations, such as only having 3 outputs, how to troubleshoot it when it doesn’t work and how to use Control Containers instead.

Let’s dive in!

What is the Alteryx Block Until Done Tool

The Block Until Done Tool is available in the Developer section of the Alteryx Toolbar. It has one input and 3 outputs, labeled 1, 2, and 3. It’s used to sequence the workflow execution with the section of workflow labeled 1 going first, once completed, output 2 starts, and then 3.

The location of a block until done tool in the Alteryx Developer Toolbar

It’s not necessary to configure the Block Until Done Tool, as the workflow executes sections of the workflow based on the numbered output anchors of the tool itself.

When to use the Block Until Done Tool

The Block Until Done Tool is used to sequence workflows. Common scenarios include needing to use one process to load in data, and a second one that can’t start until data is fully loaded. ETL scenarios often require one set of tools to execute before starting on the next series of tools, and errors can occur when trying to write multiple tabs to the same Excel Output.

When Alteryx released the AMP Engine to speed up workflow processing, a number of issues arose. The AMP engine essentially breaks a workflow into smaller pieces so it can be executed in parallel, which greatly speeds up the processing time. However, it also has meant that workflow developers have less control over the order in which tools execute and can create conflicts or unintended errors.

You should use the Block Until Done Tool any time that you get an error message saying that you can’t write to a file because it’s already in use by another process, assuming you have the file closed or when you need greater control over the order in which a workflow executes.

More information can also be found in the Block Until Done Tool Alteryx Help Article.

Using the Block Until Done Tool for Multiple Outputs

A common scenario is utilizing the Block Until Done Tool to avoid errors when writing multiple tabs to the same Excel Spreadsheet. In the simple sample below, we receive an error message because the file is already in use when Alteryx attempts to write Sheet2 because it’s currently writing Sheet1.

Example of a file in use error in Alteryx when writing to an Excel spreadsheet with multiple tabs

To avoid the error, we can add a Block Until Done Tool before the final output and attach each output to a different output anchor of the Block Until Done Tool. The numbered outputs are the sequence that the workflow will execute. Any section of workflow attached to the 1 output anchor will execute before the 2 output, and 3 output.

Sequencing outputs in Alteryx with a block until done tool

When using this method to output Excel files, make sure to check the configuration of each output tool. If you have the final output in the sequence set to overwrite a file, Alteryx will write multiple tabs to a workbook and then delete it with the final tool in the output sequence which will make it look like the prior output tools didn’t work.

Chaining Block Until Done Tools Together

When you need to sequence more than 3 sections of workflow at a time, connect a second Block Until Done Tool to the 3 output anchor of the first Block Until Done Tool. You can use this method to attach and sequence as many sections of workflow as needed.

Chaining multiple block until done tools together to write more than 3 outputs with one tool

The only drawback to this method is that it can be a bit cumbersome when working with many different sections of workflow to sequence. We recommend trying to keep as many tools aligned to keep the workflow as clean as possible. The more aligned lines are and organized a workflow is, the easier it will be to maintain by the developer or by others.

Block Until Done Requires a Common Data Stream

A pre-requisite to using the Block Until Done Tool is having a common point in your workflow to add one. Because the Block Until Done Tool only has a single input anchor, it has to be added into the workflow when there is a common point of data processing.

The example below shows a workflow where data is being filtered and each filtered output needs to go to its own individual tab of an Excel Workbook. When you run this workflow, it will result in an error because Sheet1 will be in use when attempting to write to Sheet2.

Example of a common data stream that needs to be split

The way to resolve this is by adding a Block Until Done Tool prior to the Filter Tool. Because there is only one input, the Filter Tool needs to be replicated after the Block Until Done Tool.

Splitting a data stream and connecting multiple duplicate tools to a single block until done tool

Only being able to accept a single input is one of the biggest drawbacks to using a Block Until Done Tool. When there are multiple inputs that don’t have a natural point of commonality or when blending data with Join Tools a workaround is needed.

Creating a Common Data Stream with a Union Tool

One way to control the sequence of data in Alteryx when there is no common point in the data stream, is to create one with a Union Tool. Add a Formula Tool prior to a Union Tool to name the section of workflow. Then on the other side of the Union Tool, add a Filter Tool to isolate the desired section of workflow, and a Data Cleanse Tool to remove blank columns.

This method works well when there is not a large amount of data. Data Cleanse Tools specifically can be resource intensive when executing, and running through multiple transformations also may not be practical when working with larger datasets or large complex workflows.

Example of how to combine data into a single stream for later sequencing and splitting using block until done

One alternative to this method, is to sequence a workflow using Control Containers, which were released in Alteryx Designer version 2023.1.

Using Control Containers to Sequence Alteryx Workflows

Control Containers look like regular Alteryx Containers, which are used for organizing workflows but have input and output anchors built into the containers themselves. Users can add tools to the Control Container, and then connect multiple containers using the input and output anchors to sequence the order that the containers run in.

Example of how to use a Control Container in Alteryx to Sequence workflows when a block until done tool won't work

Control Containers are available in the Developer section of the Alteryx Toolbar.

Conclusion

The Block Until Done Tool allows users to sequence the order in which a workflow executes. This can help avoid errors when writing to the same output file, or allows you to input data then process it in the same workflow where you might otherwise have to chain workflows together or manually run them in sequence.

Block Until Done works well when there is a single point in a data stream that can be split after the addition of a Block Until Done Tools. While there are workarounds, such as using a Union Tool to consolidate data into a single point when one doesn’t naturally exist, later versions of Alteryx can take advantage of Control Containers to manually sequence the order of execution.

Scroll to Top