Skip to main content

Run Command Tool Workaround with AMP Engine

Due to the AMP engine's multi-threaded processing, you might encounter concurrency issues when multiple macros with Run Command tools write 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

When we open the macros, we can see 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 file 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