v2.1.6+Configuring an Inline Scripting task in the Graphical Designer

In the Graphical Designer, you can configure an Inline Scripting task to run an inline JavaScript or Python script as a step in your workflow.

Before you begin

To configure an Inline Scripting task, a workflow must be open in the Graphical Designer and a task must be added to the canvas.

About this task

An Inline Scripting task runs an inline script in a sandboxed environment on the agent. The script receives typed input values through the inputs object, runs to completion, captures all console output in the task log, and publishes its result as output properties for successor tasks.

Local filesystem access is blocked within the script. Outbound HTTP(S) calls are blocked by default; to enable them, configure an allowedHosts list through a connection or at the agent level.

Procedure

  1. On the canvas, open the properties panel for the task you want to configure as a Scripting task.
  2. In the task properties panel, click Add new task template, then under the Others section, select the script language.
    • To run a JavaScript script, select Run JavaScript. Outbound HTTP(S) calls use fetch(). Input and output globals: inputs (read-only object), outputs (writable object).
    • To run a Python script, select Run Python. Outbound HTTP(S) calls use the requests library interface. Input and output globals: inputs (read-only dict), outputs (writable dict).
    The properties panel updates to display the Script configuration fields for the selected language.
  3. In the Script field, enter the script body.

    Reference input values by key name using the inputs object (for example, inputs.myParam). To publish named output properties, assign values to the outputs object before the script ends. If no outputs keys are set, the value of the last statement is published as result.result.

  4. Optional: In the Input Parameters (JSON) field, enter a JSON object containing the input values to pass to the script.

    The JSON object must be a flat or nested key-value map. Each top-level key is accessible in the script through the inputs object. For example:

    {"environment": "production", "threshold": 100}
  5. Optional: In the Connection field, select or create a connection to define the HTTP allowlist and denylist for outbound calls made by the script.

    When a connection with an allowedHosts list is selected, only matching hosts can be reached. Hosts on the blockedHosts list are always denied. If no connection is selected, the agent-level HTTP policy applies. When neither list is configured at any level, all outbound fetches are blocked.

  6. Optional: Expand Advanced to override the default run limits for this task.

    The available limit overrides are:

    Script timeout (seconds)
    Maximum time the script is permitted to run before the task fails. Default: 60 seconds. Range: 1–600.
    Memory limit (MB)
    Maximum memory the script runtime is permitted to use. Default: 256 MB. Range: 64–1024.
    Fail on console error
    When enabled, any call to console.error() in the script marks the task as failed. Default: off.
    Verbose runtime log
    When enabled, additional runtime diagnostics are written to the task log. Use this option when troubleshooting unexpected behavior. Default: off.
  7. Save the workflow definition.
    The task on the canvas is updated to reflect the selected language and Inline Scripting task type.

Results

When the workflow runs, the Inline Scripting task runs the configured script on the agent. The script result is published as output properties available to successor tasks through the JSONata expression jobs.TASK_NAME.outputprop.

What to do next

For a complete reference of parameters and output properties, see Inline Scripting task parameters and output properties. To define an Inline Scripting task using the Orchestration CLI, see Inline Scripting task JSDL definition.