Skip to main content

Use parent tasks for dependencies

Status: Ready

Article ID: 037

Truth label: Current

Audience: Workflow builder

Reader outcome: Build a same-project task chain whose children wait for successful parent completion and stop when the parent fails or is cancelled.

Related articles: 006, 036, 081

Target week: 15

Last verified: 2026-09-13

Technical reviewer: Codex source audit

Editorial reviewer: Codex editorial audit

Use a parent for a real prerequisite​

A child task with parent_task_id is not offered to a worker until the parent is completed. Use this when the second task cannot safely begin from the original repository and brief alone.

Examples include implementation after approved scope, QA after implementation, or a summary after a verified delivery. Do not add a dependency merely to make the UI look sequential. Unnecessary chains increase idle time and failure coupling.

Validate the relationship at creation​

Central checks that the parent exists and belongs to the same project. It refuses a new child whose parent already failed or was cancelled. The task queue then skips a pending child until the parent reaches completed.

The scheduler sorts other eligible work normally, so one blocked child does not starve unrelated pending tasks.

Know what completion supplies​

The dependency is a state gate. It does not automatically define how much parent output enters the child's prompt. Session context and pipeline prompt assembly handle context separately.

Design the child description so its outcome remains clear even when parent context is bounded. Name the required artifact, acceptance evidence, or repository state instead of saying only “continue.”

Handle failure deliberately​

For ordinary chains, a failed or cancelled parent recursively cancels pending or assigned dependents. This is fail-fast behavior: downstream work should not run on an unmet prerequisite.

Pipeline stages add a deliberate exception for machine failures past the retry budget. Central holds the failed stage at a failure checkpoint so an operator can retry, fail the chain, or use the narrow gate override. That prevents an expensive chain from disappearing because of a transient execution fault.

Build and inspect a chain​

For a three-stage flow:

  1. create the first task
  2. create the second with the first as parent
  3. create the third with the second as parent
  4. verify only the first is route-eligible
  5. complete the first and confirm the second becomes eligible
  6. inspect histories and session context before releasing the third

Use a synthetic project when testing cancellation cascades.

Current limits​

The model supports one direct parent per task, not an arbitrary dependency graph in one field. Completion is a persisted state, not proof that the required artifact is correct. Cascades affect task state but cannot undo filesystem changes made by an earlier attempt.

Next lesson​

Continue with Schedule recurring work.

Derivative map​

  • Weekly package: WEEK-15
  • Long video: VIDEO-W15-LONG
  • Shorts: SHORT-W15-PROBLEM, SHORT-W15-MECHANISM, SHORT-W15-WARNING
  • Email: EMAIL-W15
  • LinkedIn: LI-W15-A, LI-W15-B
  • X: X-W15-A, X-W15-B
  • Visual: VISUAL-W15

Review record​

  • Same-project validation, eligibility blocking, failure cascade, and pipeline failure-hold behavior checked against current source.
  • Single-parent, state-versus-proof, context, and filesystem limits reviewed.
  • Chain exercise uses a synthetic project for destructive-state testing.
  • Internal links and repository voice reviewed.

Review completed: 2026-08-27

Re-audited against the running product: 2026-09-13