Run Workflows by Command Line
Workflows can be run via command line using AlteryxEngineCmd.exe which is located in the Alteryx program files root directory. You must have an Engine API license to use AlteryxEngineCmd.exe.
Run the analytic app contained in the Workflow >Path tag of AppValues.xml.
AlteryxEngineCmd.exe MyWorkflow.yxmd
AlteryxEngineCmd.exe MyAnalyticApp.yxwz AppValues.xml
AlteryxEngineCmd.exe AppValues.xml
Example return values:
- 0 - Success
- 1 - Warnings Exist
- 2 - Errors Exist
To run workflows via the command line, add the Alteryx root path to your Path System Variables on your computer.
Accessing your system variables will vary between operating systems. The following is the general process.
- On your desktop, access your computer's system security options.
- Access the advanced options.
- Access the environmental variables.
- Access the path variable.
- Edit the variable by typing or pasting the Alteryx path. The default path is C:\Program Files\Alteryx\bin.
Use this method unless you are running the AlteryxEngineCmd.exe from within the Alteryx root folder, or are using the entire path to the executable:
"C:\Program Files\Alteryx\bin\AlteryxEngineCmd.exe" MyWorkflow.yxmd
Functions
AlteryxEngineCmd.exe MyWorkflow.yxmd
This function runs a standard Alteryx workflow (.yxmd) at command line. It is useful for a series of workflows as a batch that needs to be run in sequence.
AlteryxEngineCmd.exe MyWorkflow1.yxmd
AlteryxEngineCmd.exe MyWorkflow2.yxmd
AlteryxEngineCmd.exe MyWorkflow3.yxmd
AlteryxEngineCmd.exe MyAnalyticApp.yxwz AppValues.xml
This function runs an analytic app (.yxwz) and uses the parameters in the AppValues.xml to dynamically configure the analytic app.
The easiest way to build the AppValues.xml file is to build a an analytic app in the Alteryx interface. After building the app, open the Interface Designer >Test View > View. Copy and paste the XML into a text editor and save the file as a .xml file.
<WizardValues ShowDebugMessages="False"> <Value name="FILEINPUT">TEST.CSV</Value> </WizardValues>
AlteryxEngineCmd.exe AppValues.xml
This function is identical to the option above except instead of having the .yxwz and the XML parameters, it uses the XML parameter and embeds the .yxwz reference in the XML.
<WizardValues ShowDebugMessages="False">
<Module>MyAnalyticApp.yxwz</Module>
<Value name="FILEINPUT">TEST.CSV</Value>
</WizardValues>
AlteryxEngineCmd.exe "<<raw xml data stream with no quotation marks or line feeds>>"
This function includes the answers to questions in an analytic app. The XML in an analytic app contains answers to app questions.
AlteryxEngineCmd.exe "<WizardValues ShowDebugMessages="False"><Module>MyAnalyticApp.yxwz</Module><Value name="FILEINPUT">TEST.CSV</Value></WizardValues>"
Change any double quotes in the body of the XML to single quotes.