Run Command Tool

The Run Command tool allows you to run external command programs within Designer. This tool can be used as an input, output, or an intermediary tool.

Alteryx public gallery compatibility

Planning to publish your workflow to gallery.alteryx.com? You must first apply for an exemption. This restriction does not apply to private instances of Alteryx Server and Alteryx Gallery.

Using the Run Command tool is similar to running applications directly from the Windows command line, but with the convenience of remaining within the Alteryx GUI. For example, you can use the tool:

  • when Designer does not have needed functionality.
  • in conjunction with curl.exe to download data from web or FTP sites.
  • to call third party applications.
  • to wrap custom functionality written in other programming languages.

If the program you are using does not set error flags, you should wrap it in a batch file to make sure the output file is deleted before it is run.

Configure the Tool

When you run the workflow, the Run Command tool configuration is executed in sequence: Write Source, Run External Program, and then Read Results.

  1. Optionally specify a Write Source [Optional] output. The write source is data that comes into the tool as a file, SQL server connection, or any supported output type. Only specify a write source if you are using the Run Command tool as an output or intermediary tool. See the Input Data Tool for more information on supported file types and data sources.
  2. In the Run External Program section:
    • Specify the external program Command: to run. For example, this could be a program that acts on a write source and generates read results.
    • UNIX Operators

      If the external program is a UNIX-style command line app that takes input from stdin and writes to stdout, you can use the << and >> operators to pipe the information to and from files.

    • Type the Command Arguments [Optional]:, if any. Most commands are used together with one or more arguments. Whether arguments are required or optional varies by command.
    • Optionally specify a Working Directory [Optional]:. If you leave this field blank, the default is the directory where the workflow is saved.
    • Select Run Minimized to minimize the Run Command window to the task bar when Alteryx executes the external command.
    • Select Run Silent to not display the Run Command window when Alteryx executes the external command.
  3. Optionally specify a Read Results input. This file is carried through the rest of the workflow. Only specify a read results input if you are using the Run Command tool as an input or intermediary tool.

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. For example, the IFS macro uses the Run Command tool which specifies a file in the temp directory for output.

The following picture shows 3 Run Command tools working in parallel, trying to use the same file that will cause an error. It works as designed due to the AMP concept.

To avoid the error, use a Formula function to create a UUID to make the file name unique. Add a Question in front of the Run Command tools that might run in parallel. It changes the value in the Run Command Tool with 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.

Affected Alteryx Macros Shipped with Designer:

  • IFS.yxmc
  • Google_Analytics.Prep_Query_String.yxmc
  • UTCDateTimeConverterMacro.yxmc