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 Server Knowledge Base

Definitive answers from Server experts.

Chaining Workflows Together

DanM
Alteryx Community Team
Alteryx Community Team
Created

We receive quite a few questions on how to properly chain workflows together. We have a few options that depend on what Alteryx type you are using.

 

If you have Designer only, your options are to use the Crew Macros which are found on the Community. No link provided as the tools get updated. Please use the Community search for the latest Crew Macros.

 

In the Crew Macros set, the tools that you will be looking to use are the Runner Tools. You can find a description of the tools here Runner Tools.

 

Runners.jpg

 

Note: You will have to create another workflow using these macros to execute the workflows.

 

If you have Designer with Scheduler, you can use the Crew Macros on the Scheduler, but they are not recommended or supported in this configuration. Using Runner Macros on an Alteryx Server or Gallery can risk over-utilization of resources and cause instability in an Alteryx Server or Gallery environment and thus Runner Macros are not supported on Alteryx Server. There are other options that will allow you to use the workflow on the Gallery or Scheduler.

 

When you have Scheduler or Server you have access to the Alteryx Engine Command. This will allow Alteryx to run workflows through the command line to execute additional workflows or programs. In most cases, the AlteryxEngineCmd.exe will be located in C:\Program Files\Alteryx\bin\AlteryxEngineCmd.exe.

 

Great, so what do I do with it?

 

In your Workflow Configuration window, you have a tab called Events. In that tab you can add a Run Command event. You can choose to run the command as:

 

Workflow Events.jpg

 

In the Command: you can either browse to your AlteryxEngineCmd.exe or type in the location like so -C:\Program Files\Alteryx\bin\AlteryxEngineCmd.exe

 

In the Command Arguments [Optional]: You will add the location of the 2nd workflow along with the name of the workflow and file type.

example: "C:\temp HL2.YXMD"

 

VERY IMPORTANT: Notice in the example above that we have quotations around the string. The reason for this is that the command has difficulty with spaces in the directory paths. By putting quotes around the string, this tells the command to essentially ignore the spaces. However, best practice is to not have spaces in your directory paths when using this command.

 

Sample:

 

Event.jpg

 

Note: This method is a great method, but can be finicky. if you are running other command process or do not have admin access to the folders it can cause issues.

 

You have another option as well! You can turn your workflows into apps for either Gallery or Scheduler use and have them run consecutively.

 

When you drag an Interface Tool onto the canvas your workflow will automatically change to an App. If you don't want to use an Interface tool you can still change the workflow to an app to use the chained app option. Once you change the workflow to an app, you can use the Interface Designer window to chain the apps together.

 

Interface.jpg

 

Note: Running Apps via a schedule is not currently supported as you cannot provide the required input at run time. As such you should not be able to schedule an app, and if you can schedule an app the first step in the chain would fail/error due to lack of input. This would cause later steps not to run due to the on success criteria of running the next app in the chain.

 

Want to know more about the Interface Designer?Interface-Designer-Part-1

 

Want to schedule workflows to run consecutively? Check out this article -Scheduling-Workflows-Using-Event-Run-Command



Comments
davidrioux
5 - Atom

Question about how to specify an Alteryx server-hosted workflow/app in the 'On Success - Run Another Analytic App' field.  I can chain and run a second app that I package in the workflow assets when saving/publishing a workflow to server, but I can't see how to point an app to run another app hosted in server.  The file open dialog box beside that field (and the Workflow Dependencies in advanced settings) only points to local resources.  I've not had any success either in trying relative path combinations in the hopes that they would resolve properly to apps/workflows already published in server.  Thanks for any pointers on that!

suemc
6 - Meteoroid

@davidrioux did you find a solution on how to reference another app hosted in server?

 

davidrioux
5 - Atom
@suemc At the time, it required working with support, to implement server API calls. I have not re-investigated since, to see if updated Designer/Server has made this simpler to reference workflows hosted in server.
davidhenington
10 - Fireball

I'm totally confused now. Do i follow these instructions or these: https://community.alteryx.com/t5/Alteryx-Server-Knowledge-Base/Scheduling-Workflows-Using-Event-Run-...

 

They're different! 

davidhenington
10 - Fireball

Quote: "Once you change the workflow to an app, you can use the Interface Designer window to chain the apps together."

 

How do you get the interface designer window to appear? 

 

Edit: I answered my own question: View-->Interface Designer. 

DanielCox
5 - Atom

Really helpful, thanks!

 

Couple of questions:

1. Is there a way to check that the preceding workflow was triggered? (without waiting for the outputs to generate)

2. Does this work on scheduled workflows? For example, I schedule Workflow 1 to run via the controller, and upon successful run Workflow 2 runs, (not sure if this is for manual runs only?)

DanM
Alteryx Community Team
Alteryx Community Team

@DanielCox,

 

1. You can setup using the Events tab in each of the workflow to trigger an email if the workflow fails. You can find that in the workflow configuration window.

 

2. As long as the scheduler can get to the second workflow. you can also create a run command in the same Events tab to trigger a workflow after the first one completes.

DanielCox
5 - Atom

@DanM 

 

Of course! Thanks Dan, appreciate that.

adikam
5 - Atom

I tried using the last method, as I wanted a chained app that enables running two workflows - one after another. 

 

But this didn't work for. 

 

I simply followed the steps which were easy - but my final output file, which should have been generated by the second workflow in the chain, did not get updated.

 

To run the chain, I simply ran my 1st app. 

 

Did anyone else have problems creating a chained app?? I could use some help with this - Thanks

szade1
8 - Asteroid

Hi, 

 

I am trying to chain apps using Events tab in Workflow-Configuration. But after the first workflow runs, it gives me error as

 
 
 
 

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

 

Have I missed something?

 

Thanks,

S.

 

 

angusfenney
5 - Atom

Hi Dan,

 

Thanks for this guide, I have done the app on gallery method for a chain of 14 workflows but when I run the first on gallery it seems only the first two are ran. Is there a way of chaining the 14 together?

 

Thanks

Amadeu_gustavo
7 - Meteor

 

@angusfenney I'm trying the very same, in Analytic App function. Every time worked for the very first chained flow, but no for the third or the following.


So I noticed that any upload to Gallery, I got this error message:

 

Amadeu_gustavo_0-1645651786498.png

 

 

So I realized that when I selected the second workflow in queue in the Interface Designer, it lost the full path:

 

Amadeu_gustavo_1-1645651816107.png

 

To resolve, I just wrote the full path instead of selecting from the browser (for each and every following flow):

Amadeu_gustavo_2-1645651997812.png

 

 
angusfenney
5 - Atom

Thanks a lot Amadeu, I have got this working now @Amadeu_gustavo 

akasubi
8 - Asteroid

Does this work with workflows which use "in-database" tools only?

StephenSink
5 - Atom

This article isn't much help if you're trying to work with workflows published to a server. The Runner tool is not compatible with with the scheduler:

 

" Using Runner Macros on an Alteryx Server or Gallery can risk over-utilization of resources and cause instability in an Alteryx Server or Gallery environment and thus Runner Macros are not supported on Alteryx Server. There are other options that will allow you to use the workflow on the Gallery or Scheduler."

 

In the Run Command Event, you need to specific a UNC file path which is not possible with a workflow on the server because they get packaged. (to the best of my knowledge...).

 

The interface tool has a default timeout of 30 seconds so if workflow 1 takes any longer then 30 seconds then this options doesn't work well either (default time out can be changed but has to be done by server admin).

 

So far i haven't found any good solution to this problem.

JessieC
Alteryx
Alteryx
PaulDJ
5 - Atom

To all the users still experiencing this issue, you may need to have access to the server machines directories. I was experiencing this issue after the changes and tried running as local user with my secondary workflow saved on the server machine and it worked. So you either need to run as local user or the user running needs to have access to the server machine.

Amadeu_gustavo
7 - Meteor

@PaulDJ  it really should work access the server machine and upload from there.
I already had some troubles to upload others connections tools (as Salesforce Input, Sharepoint and more) and we had to upload in this workaround. I thing it happens with every macro that cryptographies a psw, and it would happen some how in chained workflow with simple databases connections.

I'll try later and send an edit.