Skip to content

ADR 003 · Workflow ownership ​

A worker finishes just after its source is replaced. Who can accept the result, retry the job, or show the reader the last valid version?

Two plywood modules pull apart to reveal their blue connecting dowels.

LinkedIn opens a draft you can review before posting.

Architecture decision record · Single-owner rule adopted for the draft. Execution engine open.

This decision assigns responsibility for moving background work forward. Dagster and Temporal remain candidates. Both must be compared on the same recovery cases.

Context ​

A corrected source can invalidate an entity match while leaving useful text search intact. Parsing, chunking, language processing, named-entity recognition, entity resolution, relationship extraction, indexing, and augmentation each depend on different inputs. Track those inputs so the system can recover an interrupted job without replacing valid work with stale output.

Decision ​

Model ingestion as a DAG over versioned artifacts. One durable orchestrator owns readiness, retries, attempts, timeouts, cancellation, and dependency progression. Evaluate Dagster and Temporal before selecting a runtime. NATS/JetStream carries relevant system events and durable work only where that does not duplicate orchestration ownership.

Consequences ​

The workflow engine may use its own task queues and state database. SQLite retrieval storage does not automatically become workflow control storage. Jobs reference artifacts and fingerprints rather than transporting entire documents in broker messages.

Commit the output before announcing readiness. Combine idempotent writes, an input-version check, an outbox record, and reconciliation so the stored state can settle a dispute. A broker acknowledgment tells you about message delivery. It cannot prove that an external model executed a request exactly once.

Alternatives and tradeoffs ​

Pure event choreography distributes dependency logic across consumers and makes joins, cancellation, and recovery harder to inspect. A custom scheduler would require implementing durable leases, fencing, retries, dependency joins, and upgrades. It needs a concrete justification before adoption.

Validation ​

Use the same interrupted publication for Dagster and Temporal. Give revision 1 to a worker and let it commit its output. Lose the acknowledgment, replace the source with revision 2, then restart the worker and redeliver the original task. Let revision 2 finish.

For each engine, keep the attempt history, artifact identities, publication record and the revision a new search returns. The old commit can stay in history. Redelivery must reuse or reject the completed attempt without making revision 1 current again. Only the eligible revision 2 should be searchable after its publication. Engine selection remains open until those traces exist.

Kill a worker before and after commit; redeliver a task; replace or delete a source mid-run; correct an entity merge; interrupt a model call; and verify that completed independent artifacts remain usable. Compare operational recovery and incremental reprocessing with representative document workloads. See ingestion.

IS373 · Documentation and contract labs available · Research runtime planned