Skip to content

Add async / concurrent execution mode for DAG flows #57

@dgenio

Description

@dgenio

Summary

The README roadmap (v0.4) mentions async execution as a planned capability, but no issue currently tracks this work. This issue covers adding an asynchronous execution mode to FlowExecutor that can run independent steps concurrently when the flow topology (DAG) allows it.

Motivation

Today FlowExecutor runs steps sequentially. Once DAG-based flows land (#8, #9), many steps in a flow will be independent of each other and could execute in parallel, significantly reducing end-to-end latency for I/O-bound tool chains.

Scope

  • Add an AsyncFlowExecutor (or an async flag on the existing executor) that uses asyncio to run independent DAG branches concurrently.
  • Ensure ExecutionResult / StepRecord correctly capture wall-clock vs. per-step timing.
  • Provide a synchronous wrapper (run()asyncio.run(...)) so the simple API remains unchanged.
  • Update documentation and add at least one example demonstrating concurrent execution.

Acceptance Criteria

  1. Independent steps in a DAG flow execute concurrently (verified by wall-clock time < sum of step times).
  2. Dependent steps still respect topological ordering.
  3. Error handling behaves consistently with sync mode (fail-fast or continue based on policy).
  4. ExecutionResult includes per-step start/end timestamps.
  5. Existing synchronous tests continue to pass.

References

Metadata

Metadata

Assignees

No one assigned

    Labels

    ai-friendlyDesigned for AI-assisted implementationarea:executorFlow execution enginemilestone:v0.4.0[LEGACY] Superseded by GitHub milestonespriority:P3[LEGACY] Nice-to-havetype:featureNew feature or capability

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions