- Introdução
- Introdução
- Modelagem de processos com BPMN
- Noções Básicas sobre Modelagem de Processos
- Abertura da tela de modelagem
- Modelagem de seu processo
- Alinhamento e conexão de elementos BPMN
- Autopilot para Maestro (visualização)
- Repositório de processos
- Modelagem de processos com o Gerenciamento de casos
- Criação de um esquema de entidade de caso persistente
- Definição de chaves de caso (sistema versus externo)
- Estabelecimento de contratos de E/S de tarefa e Write-back
- Regras de saída e encerramento do estágio inicial
- Modelagem de estágios primários e secundários
- Acionamento de um caso a partir do Data Fabric
- Implementação de personas e permissões no nível do estágio
- Definição de SLAs e regras de escalonamento automatizados
- Configuração de um loop de retrabalho (reentrada)
- Gerenciamento de instâncias de casos ao vivo: pausar, migrar e tentar novamente
- Dicionário de componentes de gerenciamento de casos do Maestro
- Process modeling with Flow
- Introdução
- Conceitos básicos
- Node reference
- Built-in nodes
- Connector nodes
- Build guides
- Melhores práticas
- Referência
- Implementação de processos
- Depuração
- Simulação
- Publicação e atualização de processos agênticos
- Cenários de implementação comuns
- Extração e validação de documentos
- Operações do processo
- Monitoramento de processo
- Otimização de processos
- Informações de referência
Guia do usuário do Maestro
O que é
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.
Como funciona
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:
- Open the node palette on the canvas.
- Search for or locate the Subflow node.
- 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
Entradas
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:
- Select the subflow node on the canvas.
- Open the Subflow Inputs section in the properties panel.
- 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>.
Saída
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.
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:
- HTTP Request (
httpRequest1) — fetches order data from an external API. - Subflow (
validateOrder) — validates the order data and returns a result. - Decision (
decision1) — branches based on the validation result.
Inside the validateOrder subflow:
-
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" }; -
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.
Páginas relacionadas
- Variables and data flow — variable scoping rules, expression syntax,
$varsaccess patterns - The Canvas — navigating the canvas, properties panel, node palette
- Error handling — configuring error handles on nodes, including within subflows