Alteryx Designer Desktop Discussions

Find answers, ask questions, and share expertise about Alteryx Designer Desktop and Intelligence Suite.

Run workflow using Windows task scheduler

NITESH_KUMBHARE
6 - Meteoroid

I have Alteryx workflow saved in my machine.

Due to internal restrictions in my organisation, I am unable to use "workflow schedule" feature of Alteryx.

 

Hence to get an Alternative solution. I am planning to run workflow using Task Scheduler of Windows.

Could you tell me what is the process?

 

Thanks

 

17 REPLIES 17
fluteman
9 - Comet

I simplified it a little bit. This worked! (for me)

 

dim shell
set shell = createobject("wscript.shell")
shell.run("C:\Users\philip.vago\Downloads\challenge_21_start_file_pv.yxmd")
wscript.echo "don't do anything for a few seconds. i'm about to run a scheduled workflow."
wscript.sleep 20000
shell.appactivate "alteryx designer"
shell.sendkeys "^r"
set shell = nothing

jagdeep_singh85
8 - Asteroid

@fluteman

 

Thanks for the solution.

 

Please confirm if you are using this schedule while you are away from system. Because when I am away from system, it is not working. Showing take is completed but alteryx is not executed. 

 

Thanks

Jagdeep Singh

AkisM
10 - Fireball

Getting "The system cannot find the file specified" error with Code: 8007002 and source (null) when running the script. I double checked the path and it's correct. Any ideas? Used the script shown below

 

dim shell
set shell = createobject("wscript.shell")
shell.run("C:\Users\TestUser\Downloads\Testfolder\Testsubfolder\Testworkflow.yxmd")
wscript.echo "don't do anything for a few seconds. i'm about to run a scheduled workflow."
wscript.sleep 20000
shell.appactivate "alteryx designer"
shell.sendkeys "^r"
set shell = nothing

 

EDIT: I had some spaces in my path. Wscript doesn't like spaces for some reason. Removing spaces from the entire path (including filename) worked.

akshaydalvicia
7 - Meteor

For me the workflow opens but it does not do the following action. Does anyone know the reason why? Appreciate it.

pg.hotkey('ctrl', 'r')
akshaydalvicia
7 - Meteor

I resolved it by adding pg.click() before pg.hotkey The problem was that it used to run ctrl+R not in the alteryx app but in any random app which was open.

Madhulika
5 - Atom

Hello all, this forum is super helpful. I could success fully recreated all the steps till step 4. 

The issue that i am facing is that when I schedule the task to run from Task schedular, there are multiple Alteryx workflows already running. 

The cntl R command that is given in python script is being applied to one of the previous workflows and not the new one which is specified in the .py script. 

Alteryx is launched but workflow doesnt run.instead the cntl R is applied to previous existing running ALteryx workflow

 

I am attaching the screenshot, my job is TEST job which needs to be triggers with cntl R , instead the enterprise_* job is considered active and cntl R is applied on that which is cancelled it. 

 

My requirement is to schedule multiple Alteryx workflows at the same time, concurrently using Task schedular. 

 

Any idea how I can achieve this?

 

lgregor
7 - Meteor

This seems to only work if I click on the OK button in the pop up window that says: "don't do anything for a few seconds. i'm about to run a scheduled workflow." Is there a way to make this run without requiring me to click on the OK button? 

rommell
5 - Atom

'Adding some notes on my original comment

'This will only work when the machine is unlocked as the line Shell.SendKeys "^R" is a simulation of user typing it manually.

'If the SendKeys failed to execute the workflow, either run it manually or increase the sleep time

 

dim shell

set shell = createobject("wscript.shell")

shell.run("""alteryx path\alteryxgui.exe""" """workflow full path""") 'Sorry, I missed the closing parenthesis

          'shell.run("C:\Users\philip.vago\Downloads\challenge_21_start_file_pv.yxmd") 'This is applicable for workflow path without any space, otherwise use the triple quote alternative.

wscript.echo "don't do anything for a few seconds. i'm about to run a scheduled workflow." 'Delete this so no dialog appears, I added this as I encountered issues while I was using my machine when the scheduler runs in the background.  It serves as my warning to stop doing anything as Alteryx takes time to launch the workflow. 

wscript.sleep 20000 '- depends how fast your machine is

shell.appactivate "alteryx designer" ' This is needed to make sure the Sendkeys will apply to Alteryx and not any other program currently active

   'If you encounter error like file not found or something similar, check your Task Manager, if you see "Alteryx Designer<suffix>", just add another line shell.appactivate "alteryx designer<suffix>"

shell.sendkeys "^r" 'Simulation of you, typing it in your keyboard, hence, this only works when machine is unlocked.

set shell = nothing

Labels