Skip to content

Feature Request: Declarative Workflow Builder for Deterministic Multi-Agent Pipelines #11229

Open

Description

@acquia-nexus-agent

Summary

Today, building multi-agent pipelines in Orca (e.g. a code review loop where a reviewer agent hands off to a fixer agent, posts comments on Linear tasks, and chains back to the coordinator) requires either:

  1. Writing custom bash scripts that manually sequence orca orchestration commands, or
  2. Relying entirely on LLM reasoning — putting all the routing logic in natural language in the agent's system prompt and trusting the model to call the right commands in the right order.

Both approaches are brittle for production workflows. Scripts are fragile and hard to maintain. LLM-driven control flow is non-deterministic — the model can deviate, hallucinate steps, or fail to recover from errors in unexpected ways.

This feature request proposes a declarative workflow definition format and an Orca-native dispatcher that executes multi-agent workflows deterministically, without requiring custom scripts or trusting LLM routing decisions.


Problem in Detail

Current state

When you want to build a pipeline like:

Trigger (cron/manual)
  → Coordinator LLM
      → spawns Reviewer agent (new worktree)
      → waits for worker_done
      → if issues found → spawns Fixer agent (new worktree)
      → Fixer posts Linear comment, sets status
      → Fixer reports worker_done
      → Coordinator closes loop

You have two options today:

Option A — bash script:

orca orchestration run-create --objective "Review PR"
orca orchestration task-create --spec "Review PR #42"
orca orchestration worker-start --task task_a --worktree new-child --agent claude
orca orchestration check --wait --timeout-ms 60000
# parse JSON, check outcome, branch...
orca orchestration task-create --spec "Fix issues from review"
orca orchestration worker-start --task task_b --worktree new-child --agent codex
# ...and so on

This requires scripting knowledge, error handling, JSON parsing, and manual wiring of every step. It's not accessible to non-engineers and breaks easily.

Option B — LLM prompt:

"You are a coordinator. Find open PRs, spin up a reviewer agent per PR,
wait for results, and if issues are found start a fixer agent..."

The LLM may or may not follow the intended routing. Conditional branching (if issues_found → route to fixer) is expressed in English and executed probabilistically. There is no guarantee of correct routing, retry behaviour, or failure handling.

What's missing

  • No way to define a workflow as structured data (steps, conditions, transitions)
  • No built-in dispatcher that reads a workflow definition and drives the orca orchestration primitives deterministically
  • No visual workflow builder in the Orca UI to compose pipelines without writing code
  • No conditional branching based on structured worker output (e.g. if outcome == failed → retry, if findings.count > 0 → dispatch fixer)
  • No event-based triggers (e.g. on PR opened, on worker_done with outcome=failed)

Proposed Solution

1. Declarative workflow format (orca.workflow.yaml or inline in Automation)

A structured YAML/JSON definition that describes the pipeline without any scripting:

name: PR Review Loop
trigger:
  type: schedule
  cron: "0 9 * * 1-5"

steps:
  - id: fetch_prs
    type: tool
    tool: linear.list
    params:
      filter: open
    output: prs

  - id: review
    type: worker
    foreach: "${prs}"
    agent: claude
    worktree: new-child
    prompt: "Review PR ${item.id} for security issues. Report findings as JSON."
    output: review_result

  - id: route_on_findings
    type: branch
    condition: "${review_result.findings.length} > 0"
    if_true: fix
    if_false: comment_clean

  - id: fix
    type: worker
    agent: codex
    worktree: new-child
    prompt: "Fix the issues identified in review: ${review_result.findings}"
    on_complete:
      - tool: linear.comment
        params:
          issue: "${item.id}"
          body: "Fixes applied: ${output.summary}"
      - tool: linear.status.set
        params:
          issue: "${item.id}"
          to: "In Review"

  - id: comment_clean
    type: tool
    tool: linear.comment
    params:
      issue: "${item.id}"
      body: "Review passed. No issues found."

2. Orca workflow dispatcher

A built-in dispatcher (not an LLM) that:

  • Reads the workflow definition
  • Executes steps in declared order
  • Evaluates branch conditions deterministically using structured output from workers
  • Handles foreach parallelism (fan-out across items, e.g. one worker per PR)
  • Manages retries and error handling per-step
  • Reports run status to the Automations UI

3. Visual workflow builder in the Automations UI

Extend the existing Automations page with a visual node editor that:

  • Lets users compose workflows by dragging/connecting step nodes (Worker, Tool, Branch, Gate)
  • Generates the YAML definition under the hood
  • Shows live run state (which step is executing, which workers are active)
  • Allows inspecting each step's output inline

4. Event-based triggers

Extend AutomationRunTrigger beyond scheduled | manual to support:

  • on_pr_opened, on_pr_merged (via GitHub/Linear webhook)
  • on_worker_done (chain automations)
  • on_gate_resolved (human-in-the-loop approval unblocks next workflow)

Concrete Use Case: Code Review Loop

The motivating use case that drove this request:

  1. Trigger: Daily at 9am (or on PR opened)
  2. Step 1: List all open PRs from Linear/GitHub
  3. Step 2: For each PR → spawn a Reviewer agent in a new worktree
  4. Step 3: Reviewer posts findings as structured JSON via worker_done
  5. Step 4: Branch — if findings exist → spawn Fixer agent; else → post "LGTM" comment
  6. Step 5: Fixer agent applies changes, posts comment on Linear issue, sets status to "In Review"
  7. Step 6: Fixer self-assigns the Linear issue (orca linear assignee set --current --me)
  8. Step 7: Coordinator closes the run, logs usage

