We're excited to announce that we'll be partnering with Credly starting October 19th - see what this means and read the announcement blog here!

Alteryx Designer Discussions

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

Automatic Triggering of Workflow

Deba93
8 - Asteroid

Hi everyone,

 

My Client wants to automate workflow based on when a new file is updated in the folder. My question is how to trigger the workflow. I can schedule them if there is a fixed time when the file is dumped in the folder, however that isn't the case.

 

Regards,

 

Deba

7 REPLIES 7
Drussek
9 - Comet

If you are familiar with Python you can write script which will observe your directory. If it detects file creation then it can run an Alteryx workflow.

You can use eg watchdog library http://thepythoncorner.com/dev/how-to-create-a-watchdog-in-python-to-look-for-filesystem-changes/

 

Deba93
8 - Asteroid

I tried understanding what the blog said but it is way beyond my scope as I am not much familiar with Python. Any easier alternative to this? Also found out a solution wherein it is saying I need to have Alteryx Automation license to resolve the same. Not getting any clear idea.

shreyanshrathod
11 - Bolide

@Deba93 ,

 

Not completely sure if this is the correct approach,

but you could build a base workflow which will keep polling (reading) the folder.

You can use a combination of Directory tool and other preparation tools to achieve this.

 

If this base file meets the condition, you could then trigger the main workflow (using Runtime EVENTS).

The triggering condition will ofcourse depend upon your specific requirement.

 

Regards,

Shreyansh

Deba93
8 - Asteroid

@shreyanshrathod 

 

I am not able to get that iterative portion of it. I am unable to convert directory tool into macro input as well. any further ideas as to how to iterate the workflow? or how to convert it to iterative macro?

Drussek
9 - Comet

Hi@Deba93 

I've prepared complete python script that observes a choosen dir. Creating a file triggers Alteryx flow.

You must download a file, change his extension to "py". Set in file a path to your dir and your flow.

 

If you would like to run python script as daemon take a look at this solution:

https://stackoverflow.com/questions/50593200/flask-application-with-watchdog-observer

 

 

Deba93
8 - Asteroid

@Drussek 

 

thanks for the file. Few questions that I have are:

 

1. Can I simply copy paste the code into jupyter notebook?

2. Alteryx designer is installed in remote machine and jupyter notebook is installed in my local. How to get about this?

3. Will this line of code work for jupyter notebook? Screenshot below

4. Last one related to Alteryx Engine cmd. I read in the community that to access Alteryx Engine I need to have Alteryx Engine API license. Provided if I don't have that, what other thing can be done.

 

Regards,

 

Deba

Drussek
9 - Comet

Unfortunately, my solution requires running a script on a machine with a designer and with an automation license. 

Alternatively, you can use the Alteryx server API, but in this case the script needs to be modified.

If you dont have any of them, try with other solutions.

Good luck.

Labels