Skip to content

Script

Introduction

The script task provides the capability to execute programs or scripts directly on the host operating system. It allows you to run custom scripts or command-line programs within your process or workflow. By using the script task, you can automate various tasks, interact with system utilities, invoke external programs, or perform any operation that can be executed via a script or command-line interface.

This task provides flexibility and extends the functionality of your process by integrating with the underlying operating system and leveraging its capabilities.

Configuration

  • Name - Display name of the task.
  • Connector - Previosly configuted remote agent connector.
  • Path - Absolute path to the script.
  • Script - Name of the script, extension of the script, and possible parameters that will be forwarded to the script execution. The first parameter can be accessed with 1$ while the second parameter can be accessed with $2 within the script.
  • Free form response - Can be either on or off:
    • ON - Expects not to parse JSON data-interchange format.
    • OFF - Output of the script is expected to be in JSON format.
  • Log on complete - Prints the response in the business log.
  • Response - ScriptResponse deserialized into an object.
About Free Form Response

If the FreeFormResponse is set to OFF, then the script must output a valid JSON in order to be deserialized properly. In case the response is not in a valid JSON format, the Script task will return the response in the output field of the object. The message and result fields of the object will be set to "unknown".

When configuring the script input field, it is crucial to consider the specific requirements of the scripting language and operating system involved. This may entail specifying the interpreter or executable for the script, providing command-line arguments, setting up environment variables, or defining any other necessary parameters. By accurately configuring the script input field, you can ensure the proper execution of the script task within the desired environment.

cmd /C testscript.bat
./testscript.sh

Example