Skip to content

Control flow: conditional edges, branches, loops/cycles & parallel execution #278

Closed

Description

@codeforstartups

Context

Real orchestration needs routing. Add conditional edges (router nodes), parallel branches that fan out and join, and bounded loops/cycles — the LangGraph control-flow surface.

Scope

  • Conditional/router edges that pick the next node from state
  • Parallel branches with fan-out + join (barrier) semantics
  • Loops/cycles with a max-iteration / termination guard
  • Cycle detection and clear errors for malformed graphs

Acceptance criteria

  • A graph can branch on a predicate, run two branches in parallel, and join
  • A loop terminates on condition and respects the iteration cap
  • Tests cover branch, parallel-join and loop-with-exit

References

Roadmap doc, §5, §9 (P1).


Part of #273 (flow).

Imported from the dynavec — Agent Orchestration Roadmap.

Activity

  1. Ashishds commented on Oct 7, 2026

    @Ashishds
    Contributor

    Hi @codeforstartups / @abhishekkrthakur,

    I would like to work on this! I have an implementation ready that covers the complete control-flow specification:

    • Conditional / router edges with safe AST expression evaluation and callable predicates
    • Parallel branch fan-out and join (barrier synchronization) with isolated state copies and reducer merging
    • Bounded loops / cycles with termination guards and configurable iteration limits
    • Cycle detection that distinguishes between valid guarded loops and malformed infinite cycles

    Since #278 builds directly on the graph/state runtime core (#277), I've implemented both in a clean dynavec.agents module with zero regressions to the existing ReActAgent/Planner primitives, accompanied by a comprehensive offline test suite.

    Could you please assign this to me? Let me know if you would like this submitted as a combined dynaflow engine PR (#277 + #278) or split into two sequential PRs.

  2. Kaap10 commented on Oct 13, 2026

    @Kaap10
    Collaborator

    Resolved by #344.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

Labels

Projects

No projects

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions