UiPath Documentation
maestro
latest
false
Wichtig :
Es kann 1–2 Wochen dauern, bis die Lokalisierung neu veröffentlichter Inhalte verfügbar ist.

Benutzerhandbuch zu Maestro

Unterflüsse

Dieser Leitfaden umfasst Folgendes:

A subflow is a process embedded within another process. It groups a set of nodes into a self-contained unit that executes as part of the parent process and returns output to it. Subflows help you organize complex logic into reusable, manageable pieces.

Wie es funktioniert

When a parent process reaches a subflow node, execution enters the subflow and runs its nodes in sequence. The subflow has its own variable scope, so variables defined inside it don't collide with variables in the parent process. When the subflow completes, its return value is passed back to the parent process and execution continues from the next node after the subflow.

Nodes inside a subflow can access:

  • Other nodes within the same subflow
  • The parent process's scope

The subflow's return value is accessible to the parent process as $vars.<subflowName>.output.

Creating a subflow

To add a subflow to your process:

  1. Open the node palette on the canvas.
  2. Search for or locate the Subflow node.
  3. Drag it onto the canvas and connect it to the preceding node.

Flow adds the subflow as a collapsible container on the canvas. Select it to expand it and add nodes inside.

Result: The subflow appears on the canvas as a collapsible container. Drag nodes inside it to define the subflow's logic.

Passing data in and out

Eingaben

You define subflow inputs in the properties panel. Each input accepts a value or expression from the parent process's scope.

To configure subflow inputs:

  1. Select the subflow node on the canvas.
  2. Open the Subflow Inputs section in the properties panel.
  3. For each input, enter a name and a value or expression.

Result: The inputs are configured and available inside the subflow body as $vars.<inputName>.

Ausgabe

The subflow's return value is available to the parent process as $vars.<subflowName>.output. You reference it in any downstream node expression just like any other node output.

// Access the output of a subflow named "validateOrder"
$vars.validateOrder.output
$vars.validateOrder.output.isValid
// Access the output of a subflow named "validateOrder"
$vars.validateOrder.output
$vars.validateOrder.output.isValid

Variable scoping

Subflows create their own variable scope. This means variables updated inside a subflow are namespaced to avoid collisions with the parent process.

From outside the subflow, you reference a subflow's internal variables as $vars.<subflowName>.<variableName>. For example, a variable counter inside a subflow named subflow1 is referenced as $vars.subflow1.counter from the parent process.

From inside the subflow, nodes access their sibling nodes' output using the standard $vars.<nodeName>.<property> pattern. They can also read from the parent process's scope directly.

Hinweis:

Variable namespacing prevents a subflow's internal variables from overwriting parent variables that share the same name. You don't need to coordinate variable names between parent and subflow.

Practical example

A parent process that calls a subflow to validate order data before processing it.

Parent process:

  1. HTTP Request (httpRequest1) — fetches order data from an external API.
  2. Subflow (validateOrder) — validates the order data and returns a result.
  3. Decision (decision1) — branches based on the validation result.

Inside the validateOrder subflow:

  1. Script (script1) — checks that required fields are present and the order total is above zero.

    const order = $vars.validateOrder.orderData;
    const isValid = order.items.length > 0
      && order.total > 0
      && order.customerId !== undefined;
    return { isValid: isValid, reason: isValid ? "OK" : "Missing required fields" };
    const order = $vars.validateOrder.orderData;
    const isValid = order.items.length > 0
      && order.total > 0
      && order.customerId !== undefined;
    return { isValid: isValid, reason: isValid ? "OK" : "Missing required fields" };
    
  2. The subflow returns the Script's output as $vars.validateOrder.output.

Back in the parent process:

The Decision node evaluates $vars.validateOrder.output.isValid === true and routes to either a fulfillment path or an error-handling path.

  • Variables and data flow — variable scoping rules, expression syntax, $vars access patterns
  • The Canvas — navigating the canvas, properties panel, node palette
  • Error handling — configuring error handles on nodes, including within subflows

War diese Seite hilfreich?

Verbinden

Benötigen Sie Hilfe? Support

Möchten Sie lernen? UiPath Academy

Haben Sie Fragen? UiPath-Forum

Auf dem neuesten Stand bleiben