Alteryx Server

Find answers, ask questions, and share expertise about Alteryx Server.
Andy Uttley, Alteryx ACE, makes music with Alteryx | Math + Music
SOLVED

Run Workflows by Command Line on Server - Alteryx Gallery

Highlighted
7 - Meteor

Hi Users,

 

Is there a way to run the workflows by command line on Alteryx Server.

 

I came across a help page, which describes the command to trigger the worklfow:

https://help.alteryx.com/2018.3/Command_Line.htm

 

however, here we need to run the workflow from the location where it's saved.

 

Not sure how to achieve it on Server.

 

Secondly, if we are able to run the workflow via command line on server.

and assuming we are triggering it via windows schedular every minute.

 

If it takes longer than 1 minute to run the first execution, would the second run will get queued assuming we have set the server settings to allow only one execution at a time.

 

Is there a way to check via command line, if first execution is on run, not to initiate second execution and do it only when first execution is finished.

Highlighted
16 - Nebula
16 - Nebula

Hi @amitbanwar! What is your use case here? Since you have the alteryx server, it seems like the gallery would be the way to go. That would allow you to schedule a job every minute. I'm not sure what would happen if it took longer than 1 minute, I'm partly guessing, but I think the gallery would just wait to fire the next job until the first one completes.

Highlighted
7 - Meteor

Hi @patrick2

 

Actually, we have a requirement where we need to run the workflow every 5 seconds, this workflow is checking a blob storage for any new files. 

 

If it finds a new file, it triggers another workflow to process that file.

 

With Server Scheduler, we have to wait at least a minute to trigger the next run.

 

We thought it is possible to achieve this scenario using windows scheduler by running a bat file every 5 seconds.

 

or to trigger the same workflow by configuring it's event to trigger it.

 

However, I am not sure how to use the command line to trigger the workflow published on server. As the command line argument requires to provide the path of workflow

 

Any help only this matter will be really appreciated

 

Highlighted
Alteryx Certified Partner

I found this post that may help you get to this frequency.  Basically, you'd have an iterative macro that's iterating every 5 secs to do the file check.  The calling workflow would be always running to allow the file check to continuously occur.

 

https://community.alteryx.com/t5/Alteryx-Designer-Discussions/Event-Driven-Workflow-Triggers-for-Alt...

Highlighted
7 - Meteor

Hello @MattBSlalom 

 

But with Iterative macro, I will need to provide the maximum number of iterations. 


I do not want my workflow to stop unless stopped manually.

 

Is it possible to achieve that with Iterative macro.

 

 

Highlighted
Alteryx Certified Partner

You could provide the number of iterations for 1 minute (60 secs / 5 secs = 12 iterations), then schedule it to run every minute on the server.  So you'll wind up with continuous checking over many individual workflow executions.

Highlighted
Alteryx
Alteryx

Hi @amitbanwar , I also wanted to mention, from an Alteryx Server resource perspective it is not recommended to run workflows outside of the Alteryx Service/Gallery environment.  Workflows run through the Alteryx Gallery and Scheduler use a queuing process to help maintain a balance of the number of workflows running at any given time (workflows allowed to run simultaneously) and the available system resources (RAM and CPU) to allow for workflow execution and to reserve enough resources for the operating system.

 

Workflows that are run via command line on the Alteryx Server are run outside of the queuing process and would be additional load on the server resources. For example if the server is configured to run 4 workflows at any given time (based on server resources), between manually executed and scheduled jobs, and then a workflow is run through the command line, there will be 5 workflows running at once and my put a strain on the server resources. 

 

The suggestions of @patrick_digan and @MattBSlalom would probably be the first place to investigate.

 

This article from @SteveA shows a way to use a command line option to add a workflow to the Sever queue, under the heading 'Scheduling from the command line' which may also be an option for you.

 

 

 

Peter Stoddard
Premium Support Advisor
Alteryx, Inc.