This site uses different types of cookies, including analytics and functional cookies (its own and from other sites). To change your cookie settings or find out more, click here. If you continue browsing our website, you accept these cookies.
I know the question has been asked in other threads, but they are a bit old and the suggestions are complicated.
In the Designer, I'm trying to output the workflow name to a database as a way to track how the data has been generated. I know there's the constant [Engine.WorkflowDirectory] that I can use in a Formula tool, is there something equivalent to get the workflow's exact name?
A solution involving parsing the content of the directory wouldn't work, as I can't ensure there's only one workflow in the directory (e.g. because versioning)
I had seen your solution using the registry, but as far as I understand the registry stores the files that were recently opened, not the ones that were run. So if I have multiple versions of the same workflow open, no way to tell which one created the data...
This is a problem I came across, I raised the Idea as it would be very useful for the environment in which I work. My current solution is to add it as a new user constant in the Workflow section of the Workflow Configuration.
1. Create a simple batch file that just outputs an argument to a file (e.g. "echo %1 > file.txt")
2. In the Alteryx workflow, define an event of type "run command", configured as:
- Run Event when: Before run
- Command: the path to the batch file
- Command Arguments: "%Module%" (with the quotes)
Every time the workflows runs, this event will run as first thing and output the module name (=workflow full path) to the text file. It also works if this logic is implemented in a macro (i.e. will output the name of the workflow that launched first, not the macro).
3. In the worfklow, add an input tool to get the "file.txt" back into the workflow, with the workflow name.
Note that it would be way simpler if the workflow name was added to the Engine constants, as mentioned elsewhere!