Alteryx designer Discussions

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

terminate workflow and writing in a database in case of error

8 - Asteroid

Hi Community, 


l know that  there are ways around with the "Count" tool to avoid writing in the database after error has occurred during the workflow. However, sometimes we do not only want to Append while writing in the database. So my question is: is there a straight forward icon or setting of the workflow in general which interrupts the workflow and (MORE IMPORTANTLY) the writing in the database once even a single error appears before the writing in the DB at the end of the workflow?


Thank you very much!!! 

Alteryx Certified Partner
Alteryx Certified Partner

Hello @jeanilieski,


You could create with the message tool or with the test tool a condition to run an error when something doesn't add up.


After, you would need to click on the checkbox in the events tool to stop the run after an error has been found (first one from the list on the bottom):




If this post helps, then please consider Accept it as the solution to help the other members find it more quickly.


17 - Castor
17 - Castor

Hi @jeanilieski 


To add to what @afv2688 said, you have to structure your workflow to make sure that the Message tool is actually executed before the Output tool.  Alteryx does not automatically run a workflow from top to bottom, i.e. if you connect 2 tools to the output of a tool, there no guarantee that the top one will execute first.  In order to ensure that the message tool is evaluated before your database write, use a Block Until Done tool with the Message tool stream on output connection 1 like this




with the message type in the Message tool configured to Error.  This, coupled with the workflow setting to Cancel Running Workflow on Error, will stop the output from writing to the database if there is any error.