Hi,
I've built a macro that is designed to be used multiple times in the same workflow, and that macro has a Python tool inside it. When I use the macro once in a workflow it works perfectly. However if I use multiple instances of the macro in a workflow (whether parallel or sequentially) then the Python tool in at least one instance of the macro will see the data input for another instance of the macro. This seems like a bug to me...I've got a workaround I'm not very happy with and I'm hoping I can get some help to explain what's going on and maybe get a better solution.
I've created a simplified version of the macro to replicate the issue. There are three outputs: a one row config output, the 1 output that shows the macro's data stream input, and the 2 output that is what the Python tool received.
Now here's a flow with two parallel sets of data streams & configuration inputs running into two separate instances of the macro:
Here's the top 1 output that shows data set 1 being fed into the macro:
Now here's the issue where the 2 output showing what the Python tool is getting. It should be the same data set 1 except the Python tool has somehow received data set 2: (!!!)
I've been banging my head on this for hours now and web searches haven't found anything...is this expected behavior for the Python tool when used inside macros? Is this a bug for this particular use case?
So far I've found two workarounds: Here's the first, using the CReW Parallel Block Until Done tool:
Here's the second workaround, using an Append tool:
However I'm not really a fan of either workaround because they both require the addition of extra tools besides the macro just to work, plus it creates a path dependency that might not need to be there. I'd really like to find a solution that enables my colleagues & I to use our macros without requiring additional tools. Does anyone have any other ideas of what I might do?
I've attached the macro plus the various workflows I displayed above, plus one more workflow showing the issue happen when the macro is used serially in the same flow.
Thanks,
Jonathan
Hi @jdrummey ,
Not sure if this will work for you, but I faced a similar situation when I used a Custom-built Macro in two different workflows.
When I was running workflows simultaneously, data input from 1 workflow was somehow reflected in the data input from 2nd workflow.
My team had a word with Alteryx Solutions Engineer and they recommended checking the 'Use AMP Engine' checkbox in 'Runtime' settings. This solved my query.
I would recommend you to try the same and see if it works.
Cheers,
Shreyansh Rathod
Hi,
Thanks for the suggestion! Unfortunately the couple of key workflows that I'd like to use the actual macro for don't run on AMP (we're still on v2020.4, I'll be sure to test again when we upgrade to v2021.1).
Jonathan