Alteryx Designer

Definitive answers from Designer experts.
Andy Uttley, Alteryx ACE, makes music with Alteryx | Math + Music

How to run a workflow from an event

Alteryx
Alteryx
Created

How to run a workflow from an event

 

A Run Command Event can run another workflow automatically when the first workflow finishes.

 

Prerequisites

 

A Desktop Automation, Engine API, or Server license is required to use Run Command Events.

 

Procedure

 

Click in a blank space on the Canvas, then go to the Workflow – Configuration screen and select the Events tab. Next, click on Add and Run Command.

 

The Run Event When options are:

  • Before Run: Runs the command before the workflow runs.
  • After Run: Runs the command after the workflow runs.
  • After Run with Errors:Runs the command after the workflow, but only if the workflow ran with errors.
  • After Run Without Errors: Runs the command after the workflow, but only if the workflow ran without error.
  • Disabled:Turns the event off.

Command: should be set to C:\Program Files\Alteryx\bin\AlteryxEngineCmd.exe

(change C: if necessary to the drive with the Alteryx installation)

Command Arguments: list the workflow name run by the event, including the file extension .yxmd.

Working Directory: set to the folder location of the workflow run by the event

 

EricWe_0-1582514167871.png

 

Alternatively, you can have the event run the workflow from a batch file. Other commands can run from a batch file as well.

 

Start with a new Notepad document and add the commands using this syntax.

“C:\Program Files\Alteryx\bin\AlteryxEngineCmd.exe” C:\Alteryx\Workflows\ EventWorkflow.yxmd

 

First, call the AlteryxEngineCmd with the full path enclosed in double-quotes. Use quotes for any command where the folder path has a space, such as between the words in the folder name Program Files. Next, add a space, and then the location of the workflow the event will run, including the workflow name and file extension.

 

After saving the file, right-click, select Rename, and then change the file extension from .txt to .bat. The file is ready to use in a Run Command Event. Just call the batch file in the Command, for example:

 

EricWe_1-1582514167876.png

 

Additional Resources

 

Workflow Configuration Help Page

Scheduling Workflows Using Event Run Command

 

Comments
7 - Meteor

Eric,

Would the workflow or workflows executed this way be queued on the Controller?  We have Alteryx Server.  If I was using this method (C:\Program Files\Alteryx\Bin\Alteryxengine.exe MyWorkflow.yxmd) from an external scheduler how would that impact performance?  Any further detail is appreciated.

 

Thank You,

 

Tim

Alteryx
Alteryx

Hi @TimN

 

Yes, the workflow events can be run on the Server. Since the events occur sequentially, it should not affect performance in terms of exceeding the limit for simultaneous workflows configured in System Settings. The best practice is to divide the number of processor cores by two and not exceed that number in the simultaneous workflows setting. If the limit is reached based on that setting, other workflows may queue up and wait to be processed.

7 - Meteor

Eric,

Thanks!

 

Tim

6 - Meteoroid

@ericwe

 

Can you please confirm that one needs to have the Alteryx Server Engine API License in order to utilize a command such as:

 

C:\Program Files\Alteryx\Bin\Alteryxengine.exe MyWorkflow.yxmd

 

Server 2020.2.3.27789

 

Steven

Alteryx
Alteryx

Hi @smysnbrg

 

You can also run a workflow from the Command Prompt with a Designer Desktop Automation license. 

8 - Asteroid

I keep getting this error...

The external program "C:\Program Files\Alteryx\bin\AlteryxEngineCmd.exe" returned an error code: 1: Too many posts were made to a semaphore. (298).

 

Any ideas.  Search didn't turn up much.

Alteryx
Alteryx

HI @FreeRangeDingo

 

The error could have many possible causes. Please contact support@alteryx.com so we can research it further.