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 Discussions

Find answers, ask questions, and share expertise about Alteryx Server.

Using command line to run a workflow on a different machine

jgolden
7 - Meteor

Hi folks,

 

We're just getting our feet wet over here, and recently brought alteryx into the fold.  We have been regular Tableau users for years, and currently we excute some extract jobs on one machine from batch scripts, which then login and run tabcmd on the tableau server.

 

We are looking to do something similar with Alteryx workflows.  I have been looking for a good example.

 

For instance, say we have a workflow called "travel.yxmd", and we want to run this workflow from a command line on a machine other than the alteryx server.

 

Does anyone have any examples of how this looks on windows 2008 R2 servers?

 

Logging in, and then executing the command?

 

When I say we are new to this, I mean liek weeks old.

 

Is this the satandard command from the directory on the alteryx server:  AlteryxEngineCmd.exe MyWorkflow.yxmd

 

I truly appreciate the help.

 

Thanks,

Jamie

18 REPLIES 18
SteveA
Alteryx
Alteryx

Hi @jgolden,

 

I've had great luck with Microsoft's Sysinternals suite of tools in the past for jobs such as this (specifically a tool called "psexec") and it works well here as well.


First, download the Sysinternals tools from Microsoft's TechNet.  I recommend unpacking the tools to a simple location such as "c:\sysinternals" because these are command-line tools and simple paths make things easier.

 

After downloading and unpacking, open a command shell, navigate to the "c:\sysinternals" directory, and enter "psexec /?".  After accepting the EULA you will see the command line options as shown here:

psexec.png

 

Now, build up your command to run the AlteryxEngineCmd.exe on the remote machine. There are a number of options that can be passed to the AlteryxEngineCmd.exe, but this example assumes there's a module to run in a particular directory (c:\temp\MortgageCalculator.yxwz) and that no parameters are being passed to the module.  The results of the module run will be shown on the machine from which you're running the remote job:

psexec_example.png

Note that you must have a valid user on the target machine and the firewall on the target machine may need to be opened to allow for remote access.  I would encourage caution before dropping a firewall completely.

 

Hopefully this works for you... please let us know if you have success or run into problems.


Best,

Steve A.

 

jgolden
7 - Meteor

Thanks, Steve,

 

I'll give it a go!

fiorano
8 - Asteroid

hi @jgolden

 

did you  get this to work? I am also trying to automate a workflow from a batch file.....

jgolden
7 - Meteor
Hi,

Not exactly. However, I am doing something you may have success with. I've downloaded PSTools on host and target machine, and then created a batch script to run to run the psexec from PSTools to go to the other machine's directory where the batch is, and execute the command.

I'm sure there is a better way, but for what I needed, it worked.




Jamie Golden l Business Intelligence Administrator & Analyst l Grand Circle LLC, Boston MA
Direct (617) 346-6205 l jgolden@oattravel.com
jgolden
7 - Meteor
Actually, we are using alteryx as part of a reporting solution.

A 3rd party tool we use for scheduling, called activebatch, also you to script jobs to trigger based on various completion during nightly, datawarehouse batch jobs.

This is done in ActiveBatch, on a dedicated cluster. When DW batch is done, it riggers on success a scheduled activebatch job, which passes a PSTools command to the Alteryx server, where a bat file is sitting in a directory to run. This bat file runs the alterx command line job which executes a workflow.

As an additional note, this workflow, upon completion, sends an email to the activebatch server, which then triggers a tableau tabcmd job to dun a datasource refresh extract command.

A few moving parts, but works consistently.




Jamie Golden l Business Intelligence Administrator & Analyst l Grand Circle LLC, Boston MA
Direct (617) 346-6205 l jgolden@oattravel.com
jgolden
7 - Meteor
Not sure - that may require some form of authentication locally.

Sorry I don't have more for the desktop version.


Jamie Golden l Business Intelligence Administrator & Analyst l Grand Circle LLC, Boston MA
Direct (617) 346-6205 l jgolden@oattravel.com
SteveA
Alteryx
Alteryx

@fiorano What exactly are you trying to achieve?  I've had good success using Alteryx to generate bat scripts to automate workflow execution, but not [yet] on a remote machine (for example, in the benchmarking app posted here https://community.alteryx.com/t5/Engine-Works-Blog/Measuring-and-Scaling-a-Private-Server/ba-p/8786).

 

Let us know what you're aiming for and perhaps we can assist...

fiorano
8 - Asteroid

Hi @SteveA ,

 

We currently have Alterryx Desktop and a pretty simple workflow.  What I am hoping to do is refresh this workflow from a bat file (rather than opening the workflow in the Designer and running it manually).  

 

Is this possible to achieve?

 

Thanks!

 

Fiorano

 

 

SteveA
Alteryx
Alteryx

@fiorano

 

I'll say "YES" but it depends on what exactly you mean by the phrase "refresh this workflow"?  Can you elaborate?

 

If you haven't yet done so, take a look at the workflow linked at the bottom of the blog post on benchmarking.  It shows how a workflow can be used to update the command line for a bat script which in turn drives the Server on the command line.  The bat script is included in the YXZP package for reference, so that may be a starting point for you.