Skip to main content

Workflow

Controlled node

Overview

The Workflow node allows you to encapsulate an entire workflow graph into a single reusable node. This enables you to create modular, composable workflows where complex logic can be packaged into discrete components that can be placed inside other workflows.

When you place a Workflow node in your graph, you're essentially creating a sub-workflow that maintains its own variable scope and execution context, while exposing specific inputs and outputs to the parent workflow. This is useful for:

  • Creating reusable logic components (e.g., a standard data validation or formatting routine)
  • Organizing large workflows into manageable, hierarchical structures
  • Sharing common workflow patterns across different projects
  • Abstracting complex multi-node operations into a single node interface

The Workflow node supports dynamic input and output sockets that you configure through its panel interface, allowing it to adapt to different use cases.

Inputs

InputTypeDescriptionDefault
RunEventTriggers the execution of the encapsulated workflow.-
Custom InputsDataDynamic data inputs defined in the node's configuration. These appear as named sockets based on the Input List configuration.-

Outputs

OutputTypeDescription
DoneEventFires when the encapsulated workflow completes execution successfully.
Custom OutputsDataDynamic data outputs defined in the node's configuration. These appear as named sockets based on the Output List configuration.

Configuration Panel

The Workflow node includes a custom UI panel for managing its interface:

Flow Name

Sets the display name for this workflow instance, helping identify its purpose in the parent workflow.

Node Inputs

Allows you to define custom input data sockets:

  • Click Add Input to create new input sockets
  • Each input appears as a named data socket on the left side of the node
  • Inputs can be removed using the delete button on each chip
  • These inputs are accessible within the sub-workflow as variables

Node Outputs

Allows you to define custom output data sockets:

  • Click Add Output to create new output sockets
  • Each output appears as a named data socket on the right side of the node
  • Outputs can be removed using the delete button on each chip
  • These outputs must be set within the sub-workflow using Set Output nodes

Runtime Behavior

When the Workflow node receives a Run event:

  1. Scope Isolation: The sub-workflow executes in its own variable scope. Variables set inside the sub-workflow are isolated from the parent workflow unless explicitly passed through output sockets.

  2. Input Mapping: Data passed into the custom input sockets is available as variables within the sub-workflow, accessible via the Variable node or Handlebars templating.

  3. Execution: The entire encapsulated workflow graph executes according to its internal logic and connections.

  4. Output Mapping: Data set via Set Output nodes inside the sub-workflow is mapped to the corresponding custom output sockets on the Workflow node.

  5. Completion: When the sub-workflow finishes (reaches a terminal node or the implicit end), the Done event fires on the Workflow node.

  6. Caching: The Workflow node supports internal caching mechanisms. If the same inputs are provided and the workflow hasn't changed, cached results may be used to improve performance.

Example

Creating a Reusable Email Formatter

Scenario: You frequently need to format contact data into a standardized email signature across multiple workflows.

Setup:

  1. Create a new workflow with a Workflow node named "Format Email Signature"
  2. In the configuration panel, add inputs: name, title, phone
  3. In the configuration panel, add output: signature

Inside the Workflow:

  • Use Text nodes with Handlebars templates to combine the inputs: {{name}} - {{title}}\nPhone: {{phone}}
  • Use Set Output node to set the signature output with the formatted text

Usage in Parent Workflow:

  • Connect contact data from a database or form to the name, title, and phone inputs
  • Trigger the Run event
  • Use the signature output in an email sending node

This allows you to maintain the formatting logic in one place while using it across multiple email automation workflows.