Workflow — Database blueprint¶
Generated from the architecture model
This page is rendered from model/**/*.yaml by tools/docs_model during mkdocs build. Edit the YAML, not this page; hand-written design lives on the linked service, platform and plane pages.
| Workflow id | database-blueprint · version 1 · Draft (Draft → InReview → Published → Deprecated, BC-04) |
| Coordinator | database-blueprint-coordinator · family Blueprint & Microservice Assembly |
| Owner service | WorkflowEngineService (BC-38) under Run Control (BC-03) |
| Starts on | readiness bundle readiness-bundle-v1 → RunAccepted from RunControlService when payload.workflowId == 'database-blueprint' (event) |
| Steps | 5 · gated 0 · agents 1 |
| Budget per run | 600000 tokens · cap 60.0 USD · 240 min |
| Descriptor | workflow-definition-v1 · schema |
| Status | target |
Builds the Database Blueprint from the Service Blueprint and the derived domain model: stores per context, tables with tenant and classification conventions, retention and migration policy; validated against the DSL. A product without persistence yields a blueprint with no stores.
Authored design, Draft (D54, D57)
These definitions were authored from the coordinator cards as design assumptions. None is published, evaluated or has run; agents are named by id as design bindings, not as tested integrations.
Activation (readiness bundle)¶
The Workflow Engine's readiness correlation (BC-38, ADR-0026) joins the signals below per project and bundle fingerprint and submits one run through Run Control's SubmitRun; the run then starts on RunAccepted like every other definition. Nothing starts on a raw event.
| Slot | Kind | Descriptor | Required | Satisfied by | Predicate |
|---|---|---|---|---|---|
service-blueprint |
blueprint (Service) | blueprint-service-v1 |
yes | BlueprintService.BlueprintValidated |
payload.kind == 'Service' and payload.passed == true |
domain-model |
signal | artifact-v1 |
yes | BlueprintService.DomainModelDerived |
payload.aggregates > 0 |
- Consistency: members are satisfied only within the trusted tenant and project of the signal; a newer version of any member opens a new correlation and supersedes the open one
- Fingerprint: sha256 over the sorted list of slot
version:hash of every satisfied required and optional member
- Idempotency key:
{scope}:{operation}:{workflowReleaseId}:{bundleFingerprint} - Deduplication: the same key returns the existing run (SubmitRun: same Idempotency-Key, same canonical body); a new member version yields a new fingerprint and a new correlation, and the Open one is Superseded; a different body under the same key is a 409 and the correlation is Superseded with reason conflict
- Submit: workflow
database-blueprint(release aliaslatest), model profilecode-agent, inputreadiness-bundle-v1, client referencecorrelationId.
Definition¶
flowchart TD
start(("RunAccepted"))
derive_stores["Derive the stores"]
draft_database_blueprint["Draft the Database Blueprint"]
submit_version[["tool: Submit the Draft version"]]
validate[["tool: Validate the blueprint"]]
check_valid{"Validation passed?"}
start --> derive_stores
derive_stores --> draft_database_blueprint
draft_database_blueprint --> submit_version
submit_version --> validate
validate --> check_valid
done(("WorkflowRunCompleted"))
check_valid --> done
check_valid -. "retry up to 2" .-> draft_database_blueprint
classDef gated stroke:#B45309,stroke-width:2px
Shapes: rectangle = agent attempt · double rectangle = tool call · stadium = human decision · diamond = condition evaluated by the engine over recorded outputs · parallelogram = fan-out or join · circle = timer · cylinder = sub-workflow · flag = compensation. A thick amber border marks a gated step; a dashed edge is a bounded on_false loop. A step with a when guard runs only when its predicate over recorded outputs holds; otherwise the engine records it Skipped and its dependants treat it as satisfied (ADR-0027).
Steps¶
| # | Step | Kind | Runs | Gate | Class | Depends on | Retry | Timeout | Compensation | What it does |
|---|---|---|---|---|---|---|---|---|---|---|
| 1 | Derive the storesderive-stores |
agent | database-engineerskill database-engineer-derive-stores |
none | read | — | exponential ×3 (30s) | PT30M | — | Stores and ownership per context from the aggregates of the domain model; names the contexts without persistence. |
| 2 | Draft the Database Blueprintdraft-database-blueprint |
agent | database-engineerskill database-engineer-draft-database-blueprint |
none | sandbox | derive-stores | exponential ×3 (30s) | PT30M | — | Writes the Database Blueprint: tables, keys, TenantId and classification conventions, retention and the migration policy. |
| 3 | Submit the Draft versionsubmit-version |
tool | blueprint-submit-version |
none | shared-write | draft-database-blueprint | fixed ×2 (10s) | PT2M | — | Stores the document as a project-scope Draft BlueprintVersion of its kind (idempotent on document hash); a shared write that the project policy may gate; Draft versions are autonomous by default (D64). |
| 4 | Validate the blueprintvalidate |
tool | blueprint-validate |
none | sandbox | submit-version | fixed ×2 (10s) | PT5M | — | BlueprintService validates the version against blueprint-database-v1 and its rule set and returns a receipt; BlueprintValidated is emitted with passed true or false. |
| 5 | Validation passed?check-valid |
condition | engine | none | read | validate | none | PT1M | — | Engine condition over the recorded receipt; findings go back to the draft step up to twice, then the run fails with the report. Condition: steps.validate.validation-receipt.passed == true. On false: back to draft-database-blueprint up to 2 time(s) with steps.validate.validation-receipt. |
Step contracts¶
| Step | Inputs (name ← source) | Outputs (name: descriptor) |
|---|---|---|
derive-stores |
domain-model ← input.domain-modelservice-blueprint ← input.service-blueprint |
store-plan: artifact-v1 |
draft-database-blueprint |
domain-model ← input.domain-modelservice-blueprint ← input.service-blueprintstore-plan ← steps.derive-stores.store-plan |
database-blueprint-draft: blueprint-database-v1 |
submit-version |
document ← steps.draft-database-blueprint.database-blueprint-draft |
version-ref: blueprint-version-ref-v1 |
validate |
version-ref ← steps.submit-version.version-ref |
validation-receipt: blueprint-validation-receipt-v1 |
Every mapping names its source (input.* a workflow input, steps.* an ancestor's recorded output, bundle.* a readiness member) and the validator checks that every required input of the step's agent is mapped and that descriptors agree. |
Gates and approvals¶
- shared-write: creating a Draft blueprint version in project scope is autonomous unless the project policy (BC-20) gates blueprint drafts, in which case an approval bound to the document hash is requested (D64) Compensation steps run in reverse order of the succeeded steps on failure after the last checkpoint; a step without a compensation leaves its sandbox output in place and the run ends Failed with the evidence (ADR-0014, recovery not replay).
Inputs, outputs and events¶
| Direction | Name | Descriptor | Required |
|---|---|---|---|
| in | service-blueprint | blueprint-service-v1 |
yes |
| in | domain-model | artifact-v1 |
yes |
| out | database-blueprint | blueprint-database-v1 |
yes |
| out | validation-receipt | blueprint-validation-receipt-v1 |
yes |
Starts on RunAccepted from RunControlService when payload.workflowId == 'database-blueprint'; emits BlueprintValidated, plus the engine's WorkflowRunStarted, StepReady, StepRunStateChanged and WorkflowRunCompleted / WorkflowRunFailed and Run Control's run and attempt events (ADR-0014).
Decisions and traceability¶
- FR: FR-11 Compatible templates and libraries through release gates
- XL: XL-09 Generation yields a usable consumer
- ADRs: ADR-0014, ADR-0024, ADR-0026, ADR-0027 · ADR index
Definition authored 2026-11-05 to close the generation input gap (ADR-0027, D66); Draft until an evaluation gate (ADR-0021) and a review publish it as a BC-04 asset release. Validation is a tool call with a receipt and a bounded on_false loop (ADR-0026, D61).