Showing results for 
Search instead for 
Did you mean: 

Alteryx designer Discussions

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

macros versus containers

Alteryx Partner

I have a workflow that is getting long.  I am using containers to organise it.  I have also started packaging pieces of the workflow into macros - not so they can be repeated but so that they can be reduced to just one icon instead of multiple.


Is this a good strategy?  Or will I be slowing the workflow down / any other disadvantages?




Hi @chickenlicken, does your workflow have any inputs that have ODBC connections or connections to a SQL server? If it does, making your SQL statement as specific as possible can help eliminate the need for extra tools in your workflow stream and typically make your workflow run faster. A good example would be joining two tables in your SQL statement rather than importing two tables separately and then joining them in your workflow stream. Just a thought. 


Hi @chickenlicken 


I'm sure you'll get differing opinions on this, but I think that you should continue using containers to organize your workflows.  I have several workflows with >300 controls and containers, tool annotations and comments are the way I maintain control.  I only use macros when required for reuse, or to code processes that cannot be done(or would require many tools) in a regular workflow.


Macro's do have a certain performance hit, but if you only call them once in your workflow then that won't be an issue.   The bigger problem is maintaining and debugging the workflow.  I find it much easier to debug inline than to debug the same code when encapsulated in a macro.  I have to set up the proper input parameters and then do several iterations of main...repeat until fixed.


Edit:  Wireless connections.  I forgot to mention these.  I put tools into containers based on various criteria, but in general each container ends up with usually one or a few connections as outputs that generally are used in several points further down the chain.  For these inter-container connections, I always use wireless connections to keep the overall page tidier.










Really the purpose of macros is to repeat work and not have to re-create the code in Alteryx when you can reference a macro over and over again for doing the same thing. Containers really are the way to go in my opinion. They make organizing streams easier. Also, in my experience it 'may' take longer for your workflow to render meta-data when you have a bunch of macros in it, which causes delays in development time.


Hope this helps!



Alteryx Partner

Thanks for your thoughts, all.  I'm sticking with containers - it does make an enormous workflow but it does seem easy to move between them if labelled correctly.