alteryx server Knowledge Base

Definitive answers from Server experts.

Chaining Workflows Together

Community Operations Manager
Community Operations Manager
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\NHL2.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: When creating chained workflows to use in the Scheduler and Gallery, the workflows and Assets for the workflow must be placed on the Server. Also, the Server will need to have access to any database connections, file directories, and input files. 

 

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
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!

6 - Meteoroid

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

 

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.
9 - Comet

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! 

9 - Comet

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. 

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?)

Community Operations Manager
Community Operations Manager

@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.

5 - Atom

@DanM 

 

Of course! Thanks Dan, appreciate that.