Skip to content

[v2] Workflow Agent: DAG scheduling with dependencies + retries #39

Description

@devzeebo

Part of the Orchestrator v2 rebuild — a tear-down/rebuild in a new self-contained orchestrator-v2/ folder (Vite+ / vp, vp test + vitest-gwt, no hooks, single RPC/WebSocket runner interface, engine adapters copied wholesale). Fulfills #31 (Workflow Agent). See also #29, #30.

Problem

There is no interface for defining a workflow; today every agent is implicitly "Do start, Do LLM, Do stop", which is inflexible and prevents dynamic scheduling of Task Agents (#31). Workflows need to be explicit, named sequences of tasks scheduled with dependencies, tracking their own state and retrying via a script task. This must stay separated from Bifrost — Bifrost is one of many task sources.

Proposed solution

New agent-4-workflow package (a Workflow Agent, built atop the task interface like agent-3-task):

  • A workflow is itself a script task. On run it: computes the ready set, creates draft child tasks, sets dependency edges, promotes ready children to live, persists its own WorkflowState, and returns paused so it is re-yielded as children complete (re-entrancy).
  • The scheduler is an orchestrator-side RPC service (tracks workflow state + ready-set); the Workflow Agent drives it via RPC.
  • Per-step retry via a script-task wrapper ([feat] Implement Workflow Agent and Interfaces #31 "retries via a script task").
  • The orchestrator stays uninvolved in dependency resolution (the task source owns that).

Alternatives considered

  • Implicit workflow skeleton (Do start / Do LLM / Do stop) — rejected; explicit named DAG.
  • Orchestrator resolves dependencies — rejected; the source owns resolution.
  • Couple workflows to Bifrost — rejected; Bifrost is one of many task sources implementing the interface.

Area

Orchestrator v2 / agent-4-workflow (fulfills #31)

Acceptance criteria

  • Linear A→B→C: children promoted in order; C runs only after B.
  • Diamond A→{B,C}→D: B and C run concurrently where runners allow; D after both.
  • A step failing twice then succeeding with maxAttempts: 3 ultimately completes.
  • Re-entrancy: after a child completes the workflow is re-yielded and skips already-completed steps.

Dependencies

Verification

vp test + vitest-gwt: linear ordering, diamond DAG concurrency, retry policy, re-entrancy.

Metadata

Metadata

Assignees

No one assigned

    Labels

    enhancementNew feature or request

    Projects

    Status
    Todo

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions