Alteryx

How to build (even) more robust Alteryx workflows

Ever had a workflow error out due to a change in an input somewhere? Or perhaps a batch macro stops running and you don’t know what the problem is?

Fortunately, Alteryx makes it easy to build alerts into your workflows that tell you what the problem is, where it is, and how to fix it. I would like to share some of the tools that I used extensively at a recent client engagement in order to make our workflows more robust.

Firstly:

Why include alerts when building workflows?

Like documentation, they help other people (or even your future self) troubleshoot and understand a workflow.

There are 3 tools which can help with this. They are:

  •  Test tool
  •  Message tool
  •  Email tool

  1. Test

testtool

This tool can be configured to throw an error when an expected condition is not met. When would we want an error? The canvas configuration pane can be set up to stop the workflow on an error, and the test tool can display a custom test name that will show as ‘failed’ in the Results pane.

 

  1. Message

messagetool

More powerful than the test tool, the message tool comes into its own when you want to build in more sophisticated functionality. At the same time, it is easy to configure. A message tool can result in the output of a message, an error, a field conversion error, a warning (with varying levels of priority), a file input path and description, or a file output path and description. The output expression can be highly customized, and you can choose to have the message go out before the first record, after the last record, subject to a condition, or after the entire workflow has run.

  1. E-mail

emailtool

This is the only tool of the three that is not a Developer tool (in the Developer category/tab of the tool pane). Instead, it is a Reporting tool. It is useful:

  • When you need to alert users aside from the person running the workflow.
  • When running the workflow on Alteryx Gallery (Server).
  • When you want to include more information in the error message than can fit in the Results pane (can also be used with other reporting tools).

Some tips on how to write good (useful) error messages

(This allows us to think about Alteryx within the realm of UI/UX.)

  1. Tell the user what’s wrong in as much detail as possible, including information on where to look for the error. E.g. If it is a batch macro where the filename keeps changing, specify which filename is causing the error. If the problem is that the date has been specified in the wrong format, show the incoming date.
  2. Tell the user what to do next. This is also known as a call to action. Is there something they need to check? How can they fix it? Do they need to alert someone? What do they need to do to get the workflow running again and output the desired results? This can be something like ‘check date format and rerun workflow.’ Alternatively, if no action is required and this is just a warning or if something else has been triggered in another part of the workflow, this might also be something to include in the message.

Example

Let’s look at a simple example now with dates that come in the wrong format and cause a null output from the dateparse tool.

alteryxblog1browse

From the data profiler in the browse tool, I can see that some dates were not parsed properly and resulted in nulls. But with 500+ records, I can’t easily eyeball them and see which ones.

alteryxblog2filter

Using a filter tool, I can see which records these were. However, this is a manual process which requires me being in the workflow. Assuming this is a repeated process, I can use the test tool to get the workflow to flag up if this is a problem or not.

alteryxblog3testtool

alteryxblog4testtoolconfig

In this case, I configured the test tool to display an error in the results pane of the workflow if there were any nulls in the [DateTime_Out] field. I named the test “All dates were processed” as this is the condition that would fail if this error message were to appear.

I can also set up the canvas configuration to get this error to stop the entire workflow.

alteryxblog10canvasconfig

However, the test tool only tells us there is a problem, not where it is, or how big the problem is (has one date failed or has many? Or all?) For this, we can use the message tool.

alteryxblog5messagetool

With the message tool, I can see there were 3 records with misspecified dates. I can see their RecordIDs so I know where to find them in my data set. I can also see what those dates are (and therefore why the dateparse tool does not process them).

In this case, I have set the message tool to output messages rather than errors, so the alerts show up in the “Messages” section of the results pane.

alteryxblog6messages

I could easily have set them to appear as errors, file conversion errors, or other message types:

alteryxblog7messagetooloptions

And in some cases with varying priority levels:

alteryxblog8messagetoolpriorities

There may be times when you need other users (e.g. other stakeholders, or the data providers, who may not be running the workflow) to see the errors. Or the workflow might be running on Alteryx Gallery, and you might want an email alert when errors arise.

When this happens, you can add some reporting tools to your workflow and use an email tool (which happens to be another reporting tool) and you will receive an email with the problem dates, where to find them, and even how to fix the problem (the browse tool shows a preview of what will appear in your email).

alteryxblog9emailtool

Leave a comment