Job dependencies: run job B only after job A completes
- Dominant language
- Rust
- Stars
- 32
- Forks
- 5
- Avg merge
- 15h 21m
- Merged PRs (30d)
- 21
Description
## Context
A common pattern is chaining jobs: "after the PDF is generated, send the email." Currently this requires the handler to manually insert the next job on completion. A declarative dependency mechanism would be cleaner.
## Design Options
1. **`depends_on` column** — job B has `depends_on = [job_A_id]`. Maintenance promotes B to available only when all dependencies are completed. Simple but requires tracking dependency state.
2. **Completion callback** — `InsertOpts { on_complete: Some(next_job_params) }`. The runtime automatically inserts the next job when the current one completes. Simpler but limited to single-step chains.
3. **Explicit "not a workflow engine"** — document that users should insert the next job in their handler. This is the current approach and keeps the system simple.
## Scope
- [ ] Evaluate whether this belongs in awa or should be left to application code
- [ ] If yes: design the dependency model (column? callback? separate table?)
- [ ] Consider: what happens when a dependency fails? Block dependents? Cancel them?
- [ ] Migration if needed
- [ ] Rust + Python API
- [ ] Tests
## Note
The PRD explicitly lists "workflow engine" as a non-goal. This should stay minimal — simple A→B chains, not DAGs.
Contributor guide
No contributing guide indexed for this repository
Assessment
This issue has not been assessed yet.