Skip to main content

Introducing Wait for Workers - Workflow Synchronization Made Easy

· 3 min read
ApudFlow OS
Platform Updates

Workflow synchronization just got a whole lot easier with our new Wait for Workers worker! This powerful addition to the ApudFlow platform allows you to coordinate parallel workflow branches and ensure operations run in the correct order.

What is Wait for Workers?

The Wait for Workers worker monitors the execution status of other workers in your workflow and waits until all specified workers have completed their tasks. It's perfect for scenarios where you need to:

  • Synchronize parallel data processing branches
  • Wait for multiple API calls to complete
  • Coordinate dependent operations
  • Ensure data availability before proceeding

How It Works

Simply connect workers to your Wait for Workers node, and it will automatically detect and monitor all connected workers. No manual configuration needed!

Manual Mode

For advanced use cases, you can manually specify worker IDs to wait for specific workers that may not be directly connected.

Key Features

  • Automatic Detection: Intelligently detects connected workers from workflow topology
  • Real-time Monitoring: Periodically checks worker status in the database
  • Timeout Protection: Configurable timeout to prevent infinite waiting
  • Error Handling: Optional failure on any worker error
  • Parallel Coordination: Perfect for synchronizing multiple parallel branches

Configuration Parameters

ParameterTypeDefaultDescription
worker_idsarray[]Worker IDs to wait for (leave empty for auto-detection)
check_intervalnumber1.0Seconds between status checks
timeoutnumber300.0Maximum wait time in seconds (0 = no limit)
fail_on_errorbooleanfalseFail immediately if any worker encounters an error

Return Values

The worker returns a comprehensive status report:

{
"completed": ["worker_id_1", "worker_id_2"],
"failed": [],
"timeout": false,
"total_waited": 2.5,
"auto_detected": true
}

Example Use Case

Imagine you have a workflow that:

  1. Fetches stock data from Yahoo Finance
  2. Simultaneously processes the data with an LLM for analysis
  3. Needs both results before generating a final report

With Wait for Workers, you can ensure the final report generation waits for both the data fetch AND the LLM analysis to complete.

Getting Started

  1. Add a "Wait for Workers" node to your workflow
  2. Connect your parallel workers to the wait node
  3. Configure timeout and error handling preferences
  4. Connect the wait node to your downstream processing

The worker will automatically detect and wait for all connected workers to complete!

Watch the Tutorial

For a visual guide on how to use the Wait for Workers worker, check out our tutorial video:

How to Use Wait for Workers

This new worker significantly simplifies workflow coordination and makes building complex, parallel processing pipelines much more intuitive. Try it out in your next workflow!