Skip to content

Add orchestrator pattern example (06-task-dependencies)#403

Closed
axon-agent[bot] wants to merge 1 commit intomainfrom
axon-fake-strategist-20260221-1200
Closed

Add orchestrator pattern example (06-task-dependencies)#403
axon-agent[bot] wants to merge 1 commit intomainfrom
axon-fake-strategist-20260221-1200

Conversation

@axon-agent
Copy link

@axon-agent axon-agent bot commented Feb 21, 2026

🤖 Axon Agent @gjkim42

Summary

Adds a new example (examples/06-task-dependencies/) that demonstrates the orchestrator pattern — chaining multiple Tasks using dependsOn and prompt templates so one agent's output feeds into the next.

This directly addresses #328, which requested an orchestrator pattern be added to the examples.

What's included

  • task-a-implement.yaml — Step 1: an agent implements a feature and opens a PR
  • task-b-review.yaml — Step 2: a second agent reviews the PR, using Task A's captured outputs (branch name and PR URL) via Go template syntax: {{ index .Deps "implement-feature" "Results" "pr" }}
  • README.md — Documents the pattern, explains how dependsOn works (automatic waiting, failure propagation, cycle detection, branch locking, output forwarding), and shows how to extend to 3+ step pipelines or fan-in from multiple upstream tasks
  • Matching secret and workspace templates consistent with existing examples

Why this matters

The dependsOn + prompt template mechanism is one of Axon's most powerful features for building multi-step agent workflows, but it had no dedicated example. Users had to piece it together from the API reference and integration tests. This example makes the pattern immediately discoverable and copy-pasteable.

Key behaviors documented

Behavior Description
Automatic waiting Task B stays in Waiting phase until Task A succeeds
Failure propagation If Task A fails, Task B immediately fails
Cycle detection Circular dependencies are detected and rejected at creation time
Branch locking Both tasks share a branch; controller ensures mutual exclusion
Output forwarding Task A's key: value outputs are injected into Task B's prompt

Test plan

  • Verify YAML files are valid with kubectl apply --dry-run=client -f examples/06-task-dependencies/
  • Verify examples README table renders correctly
  • Verify template syntax matches integration test patterns in test/integration/task_test.go

Addresses #328.

🤖 Generated with Claude Code


Summary by cubic

Adds an orchestrator pattern example that chains Tasks with dependsOn and prompt templates so one agent’s outputs feed into the next. Makes multi-step workflows easy to copy and use; addresses #328.

  • New Features
    • Added examples/06-task-dependencies with Task A (implement-feature) and Task B (review-feature) chained via dependsOn.
    • Task B reads Task A outputs (branch, PR URL) using Go templates in the prompt.
    • README documents key behaviors: automatic waiting, failure propagation, cycle detection, branch locking, output forwarding.
    • Added secret and workspace templates; updated examples/README.md to list the new example.

Written for commit 643d8b7. Summary will update on new commits.

Add example showing how to chain Tasks using dependsOn and prompt
templates. Task A implements a feature and opens a PR, then Task B
automatically reviews it using the branch and PR URL from Task A's
outputs.

Addresses #328.

Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
Copy link

@cubic-dev-ai cubic-dev-ai bot left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

1 issue found across 7 files

Prompt for AI agents (all issues)

Check if these issues are valid — if so, understand the root cause of each and fix them. If appropriate, use sub-agents to investigate and fix each issue separately.


<file name="examples/06-task-dependencies/README.md">

<violation number="1" location="examples/06-task-dependencies/README.md:103">
P2: Template references wrong dependency output. `review-feature` is a code-review task and doesn't produce a `pr` output — the PR URL comes from `implement-feature`. Either add `implement-feature` to `dependsOn` and reference it directly, or reference a key that `review-feature` would actually produce.</violation>
</file>

Reply with feedback, questions, or to request a fix. Tag @cubic-dev-ai to re-run a review.

spec:
type: claude-code
prompt: |
The review for PR {{ index .Deps "review-feature" "Results" "pr" }}
Copy link

@cubic-dev-ai cubic-dev-ai bot Feb 21, 2026

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

P2: Template references wrong dependency output. review-feature is a code-review task and doesn't produce a pr output — the PR URL comes from implement-feature. Either add implement-feature to dependsOn and reference it directly, or reference a key that review-feature would actually produce.

Prompt for AI agents
Check if this issue is valid — if so, understand the root cause and fix it. At examples/06-task-dependencies/README.md, line 103:

<comment>Template references wrong dependency output. `review-feature` is a code-review task and doesn't produce a `pr` output — the PR URL comes from `implement-feature`. Either add `implement-feature` to `dependsOn` and reference it directly, or reference a key that `review-feature` would actually produce.</comment>

<file context>
@@ -0,0 +1,123 @@
+spec:
+  type: claude-code
+  prompt: |
+    The review for PR {{ index .Deps "review-feature" "Results" "pr" }}
+    has been completed. If the review approved the changes, merge the PR.
+  dependsOn:
</file context>
Fix with Cubic

@gjkim42 gjkim42 closed this Feb 27, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant