Hi,
I'm trying to create workflow that will run periodically in the gallery, check for starting conditions and trigger further processing only when certain starting criteria are met.
To achieve this goal I split the logic into two separate workflows:
- Run_Python.yxmd to check starting conditions
- Python.yxmd process the data
Run_Python.yxmd is using "Conditionall Runner" CReW macro to start processing only when starting criteria are met.
The problem is that when running Python.yxmd in CReW macro, python component fails to start due to:
Internal Error: Unknown InitVar "JupyterTempPath"
Actual logic is very complex and can't be shared online.
Attached simplified workflows to demonstrate the issue.
Run_Python.yxmd Log parser output:
Module | ToolId | MessageType | Message |
[Null] | [Null] | Message | Null] |
Python | [Null] | Message | Alteryx Version: 2020.1.2.24185 |
Python | [Null] | Message | Started running .\Python.yxmd |
Python | 1 | Error | Internal Error: Unknown InitVar "JupyterTempPath" |
Python | 3 | Message | Message 1 record was output |
Python | [Null] | Message | Message Finished in 1.6 seconds with 1 error |
Please advice on how to fix this issue,
or how to conditionally start / stop workflows.
@matt43582 wrote:I've run into this problem, too, and haven't tried this approach yet but I think it should work... what if you "wrapped" the python-using module in a workflow that just called the python-containing workflow using a batch command (~/<<alteryx engine executable>> <<your workflow>>) so that the CReW tool was indirectly calling your python workflow?
Sorry for the rough outline, but busy day and I can't guarantee I'll be able to find my way back to this thread. Going to try it, though.
Yes, this works. This is what I do. I mentioned it above as a valid work-around oops, that was on another similar thread! 🙂
A little more detail, I have a blank workflow with nothing in it. Click in the white space. Configuration window. Events. Run Command. Call a batch file from there. The batch file kicks off the workflow that contains python code. This new workflow that calls the batch file is what is used in the runner.
Inside my batch file I have something like this:
AlteryxEngineCmd.exe "\\file-share-that-gallery-has-access-to\my-workfllow-which-contians-python-code.yxmd"
Let's say this blank workflow which triggers "my-workflow-which-contains-python-code.yxmd" is called "trigger-my-workflow.yxmd. In your Runner, just call "trigger-my-workflow.yxmd" instead of the original one.
NOTE: this only works on Altyerx Server b/c your laptop does not have a scheduler license. Publish the runner to gallery and it will work.
Many thanks for the excellent advice. Unfortunately I do not have the scheduler license, meaning this particular approach does not work. That said it was working fine with Python modules a few weeks ago and, having downgraded when an upgrade potentially caused this, I am a little perplexed. Workflows that do not contain Python work fine.
Going into the crew runner macro the problem is within the AlteryxRunner.exe Run Command. I understand this executable is based on the same separately licensed AlteryxEngineCmd.exe so I've always thought that it was too good to be true but any fix would probably need to be made by Crew.
Any other approaches that might work and not involve AlteryxEngineCmd.exe would be very appreciated.
Thanks very much your advice Matt. If I understand correctly you are advising to use the AlteryxEngineCmd.exe through a Run Command. If so then unfortunately I do not have the scheduler license to use this approach. Any clarity or further ideas would be extremely welcome as my workflows are now running considerably slower :o(
Hello –considered matt43582’s concept of ‘wrapping’ the python module in a run command a little deeper and have found a solution is both compatible with the crew macro runner and also improves reliability and performance of the workflow.
The workflow before extracts HTML from web pages using urllib and this was incompatible with the crew runner macro with the error Internal Error: Unknown InitVar "JupyterTempPath". In truth any python module created this error.
Largely basing new logic on the excellent advice from MattD (https://community.alteryx.com/t5/Alteryx-Designer-Knowledge-Base/How-To-Run-a-Python-Script-in-Alter...) and adding file input and output.
The important extra lines are to read in data and export out for onward processing:
Now it works fine with the runner macro and is twice as fast. Was a bit worried that the input file would not have finished before the python file is run but it works and added conditional logic in the .py script could deal with that issue.