ALTERYX INSPIRE | Join us this May for for a multi-day virtual analytics + data science experience like no other! Register Now
2 Day Countdown - The Alteryx Community will be temporarily unavailable for a few hours due to scheduled maintenance starting on Thursday, April 22nd at 5pm MDT. Please plan accordingly.

Alteryx Designer Knowledge Base

Definitive answers from Designer experts.

"Error running Event #1: The external program "C:\Program Files\Alteryx\bin\AlteryxEngineCmd.exe" returned an error code: 1: The system could not find the environment option that was entered. (203)" when running workflows from Events

ntobon
Alteryx
Alteryx
Created

Environment Details


When running workflows from Events the following error occurs:

 

Error: Designer x64: The Designer x64 reported: Error running Event #1: The external program "C:\Program Files\Alteryx\bin\AlteryxEngineCmd.exe" returned an error code: 1: The system could not find the environment option that was entered. (203)


Cause


This is expected behavior. Any return code other than "0" will return an error with events or the Run Command tool.


Suppose that you have a Main workflow that runs two Events. When:

1. After Run Without Errors: Run Workflow X using AlteryxEngineCmd.exe
2. After Run With Errors: Run Workflow using AlteryxEngineCmd.exe


Values returned when a Workflows run via command line :
0 - Success
1 - Warnings Exist
2 - Errors Exist

 

- When you run Main workflow, Workflow X runs, but it produces warnings messages (value returned is 1).
- Most programs interpret a return code of anything other than "0" as an error which is why you're having trouble with it. Because it was interpreted as an Error, Workflow Y also runs.
- And Main workflow generates an error:
Designer x64 The Designer x64 reported: Error running Event #2: The external program "C:\Program Files\Alteryx\bin\AlteryxEngineCmd.exe" returned an error code: 2: The system could not find the environment option that was entered. (203)



Resolution


WORKAROUNDS:
 

1. Fix whatever warnings are in the workflow for the program to return a "0" status.
 

2. Change the order of execution of the events. Move Up "After Run With Errors: Run Workflow Y using AlteryxEngineCmd.exe" to the Top and then "After Run Without Errors: Run Workflow X using AlteryxEngineCmd.exe"


3. There is a way to return a different status code via a batch script. The batch file would have to be called directly:
 

AlteryxEngineCmd.exe "C:\Temp\Test_Warning.yxmd"
if %ERRORLEVEL% == 2 (
exit /b 2
)
if %ERRORLEVEL% == 1 (
exit /b 0
)
else (
exit /b 0
)


This will force the batch script to return 0 if there's an error level of 1, still return an error if there is an error in the workflow, or exit with a 0 otherwise (if no warnings or errors). This is honestly probably not the best way to handle it, but this is an easy method people have setup when people have wanted to run additional workflows in events, as warnings would return "1" and cause an "error" in Designer since Designer sees any event that returns anything other than a "0" an error.