Community Spring Cleaning week is here! Join your fellow Maveryx in digging through your old posts and marking comments on them as solved. Learn more here!

Alteryx Designer Desktop Discussions

Find answers, ask questions, and share expertise about Alteryx Designer Desktop and Intelligence Suite.
SOLVED

Run workflow containing macro from the command line

JeffA
Alteryx Alumni (Retired)

From the command line help pages, I learned that I can use this format to pass parameters into a workflow programmatically:

AlteryxEngineCmd.exe "<WizardValues ShowDebugMessages='False'><Module>MyAnalyticApp.yxwz</Module><Value name='FILEINPUT'>TEST.CSV</Value></WizardValues>"

However, my workflow has a macro in it, and whenever I run the following statement, the macro can't be found. The workflow runs fine from within Alteryx, and used to run fine from the command line until I started running it using the xml string.

My command:

"C:/Program Files/Alteryx/bin/AlteryxEngineCmd.exe" "<WizardValues ShowDebugMessages='False'><Module>a-salesforce-output-test-with-macro.yxwz</Module><Value name='startEpoch'>1503708605</Value></WizardValues>"

Output:

AlteryxEngineCmd.exe Version 11.5.0.31895 c Alteryx, Inc. - All Rights Reserved.
Started running <WizardValues ShowDebugMessages='False'><Module>a-salesforce-output-test-with-macro.yxwz</Module><Value name='startEpoch'>1503708605</Value></WizardValues>
Error - ToolId 80: Cannot find macro "TestMessageV2.yxmc".
ToolId 2: 1 record was output
ToolId 83: startEpoch: 1503708605
Alteryx Engine: Tool #74: Tool #6: 1 records were successfully parsed and 0 were not.
Alteryx Engine: Tool #74: Tool #9: 1 records were True and 0 were False
Finished in 0.694 seconds with 1 error

Cannot find macro "TestMessageV2.yxmc" - I'm assuming I need to pass this into the the xml string but I've tried some different things with no dice. I have a couple of questions.

1. How can I run this workflow that contains a macro from the command line?

2. Is it possible to pass parameters into the sub-macro from the command line?

 

Attached are the Workflow and the Macro used within it.

 

Thanks in advance!

 

PS: The whole purpose of this is for the macro in there to calculate the run time of the workflow and post that along with the test information to an endpoint. If there's a better way to do this that would be great to know too!

Jeff Arnold
Sr. Full Stack Software Engineer | Alteryx
4 REPLIES 4
Joe_Mako
12 - Quasar

I don't have the license rights to test, but my first thought would be to use an absolute path instead of a relative path for the macro reference.

 

Currently in the XML of the .yxwz file, there is a line:

<EngineSettings Macro="TestMessageV2.yxmc" />

What if you changed it to the full path where the .yxmc file is, like:

<EngineSettings Macro="C:\folder\TestMessageV2.yxmc" />

 

JeffA
Alteryx Alumni (Retired)

That was it! Thanks @Joe_Mako :-)

Jeff Arnold
Sr. Full Stack Software Engineer | Alteryx
JeffA
Alteryx Alumni (Retired)

Thanks to @Joe_Mako's excellent observation, I have discovered the proper solution to this problem. You must specify the full path of the module-containing-workflow in the command line as such:

"C:/Program Files/Alteryx/bin/AlteryxEngineCmd.exe" "<WizardValues ShowDebugMessages='False'><Module>C:\Users\jarnold\Desktop\a-salesforce-output-test-with-macro.yxwz</Module><Value name='startDateTime'>1503708605</Value></WizardValues>"

 

Jeff Arnold
Sr. Full Stack Software Engineer | Alteryx
amitbanwar
7 - Meteor

Hi @Joe_Mako 

 

In case of batch macro, it runs only once.

 

Expected it to run for all rows of data individually.

 

Do we need to update the xml for macro as well.

Labels