Bring your best ideas to the AI Use Case Contest! Enter to win 40 hours of expert engineering support and bring your vision to life using the powerful combination of Alteryx + AI. Learn more now, or go straight to the submission form.
Start Free Trial

Alteryx Designer Desktop Discussions

Find answers, ask questions, and share expertise about Alteryx Designer Desktop and Intelligence Suite.

Stop workflow after Message tool shows all erros

RVDL
8 - Asteroid

Hi All,

 

I'm trying to do some error logging in my workflow. After checking this forum, I ended up using the Message tool (not sure if it is the best way though).

 

So I set up my Message tool by specifying a check in "Before Rows where Expression is True". The "Message Type" is set to Error. And I have some text in the "Message Expression".

The error messages are showing fine in my log window so that is all good.

 

Now the problem - I want the workflow to stop once the Message tool has printed its final error.

 

I'm not looking for the Runtime option "Cancel Running Workflow on Error" as this will stop the workflow as soon as the first error is encountered. I also would like to see the remaining errors (if any) that this Message tool produces before stopping the workflow.

 

Is this possible at all?

 

Thanks.

 

6 REPLIES 6
dougperez
12 - Quasar

Have you tried to use a control container with the message tool?

dougperez_0-1753879257355.png

 

abacon
13 - Pulsar

@RVDL Here is an option:

1. Have your workflow include the error handling.

2. Create a batch macro that has the rest of the workflow you want to run if everything passes.

3. Create a variable that is based off the tests.

4. Pass the variable into the batch macro and have it trigger 1 of 2 containers - if errors fail, trigger a container that includes an error message saying something along the lines of "errors in workflow". If no errors, trigger the rest of the workflow.

 

See the attached example of how to do this. This workflow creates dummy data, tests it, then passes into a batch macro. The failed records won't run but the records that pass will run. You can switch the configurations of the batch macro to run an actual process through the pass section to test it. This is to show how you can trigger sections of a workflow based on top level parameters so you can have each error message spit out of your error handling section.

 

Additionally, in the top level workflow you will want to turn on Show All Macro Messages in the screenshot.

 

Let me know if this helps.

 

Bacon

 

image.png

RVDL
8 - Asteroid

Hi @dougperez 

 

I'm not sure how to do this. Do I need to configure the Control Container in a specific way?

RVDL
8 - Asteroid

@abacon  I'm not familiar with batch macros so I will have to read up on this functionality. How would I put the remaining workflow into that batch macro?

abacon
13 - Pulsar

@RVDL For sure! Here is a link on Batch macros, they are super easy to setup - https://help.alteryx.com/current/en/designer/apps-and-macros/macros/batch-macro.html

 

1. If you download the workflow I posted, the batch macro is within there so you can just edit that.

2. What you do is build a normal workflow, but before you save - do 1 of 2 things:

      a. Go to Workflow - Configuration pane>Workflow>Under type, select Macro and change the dropdown to be Batch

      b. Either go to the Interface tool section or search Control Parameter and drag it onto the canvas, this will automatically set the workflow to a batch macro.

 

The way this workflow works is it takes the testing variable and changes the containers within the macro based off the value. The pass container disables if the variable is fail, and vice versa.

 

Bacon

dougperez
12 - Quasar

You don't need to configure the control container

Labels
Top Solution Authors