Advent of Code is back! Unwrap daily challenges to sharpen your Alteryx skills and earn badges along the way! Learn more now.

Alteryx Designer Desktop Discussions

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

Passing Question Constants When Call Another Workflow by Run Command On Failure

abutabaq
6 - Meteoroid

Hello,

 

I need to update DB field if the analytics app fails for any reason.

Unfortunately there is only 'On Success' option from Interface Designer properties, but I don't know why there is no 'On Failure' setting.

 

I tried to call the workflow by Events --> Add-->Run Command-->Command AlteryxEngineCmd.exe. and passing the xml to the workfolw.

 

My problem now how to pass parameters or constants to the called workflow.

 

I tried sending it between %% with no luck.

 

 

AlteryxEngineCmd.exe D:\Test.yxwz "<WizardValues ShowDebugMessages='False'><Value name='Text'>%Question.Text%</Value></WizardValues>"

 

 

Appreciate  your help.

 

7 REPLIES 7
Raj
16 - Nebula

@abutabaq have you tried run events - After run with error?

abutabaq
6 - Meteoroid

@Raj thanks for your reply. Yes I use events -After run with error. My issue now to pass parameters or constants to the called workflow. How to pass the question inputs to the called workflow? I saw that it passed by using %% in 'Send Email' but it didn't work with 'Run Command' option.

NeoInfiniTech
11 - Bolide

Hello @abutabaq,

 

The reason your parameter cannot be passed with the Run Command option in Events is probably because of this feature (running a workflow or an analytic app using the AlteryxEngineCmd.exe executable) requiring an additional license (Alteryx Designer with Desktop Scheduler or Alteryx Server) to run.

 

It will say "exit code 2" (or maybe "exit code -2") in Workflow Results window but if you pay attention to the Command Prompt window while the Event is running, you might notice the warning 'The Feature "API or FlowChartMode" is not licensed', which is caused by the license issue I previously mentioned.

 

What you can do instead is use the Alteryx (CReW) Runner macro (which I would recommend installing using the standalone installer I prepared for a more standard installation), however this macro can only be called from within a workflow (not including Events as it also counts as calling the executable directly, which is also not allowed) and wizard values unfortunately cannot be passed (please see this idea).

 

Your best bet would be to make use of Control Containers and create a conditional execution of the Control Container which contains the Runner macro, which would run the YXWZ file, however what I would recommend is to first modify the YXWZ from a template YXWZ in a previous Control Container, then run the next Control Container which would now contain the modified YXWZ which contains the value(s) you passed.

 

As modifying a workflow's or analytic app's XML is a bit different than passing it via an interface tool, you would need to modify the target parameter of the target node (tool) contained in the target analytic app's XML.

 

Attached is an example of this scenario, although please be aware that you will first need to install Alteryx (CReW) Runner using the Alteryx Runner Standalone Macro Installation for it to function correctly. 

 

Additionally, there are two attachments named Input_YXWZ_Configuration and Output_YXWZ_Configuration, which displays the correct configuration for Input Data and Output Data when reading and writing YXWZ files. Please pay attention to the configurations, as if you wish to change the path for input file or create a new output file, you will need to configure/reconfigure the tools as displayed in the screenshots.

 

You can change the Message Type of the Message tool from Error to Message and run the workflow again to see how the produced CSV (called from the Analytic App) is changed (output with the value "Unmodified" instead of "Modified"). You can also see Conditional Run.png screenshot to understand how branching logic makes it possible to only execute the part that meets the criteria specified.

 

As there have been many bug fixes for Control Containers (supported for 2023.1 and above), please make sure that you are using the latest patch of the Alteryx Designer version you are on:

 

- 2023.1.1.437 (Patch 9)

- 2023.2.1.226 (Patch 6)

- 2024.1.1.136 (Patch 4)

 

Please note that AMP Engine with Engine Compatibility Mode has been enabled to make it possible for WorkflowModifier.yxmd to run as it contains Control Containers, which are only compatible with AMP Engine, while the Engine Compatibility Mode preserves the sorting order as much as possible.

 

Hope this helps.

apathetichell
19 - Altair

Fantastic answer by @NeoInfiniTech  - I was going to recommend this route - "As modifying a workflow's or analytic app's XML is a bit different than passing it via an interface tool, you would need to modify the target parameter of the target node (tool) contained in the target analytic app's XML." - and recommend using a text input tool and modifying the default value for the text input tool to capture what you want.

diegosantos
8 - Asteroid

Great solution @NeoInfiniTech, hats off

abutabaq
6 - Meteoroid

I will try your solution, but I think it is not license issue. I passed %Mudule%  and it works fine. I cannot just pass Question inputs. Is there a special format to pass them

NeoInfiniTech
11 - Bolide

Hi @abutabaq,

 

As I am not experienced with using the Events feature and do not have the required license to call AlteryxEngineCmd.exe, I would recommend that a user with experience regarding this matter answer this question, one who might hopefully see this topic bumped by this reply. Otherwise, I think the initial solution I provided should be able to achieve the result you require.

Labels