Parallel Node in Pathways

From FojiSoft Docs
Revision as of 23:10, 5 March 2025 by Mitchell.Hirsche (talk | contribs) (Mitchell.Hirsche moved page Documentation: Parallel Node in Pathways to Parallel Node in Pathways)
(diff) ← Older revision | Latest revision (diff) | Newer revision → (diff)

The Parallel node in Pathways allows workflows to execute multiple branches of tasks simultaneously. This is particularly useful when tasks can run independently of each other and do not need to wait for one to complete before starting the next.


Configuration Options

  1. Name
    • Provide a descriptive name for the Parallel node (e.g., "Parallel Task Execution").
  2. Branches
    • Name: Specify a name for each branch of execution (e.g., "Branch A", "Branch B").
    • Condition Expression:
      • Type: Choose the format for defining conditions for branch execution:
        • Script: Write custom logic using a scripting language.
        • Handlebars Template: Use Handlebars syntax for condition-based template logic.
      • Expression Field: Define the condition that determines if the branch should execute. For example, order.type === 'priority'.

Purpose and Benefits

  • Concurrent Execution: Run multiple workflows at the same time, improving efficiency and reducing overall execution time.
  • Flexible Logic: Conditions allow for selective branch execution based on dynamic parameters.
  • Scalability: Enables workflows to scale by processing independent tasks in parallel.

Behavior

  • All branches are initiated simultaneously.
  • Conditions (if defined) determine which branches are executed.
  • Execution continues only after all active branches have completed.

Usage Scenarios

  1. Data Processing:
    • Process different segments of data simultaneously, such as splitting customer data into multiple regions for parallel processing.
  2. Task Distribution:
    • Distribute tasks to different teams or systems and execute their workflows concurrently.
  3. Dynamic Branching:
    • Enable or disable branches dynamically based on conditions. For example:
      • Branch A runs if data.type === 'high'.
      • Branch B runs if data.type === 'low'.

Example Configuration

  • Branch A:
    • Condition Type: Script
    • Expression: task.priority === 'high'
  • Branch B:
    • Condition Type: Handlebar Template
    • Expression: {{#if isUrgent}}true{{/if}}

The Parallel node is a critical component for optimizing workflows by enabling simultaneous task execution while maintaining control through dynamic conditions.