Skip to main content

Run Command Tool Workaround with AMP Engine

Due to AMP Engine's multi-threaded processing, you might see concurrency issues when multiple macros with Run Command tools are writing to the same temp file. The Field Summary tool implementation is an example of how you can avoid conflicts.

The image below depicts parallel Field Summary tools that each contain Run Command tools nested within IFS.yxmc.

3 Field Summary tools that rely on IFS macro

Opening the macros in turn, we can see the the Run Command tool which specifies a file in the temp directory for output.

IFS macro

To avoid an error, change the configuration of the Run Command tool to include a UUID, adding %uuid% somewhere in the input/output files' names. This way different instances of Run Command tools have different temp directories for input and output files.

Sample change in RunCommand Tool config

Then add an Action tool (Question) in front of the Run Command tools that might run in parallel. Configure the Action tool to Update Raw XML with Formula, and set the Update Inner Xml formula to replace the %uuid% placeholder in the destination tool with a UUID.

Adding the Action Tool

Affected Alteryx macros shipped with Designer:

  1. IFS.yxmc

  2. Google_Analytics.Prep_Query_String.yxmc

  3. UTCDateTimeConverterMacro.yxmc