Using External Code in Production

While Workbench has built-in support for Java and PHP, you can also run scripts written in other programming languages such as R, Python, and Scala. To run a different language's script, the script needs to be capable of running from the command line and you need access to the language’s executable file in the command line. External scripts are run from the Execute Process Node in Production scripts.

For example, here is a breakdown of a valid command line string:

C:\R\R-4.1.2\bin\x64\Rscript.exe C:\R\fileIO.r "C:/DI/Projects/TestProject/" "test.txt"

  • Executable file path—The executable file path to the program that runs your language's script. In this example, Rscript.exe can run any R script that is passed to it.

  • Script file path—The file path to the script you want to run. Your script can reference and call other scripts, but only one script can be provided per command line.

  • Arguments—Each parameter for a script is entered in the command line, surrounded by quotation marks and separated by spaces.

TIP: If a file or folder in your file path has a space in its name, use quotation marks around that segment of the path. For example: C:\"Program Files"\Test\Example.txt

After adding a command line string to an Execute process node, you can use the Production script as is or package it into a Production extension. For more information on creating Production extensions, see Production Extensions Overview.