xFlow
  • Overview
    • Introduction
    • Core Features
    • Architecture
      • High Level Architecture
      • Tech Stack
      • Deployment Flexibility
      • Performance and Scalability
      • Security Compliance
  • Getting Started
    • Installation
    • Quick Start
    • Configuration
  • Core Concepts
    • Serverless Workflow Specification
    • Workflow data handling
    • Workflow Expressions
    • Error handling
    • Input and Output schema definition
    • User Task
    • User Forms
      • Lowcode Form
      • Advanced User Form
    • AI Agents in Enterprise Business Processes
    • Comparisons
      • BPMN2
  • Developer Guide
    • Architecture
    • API Reference
    • Workflow States Reference
      • Event State
      • Operation State
      • Switch State
      • Parallel State
      • Inject State
      • ForEach State
      • Callback State
      • UserTask State
      • AIAgent State
      • AIAgentProxy State
      • UserProxyAgent State
      • AI Outbound Agent State
    • Workflow Functions
      • REST
      • GraphQL
      • Custom
        • Built-in Functions
        • Lowcoder Query Function
      • Function Auth
    • Workflow Secrets
    • Integrations
    • Workflow Modeler
    • Frontend Development
      • Forms
        • Lowcode Form
        • Advanced User Form
    • Serverless Workflow Development
      • Operation State
      • Switch State
      • Parallel State
      • ForEach State
      • Callback State
      • User Task State
    • AI Agent Development
      • AI Agent
        • Predefined LLM
        • LLM Configuration
        • Multi LLM Configuration
        • Chat Memory
        • Tools
        • Data Output
        • Agent Outcomes
      • AI Agent Proxy
        • AI Agents Integration
      • User Proxy Agent
      • xChatBot Integration
  • Examples
    • Basic Examples
    • Advanced Examples
      • Loan Approval Workflow
      • QMS AP Workflow
  • Administration
    • Monitoring and Logging
    • Security
    • Performance Tuning
  • Extensions and Customizations
    • Plugins and Add-ons
  • Troubleshooting
    • Common Issues
    • FAQs
  • Release Notes
    • Version History
    • Upcoming Features
  • Support
    • Contact Information
    • Community
Powered by GitBook
On this page
  1. Developer Guide
  2. Workflow States Reference

Parallel State

Parameter
Description
Type
Required

name

Unique State name. Must follow the Serverless Workflow Naming Convention

string

yes

type

State type

string

yes

branches

List of branches for this parallel state

array

yes

completionType

Option types on how to complete branch execution. Default is "allOf"

enum

no

numCompleted

Used when branchCompletionType is set to atLeast to specify the least number of branches that must complete in order for the state to transition/end.

string or number

yes (if completionType is atLeast)

timeouts

State specific timeout settings

object

no

stateDataFilter

State data filter

object

no

onErrors

States error handling and retries definitions

array

no

transition

Next transition of the workflow after all branches have completed execution

string or object

yes (if end is not defined)

compensatedBy

Unique name of a workflow state which is responsible for compensation of this state

string

no

usedForCompensation

If true, this state is used to compensate another state. Default is false

boolean

no

metadata

Metadata information

object

no

end

Is this state an end state

boolean or object

yes (if transition is not defined)

Example:

JSON
YAML

Parallel state defines a collection of branches that are executed in parallel. A parallel state can be seen a state which splits up the current workflow instance execution path into multiple ones, one for each branch. These execution paths are performed in parallel and are joined back into the current execution path depending on the defined completionType parameter value.

The "completionType" enum specifies the different ways of completing branch execution:

  • allOf: All branches must complete execution before the state can transition/end. This is the default value in case this parameter is not defined in the parallel state definition.

  • atLeast: State can transition/end once at least the specified number of branches have completed execution. In this case you must also specify the numCompleted property to define this number.

Exceptions may occur during execution of branches of the Parallel state, this is described in detail in this section.

The timeouts property can be used to set state specific timeout settings. Parallel states can define the stateExecTimeout and branchExecTimeout timeout settings. For more information on workflow timeouts reference the Workflow Timeouts section.

Note that transition and end properties are mutually exclusive, meaning that you cannot define both of them at the same time.

PreviousSwitch StateNextInject State

Last updated 1 year ago

 {
     "name":"parallel-exec",
     "type":"parallel",
     "completionType": "allOf",
     "branches": [
        {
          "name": "branch-1",
          "actions": [
            {
                "functionRef": {
                    "refName": "function-name-one",
                    "arguments": {
                        "order": "${ .someParam }"
                    }
                }
            }
        ]
        },
        {
          "name": "branch-2",
          "actions": [
              {
                  "functionRef": {
                      "refName": "function-name-two",
                      "arguments": {
                          "order": "${ .someParam }"
                      }
                  }
              }
          ]
        }
     ],
     "end": true
}
name: parallel-exec
type: parallel
completionType: allOf
branches:
- name: branch-1
  actions:
  - functionRef:
      refName: function-name-one
      arguments:
        order: "${ .someParam }"
- name: branch-2
  actions:
  - functionRef:
      refName: function-name-two
      arguments:
        order: "${ .someParam }"
end: true