Using WAM to Improve Workflows

When building workflows in Alteryx, many users are not generally concerned with runtime and efficiency until after the initial workflow is built out and working properly. For example, best practices would suggest including/using Browse tools through the workflow to ensure that everything is working properly and that there are no outliers that are not accounted for. These Browse tools are very useful when troubleshooting the workflow, but when the workflow is moved to production, they require unnecessary processing and can greatly increase the workflow’s runtime. Alteryx Server accounts for this by disabling Browse tools when running workflows, but Designer does not, so manually removing Browse tools can be important for any workflow that is generally run via Designer. However, not all users are aware of this, while others may forget to remove or disable them, causing increased runtimes across the board.

One of the key features in WAM’s workflow Audit Reports is automated suggestions to improve workflows. These recommendations are included at the beginning of each Audit Report and aim to increase the performance and flexibility of workflows. The suggestions to improve performance include things like reducing field sizes and disabling Browse tools to reduce runtimes by decreasing the amount of data being processed.

A lesser known way to improve runtimes is to use Formula tools instead of Data Cleanse tools. WAM will always recommend replacing a Data Cleanse tool in the workflow with a Formula tool. This is because the Data Cleanse tool is a macro that includes ten Multi-Field Formulas. For larger datasets, this can greatly increase runtimes, so it is recommended to use a single Formula or Multi-Field Formula tool to cleanse data so that Alteryx does not have to process the entire dataset more than necessary. For example, one could use a simple replace formula to remove all the whitespace in a field. In the workflow below, a large dataset of over one million records is being cleansed by both the Data Cleanse and Formula tools, but the Data Cleanse tool takes an entire minute to run, compared to the three seconds that the Formula tool takes. When cleansing multiple fields this way, a Multi-Field Formula tool can be used with a runtime closer to the Formula tool rather than the Data Cleansing tool.

Another way that WAM can help improve workflows is by suggesting changes that help with the workflow’s flexibility. To do this, WAM will always make a suggestion when a workflow includes an absolute path or an Auto Field tool. If absolute paths are used, the workflow will be unlikely to work for a different user without remapping the input and output files. This is because the file path will be different for different users, even for shared locations such as SharePoint. Instead, relative paths should be used to ensure that the input/output files are accessed relative to the workflow’s location. A useful article on relative file paths can be found here:

Another way to improve a workflow’s flexibility is to use a Select tool instead of an Auto Field tool. Since the Auto Field tool automatically assigns the smallest data type and size for each tool, the data types and sizes may change when the workflow is run with different data. This can lead to issues further down the data stream. For example, a store has product codes that consist of letters and/or numbers. The store matches each day’s transactions to their database of product codes by using a Join tool. In the database, the product codes are saved as strings since they contain both letters and numbers, but one day, the store only has transactions consisting of product codes with only numbers. The Auto Field tool will change the data type of these codes to an Int16 instead of a string, which will then cause issues with the Join tool that is downstream, since String fields can only be joined to other string fields. Replacing the Auto Field tool with a Select tool that forces the product codes to be a string will solve this issue.

Using the recommendations made by WAM can help users become accustomed to building more efficient, flexible workflows by pointing out areas of potential improvement. This helps users to decrease processing times as well as help them share workflows throughout their organization.