Welcome to the Alteryx Knowledge Base
How to run a workflow from an event
Created/Edited -
How To
Prerequisites
- A Desktop Automation, Engine API, or Server license is required to use Run Command Events.
Procedure
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.
(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
If there is a space in the folder directory, the folder path and the file name must all be in the Command Arguments surrounded by quotes.
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:
Remember, workflow events to call another workflow must be tested on Server. The Designer licenses do not have this option by default. When uploading a workflow with a Run Command event, all workflows that will run from events must be packaged with the first workflow. Please see the instructions below.
To package the workflows together, first go to Options, User Settings, Edit User Settings, and select the Advanced tab. Next, click on the option to Display Asset Management in Properties Window.
- Go to Options, User Settings, Edit User Settings, Advanced tab and check the option to Display Asset Management In Properties Window.
- Afterward, select an Input or Output tool, the specific tool selected is not important. In the Configuration screen for the tool, notice there is new box icon in the far-left vertical row (highlighted).
- Select the highlighted icon and check if the workflow(s) to be called are detected as possible assets linked to the first workflow. If not, click on the Add Files button and add each one. It can be helpful to put all the workflows in the same folder for tracking purposes.
When saving the first workflow to the Server, select Workflow Options and Manage workflow assets. Make sure each additional workflow is checked. All the checked items will be packaged with the first workflow in the Server’s database.
Additional Information
Was this article helpful?