Today this requires ~80 lines of bash + careful error handling. With this feature it would be a ~30-line YAML that any team member could read and modify.


Why This Matters

The orchestration primitives (task-create, worker-start, check --wait, send, ask, gate-create) are excellent and expressive. The gap is the glue layer — today that glue must be either a bash script or an LLM, both of which are unreliable for production pipelines.

A declarative dispatcher would:

  • Make multi-agent workflows accessible to non-engineers
  • Make pipelines auditable and version-controllable (YAML in repo)
  • Make routing deterministic — no LLM needed to decide "should I call the fixer?"
  • Preserve full use of LLMs where they belong — doing the actual work inside each worker step, not making routing decisions

Relationship to Existing Features

Existing feature This proposal
orca orchestration worker-start Used under the hood by the dispatcher
orca orchestration check --wait Dispatcher handles this loop internally
Automations (cron) Extended with workflow steps instead of single-agent prompt
Decision gates Exposed as type: gate step with human resolution
Bundled orchestration skill Still useful for fully autonomous LLM-driven flows; this is complementary for deterministic pipelines

Prior Art / References

  • GitHub Actions — YAML workflow definition with on: triggers, jobs:, steps:, and if: conditionals
  • Temporal.io — durable workflow engine with deterministic replay
  • LangGraph — graph-based agent routing with explicit edges and conditions
  • Prefect / Airflow — DAG-based task orchestration

Orca already has all the primitives. This request is about surfacing them through a structured, no-code-friendly layer rather than requiring users to write orchestration logic themselves.


Filed by a user exploring Orca's multi-agent capabilities for automated code review pipelines.

Activity

  1. AmethystLiang commented on Jul 28, 2026

    @AmethystLiang
    Contributor

    thanks for proposing it. will give it some thought!

  2. dcieslak19973 commented on Jul 28, 2026

    @dcieslak19973
    Contributor
  3. netdragon-beep commented on Aug 15, 2026

    @netdragon-beep

    is anyone currently working on implementing this?

  4. Tauri-EPO commented on Aug 17, 2026

    @Tauri-EPO
    Contributor

    Sibling, not a substitute: #15012 is the Claude-style authoring loop (agent writes a small JS script, a non-LLM runtime executes it, phases skip from data). This issue stays the YAML / visual / Automations shape. Cross-linked from there so the two don't get collapsed.

  5. chirag127 commented on Nov 21, 2026

    @chirag127
    Contributor

    Use case: automatic tasks through APIs, CLI, and skills, with verifiable completion

    I want to describe an authorized task once and have its supported setup, execution, verification, reporting, and cleanup run automatically. The workflow work here and in #11378 should be callable through the public API, CLI, and task skills, using Orca's existing orchestration/coordinator completion model.

    Suggested execution-contract refinements:

    • A reusable procedure declares inputs, explicit workspace/profile/device/application/host targets, prerequisites, dependencies, readiness conditions, assertions, outputs, and owned cleanup. Use project or procedure defaults for routine choices.
    • Prefer semantic APIs and native CLIs for operations they own, with browser/device/computer-use adapters selected by actual target capability.
    • Support manual invocation and existing supported event/scheduled triggers. Save/build invocation can come from project watchers or the linked testing workflows; this does not assume a generic built-in save/build trigger already exists.
    • Return a stable run identity, structured progress, completion events, results, cancellation, and supported resume behavior. Advance from actual completion signals rather than fixed sleeps or terminal-text guesses; [Feature]: CLI event stream for agent status (orca events subscribe) #37016 is related event-stream work.
    • Retain completed-step receipts and their input/build identities. After interruption, reconcile accepted operations before resuming, reuse valid results, and surface unconfirmed effects before dependent work. Apply bounded recovery only where retry behavior is defined.
    • Serialize conflicting resources and allow independent work to proceed concurrently. Retain completed evidence when an indispensable input, unavailable host, or genuine human-required step blocks another branch.

    Acceptance examples: one API/CLI invocation completes the declared extension setup/build/reload/test/report flow and each supported web/mobile/desktop test procedure; disconnect/reconnect does not blindly repeat an installation or publication; cancellation cleans up only run-owned resources; a failed assertion or rebuild cannot become a fresh pass merely because input was delivered or an older app remains visible.

    Concrete domain requests are #46537, #46542, #46544, #46545, #46546, and #46547; public operation schemas belong to #14273. Please retain the orchestration-v3 coordinator/wakeup ownership discussed in the closure of #15012 when implementing these semantics. These refinements build on that execution model and the existing automation facilities.

  6. 0xAlbertChen commented on Nov 30, 2026

    @0xAlbertChen

    Strong +1. Deterministic workflows are essential for reliable, unattended multi-agent execution.

    We previously relied on an AI coordinator to manage task transitions, but this introduced unnecessary token consumption, inconsistent decisions, missed handoffs, and unpredictable recovery behavior.

    We are now moving toward program-controlled workflows:

    Implementation → Independent Review → Rework → Review → Acceptance.

    The LLM should perform engineering work, while deterministic code controls workflow transitions.

    Ideally, Orca should support:

    • Declarative workflow definitions.
    • Conditional transitions based on structured worker outcomes.
    • Independent acceptance gates.
    • Bounded retries and rework loops.
    • Human approval gates.
    • Persistent workflow state.
    • Recovery after runtime restarts.
    • External issue tracker integration.

    A native deterministic workflow engine, or a sufficiently reliable interface for external workflow engines, would significantly reduce the need for custom orchestration infrastructure.

    Related: #9228, #37407, #21747.

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

Metadata

Metadata

Assignees

Labels

No labels
No labels

Type

No type

Projects

No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions