maestro
latest
false
UiPath logo, featuring letters U and I in white

Maestro user guide

Last updated Aug 12, 2025

Script task

script task iconThe Script Task in Maestro allows you to execute inline JavaScript to manipulate data, enrich payloads, apply conditional logic, or transform input before passing it to the next component in the process. This is particularly useful when you want to prepare data for Schema Queues, API calls, agents, or storage systems.

Implementation > Type: Run inline script.script task configuration

When to use Script tasks

Use a Script task when:

  • You need to transform or restructure incoming data.
  • You want to validate fields or reject invalid input.
  • You need to combine multiple inputs into a single object.
  • You want to filter, clean, or reformat data before forwarding.
Note: Maestro currently supports JavaScript only inside the expression editor. There is a 10k inbound character limit per serverless, and 1MB payload limit outbound.

Setting up a Script task in Maestro

  1. Drag in a Script task node from the process toolbar.
  2. Add input arguments under the Inputs section in the right-hand panel.
    The input arguments can be literal values, context variables, or previous node outputs (e.g., vars.inArg).
  3. Write your script in the editor:
    • Click the input box under Script, then expand into the full editor view.
    • JavaScript expressions must return an object or value, as in this example:
      return {
        param1: inputString,
        param2: "staticValue"
      };return {
        param1: inputString,
        param2: "staticValue"
      };
      
  4. Map outputs from the return object into Maestro variables using the Outputs section.

Testing script logic

You can test expressions inline by clicking the fx icon to open the JS Function Expression editor The editor includes:
  • A test input panel where you can paste sample inputs.

  • A real-time Expression output panel to preview what your return object will look like.

Runtime errors (e.g., JSON.parse failures) will be shown to help you debug.


Available actions for Script tasks

The Action dropdown in a Script task allows you to define the type of external execution the process should call. Each option maps to a specific UiPath capability or integration method. Below is a brief overview of each option:

  • None

    No implementation is configured for the Script task.

  • Create action app task

    Creates a task in an Action App for user interaction, without waiting for task completion.

  • Start and wait for RPA workflow

    Starts a deployed RPA workflow (e.g., UiPath Studio project) and waits for it to complete before continuing.

  • Start and wait for agent

    Starts a UiPath agent (a reusable logic block) and waits for it to finish execution.

  • Start and wait for external agent

    Triggers an agent hosted outside UiPath, such as CrewAI, Salesforce, or ServiceNow, and waits for the result.

  • Start and wait for API workflow [Preview]

    Executes an API-based workflow (in preview) and waits for a response.

  • Start agentic process

    Starts a process based on agentic design (modular logic), without waiting for it to finish.

  • Start and wait for agentic process

    Starts an agentic process and pauses until it completes execution.

  • Execute business rule [Preview]

    Evaluates a business rule and uses the outcome in the process (currently in preview).

  • Create queue item

    Adds a new item to a UiPath Queue for asynchronous processing, without waiting for result.

  • Create and wait for queue item

    Adds an item to a Queue and waits until it is processed before moving forward.

  • Execute connector activity

    Runs a preconfigured Integration Service connector activity (e.g., Salesforce or Slack).

  • Wait for connector event

    Pauses the process until a specific event is received from a connector (e.g., form submission or external trigger).

  • Execute script

    Runs a short script (JavaScript or similar) during the process for lightweight logic or transformation.



To add an additional output, select Add new to introduce a new variable directly within the Script task. The newly introduced output will be available in subsequent steps.



The Add variable dialog lets you define a new variable by specifying its name, type (such as String, Number, Boolean, etc.), and optional default value. Once saved, the variable becomes available for use in inputs, outputs, or expressions within the Script task.

To update the value of an existing variable, select Set variable value.

For more information about tasks. visit Tasks in BPMN modeling.

  • Script task
  • When to use Script tasks
  • Setting up a Script task in Maestro
  • Testing script logic
  • Available actions for Script tasks

Was this page helpful?

Get The Help You Need
Learning RPA - Automation Courses
UiPath Community Forum
Uipath Logo
Trust and Security
© 2005-2025 UiPath. All rights reserved.