Alteryx Server Knowledge Base

Definitive answers from Server experts.

Scheduling Workflows Using Event Run Command

DanM
Alteryx Community Team
Alteryx Community Team
Created

I had a user recently ask about having an app on their Gallery run, produce an output, and have a second workflow send an email with the output from the app. There are a couple of ways to accomplish this, but I came up with an idea that I thought would be useful to share with the Community as they may find this feature useful for many situations.

 

The idea was to make it simple for the user so that they didn't have to use a chained app. The user just wanted the second workflow to run, but not put the Email tool on the Server. The solution is to use the Events > Run Command in the Workflow Configuration to schedule the email workflow after the app is run.

 

To accomplish the task, you can use a command line option that will add a specified workflow to the scheduler queue.

 

Scheduling a workflow via the Command Line:

 

The Run Command is in the Events tab; click on your Alteryx canvas and in the Workflow Configuration window select Events > Add > Run Command:

 

Run Command.jpg

 

Run Event When: to "After Run"

 

Command:

C:\Program Files\Alteryx\bin\AlteryxService.exe (This may not be exactly where your company has the AlteryxService.exe saved. Please check with your Server Admin.)

 

Command Argument [Optional]:

addtoqueue=C:\location\of\workflow\to\schedule.yxmd,Server name,Controller Token,true

 

Example:

C:\Program Files\Alteryx\bin\AlteryxService.exe addtoqueue=C:\Temp\simpleoutput.yxmd,dib-ps-tst-12,3EA75D9170E4956DC3583C23224BA0898A98376D,true

 

Where to find Server name: On the machine the holds the server - Windows Start>Control Panel>System>Computer Name
 
Where to find the Controller Token: Open your Alteryx System setting on the Server and click Next until you reach the General screen under the Controller section. Click View to see the Controller Token and copy the token.
 
Controller.jpg

 

 

 

 

 

 

 

 

 

 

 

Once the first workflow is run, the Scheduler will queue up the scheduled workflow and run the workflow on the Scheduler immediately.

 

Hopefully, this will give you some creative ideas to use this operation!

Comments
pcatterson
11 - Bolide
This is basically what I want to accomplish, but this article assumes I have administrative access to all the locations/servers involved. Are there workarounds if I have more limited access?
DanM
Alteryx Community Team
Alteryx Community Team

@pcatterson you will have to have access to the .exe and the server in order to run this operation from the command line in Alteryx.

lepome
Alteryx Alumni (Retired)

The broken link in the original post above has been superseded by

https://help.alteryx.com/10.5/index.htm#SchedulerFAQ.htm%3FTocPath%3DAlteryx%2520Scheduler%7C_____3)

DanM
Alteryx Community Team
Alteryx Community Team

Updated link

AhmedAlZabidi
7 - Meteor

Thanks, @DanM for your post,

 

Actually, how can I schedule workflow that exists previous in the scheduler workflows?

 

Because "addtoqueue" parameter takes a long time to upload my workflow to the scheduler, I need to schedule the previously uploaded workflow.

 

DanM
Alteryx Community Team
Alteryx Community Team

@AhmedAlZabidi,

 

 

All of you workflows that are scheduled exist either in a private studio or a collection. You can go to those workflows in either place and schedule them again there. The "addtoqueue" option that you can add in the workflow would automatically reschedule the workflow after the workflow completes. I hope that answers your question.

 

DanM

AhmedAlZabidi
7 - Meteor

Can we schedule a workflow as "Run the workflow from its original location"? we don't need Alteryx to copy the workflow to the scheduler.

cmnflom
6 - Meteoroid

I do not have an admin license - will this method still work if I'm able to get the controller token and server name from one of my server admins?

robert_young
5 - Atom

We have Alteryx Server setup on one VM and we are getting an error that seems odd. Added event with cmd as stated and get error concerning the running of the event and the secondary workflow is not triggered. No other workflows were running.

Thoughts?

 

Error running Event #1: The external program "F:\Program Files\******\AlteryxService.exe" returned an error code: 12: Too many posts were made to a semaphore. (298)