Skip to main content

Overview

A Workflow is an orchestrated sequence of agents organized into nodes. While individual agents perform specific tasks, workflows define the logic, data flow, and control structures that connect these agents to solve end-to-end business problems.

Workflow Structure

Workflows are built using a node-based architecture where each node represents a functional step in the process.

Multi-Node Composition

A workflow can consist of multiple nodes connected in a directed graph. The output of one node (or a specific agent within it) is passed as the input to the next, ensuring a seamless data pipeline.

Conditional Branching

Within a single node, you can implement Conditional Branching. This allows the workflow to evaluate data at runtime and decide which path to follow.
  • Logic-Based Routing: Use “If-Then-Else” structures to route the flow.
  • Dynamic Paths: Direct the workflow to different agents based on the success, failure, or specific value of a preceding agent’s output.

Agent Loops

Nodes support Loops, enabling an agent or a set of agents to execute repeatedly until a specific condition is met or a list of items is fully processed.
  • Batch Processing: Loop through a list of invoices to extract data from each.
  • Retry Logic: Re-run an agent if the initial output does not meet validation criteria.

Workflow Node

A Workflow Node allows you to embed an existing workflow as a single step within your current process. This treats a complex sequence of agents as a reusable, modular function call.

Key Benefits

  • Logic Separation: Decouple specialized business logic (e.g., a “Tax Calculation” workflow) from your main orchestration flow.
  • Reusability: Build a workflow once and call it across multiple different parent workflows.
  • Reduced Complexity: Keep your primary workflow canvas clean by collapsing multi-agent processes into a single functional node.
  • Independent Maintenance: Update the nested workflow independently without needing to reconfigure every parent workflow that uses it.

Technical Behavior

When a Workflow Node is triggered, the platform executes it as a Sub-Routine:

Best Practices for Modular Workflows

1. Functional Encapsulation
Use Workflow Nodes for tasks that require a distinct set of permissions or specialized logic, such as:
  • ERP Syncing: A dedicated workflow for handling complex data handshakes.
  • Compliance Audits: A sub-workflow that loops through files and generates a report.
2. Styling for Visual Hierarchy
To distinguish a Workflow Node from a standard Agent Node, use unique styling:
  • Custom Borders: Use thicker borders for nested workflows to indicate depth.
  • Unique Icons: Assign a folder or “sub-process” icon to quickly identify modular logic.

Slot Management

Workflows utilize Global Slots to maintain state and share data across different nodes. These slots act as the “memory” of the workflow.

Supported Slot Types

When defining a slot, you must specify its type to ensure data validation and prevent type-mismatch errors.

Workflow Process Context & Slot Mapping

When executing a workflow in the context of a process (via the /v1/process/workflows/executeWorkflow API), process data can be shared and mapped into the workflow.

1. Dynamic Slot Mapping (slotsToFieldsMapper)

In the stage configuration, you can map process field values to specific workflow input slots:
  • Config Format: Use a dictionary key-value mapping under slotsToFieldsMapper, where keys are workflow slot IDs and values are the process field names.
  • Type Normalization: For file/document field types, the platform automatically normalizes values into a list of file dictionaries (e.g. [{"id": "file_123"}]) before injecting them into the workflow’s input slots.

2. Automatic Context Slots

In addition to the mapped slots, the platform automatically injects two global JSON-serialized slots into the workflow’s execution environment:

3. Consuming Context in Workflow Agents

Agents running within the workflow nodes can access these global slots to inspect process-level metadata or look up configuration values dynamically. For instance, in a Python agent node:

Human-in-the-Loop: Approvals

For sensitive operations (e.g., processing a payment or updating an ERP), you can enable Approvals for specific nodes.
  • Intervention: The workflow pauses execution at the designated node.
  • Review: A human operator reviews the agent’s output.
  • Action: The workflow resumes only after an “Approve” or “Reject” action is logged.
  • You can also specify a list of approvers who should approve to ensure right team member is approving the execution.

Visualization & Styling

To manage complex architectures, the platform provides Node Styling for clear visualization.
  • Color Coding: Assign colors to nodes based on their function (e.g., Green for ERP, Blue for No-Code).
  • Custom Icons: Visual identifiers for quick recognition of agent types within the workflow canvas.
  • Layout Organization: Auto-align and group nodes to maintain a clean, readable map of the business logic.

Implementation Example

1

Initialize Slots

Either define slots manually, or choose Fill slots from Agents to initialise slots.
2

Configure Node 1

Configure nodes by selecting the right agents from the list.
3

Add Conditional Branch

If you are configuring conditional node - specify the condition and select a list of agents that should run with that winning condition. Conditions should be run with slots in mind like this: {{slotName}} > 10
4

Approvals

Select Approvals if the node is needed to be approved before execution.
5

Styling

For visualisation purposes, you can choose to style your workflow with color / logo and custom name if needed.