Skip to main content

Wait for Workers

Type: wait_for_workers • Category: flow • Tags: wait, sync, parallel, coordination, workflow

Description

Wait for specified workers to complete execution

Parameters

NameTypeDescriptionRequiredDefault
worker_idsstringList of worker execution IDs to wait for (leave empty for auto-detection)no
check_intervalnumberSeconds between status checksno1
timeoutnumberMaximum seconds to wait (0 = no timeout)no300
fail_on_errorbooleanFail immediately if any worker failsnofalse

Help

Wait for Workers

This worker waits for other workers to complete their execution. It periodically checks the status of specified workers in a loop until all have finished.

Auto-Detection Mode: If no worker_ids are specified, the worker automatically detects all workers that have connections leading to this wait_for_workers node in the workflow. This is the recommended approach for most use cases.

Manual Mode: You can manually specify worker_ids if you need to wait for specific workers that may not be directly connected.

Use Cases:

  • Synchronize parallel workflow branches
  • Wait for data processing to complete before proceeding
  • Coordinate multiple API calls or data fetches
  • Ensure dependent operations run in correct order

How it works:

  1. Auto-detect connected workers or use manually specified worker_ids
  2. Check status periodically (configurable interval)
  3. Continue when all workers complete or timeout occurs
  4. Optionally fail if any worker encounters an error

Parameters:

  • worker_ids: List of worker execution IDs to wait for (optional - auto-detected if empty)
  • check_interval: Seconds between status checks (default: 1.0)
  • timeout: Maximum wait time in seconds (default: 300, 0 = no limit)
  • fail_on_error: Stop waiting if any worker fails (default: false)

Returns:

  • completed: List of successfully completed worker IDs
  • failed: List of failed worker IDs
  • timeout: Whether the wait timed out
  • total_waited: Total seconds waited
  • auto_detected: Whether worker IDs were auto-detected

Example: In auto-detection mode, simply connect workers to this wait_for_workers node and they will be automatically monitored.