Skip to content

Workflow — Backend library 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 backend-library-blueprint · version 1 · Draft (Draft → InReview → Published → Deprecated, BC-04)
Coordinator backend-library-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 == 'backend-library-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 Backend Library Blueprint from the Service Blueprint and the derived domain model: the shared kernels more than one context needs, their layer, capability area and public surface. A product without a shared kernel yields a blueprint that declares no library.

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 backend-library-blueprint (release alias latest), model profile reasoning-high, input readiness-bundle-v1, client reference correlationId.

Definition

flowchart TD
    start(("RunAccepted"))
    identify_shared_kernels["Identify the shared kernels"]
    draft_backend_library_blueprint["Draft the Backend Library Blueprint"]
    submit_version[["tool: Submit the Draft version"]]
    validate[["tool: Validate the blueprint"]]
    check_valid{"Validation passed?"}
    start --> identify_shared_kernels
    identify_shared_kernels --> draft_backend_library_blueprint
    draft_backend_library_blueprint --> submit_version
    submit_version --> validate
    validate --> check_valid
    done(("WorkflowRunCompleted"))
    check_valid --> done
    check_valid -. "retry up to 2" .-> draft_backend_library_blueprint
    classDef gated stroke:#B45309,stroke-width:2px
Hold "Alt" / "Option" to enable pan & zoom

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 Identify the shared kernels
identify-shared-kernels
agent solution-architect none read — exponential ×3 (30s) PT30M — Value objects, rules and contracts that more than one bounded context of the domain model uses, and the contexts that would own a copy otherwise.
2 Draft the Backend Library Blueprint
draft-backend-library-blueprint
agent solution-architect none sandbox identify-shared-kernels exponential ×3 (30s) PT30M — Writes the Backend Library Blueprint: one library per shared kernel with its layer, capability area, namespaces, options sections and registration API, and no reference to a product module.
3 Submit the Draft version
submit-version
tool blueprint-submit-version none shared-write draft-backend-library-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 blueprint
validate
tool blueprint-validate none sandbox submit-version fixed ×2 (10s) PT5M — BlueprintService validates the version against blueprint-backend-library-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-backend-library-blueprint up to 2 time(s) with steps.validate.validation-receipt.

Step contracts

Step Inputs (name ← source) Outputs (name: descriptor)
identify-shared-kernels service-blueprint ← input.service-blueprint
domain-model ← input.domain-model
kernel-plan: artifact-v1
draft-backend-library-blueprint service-blueprint ← input.service-blueprint
domain-model ← input.domain-model
kernel-plan ← steps.identify-shared-kernels.kernel-plan
backend-library-blueprint-draft: blueprint-backend-library-v1
submit-version document ← steps.draft-backend-library-blueprint.backend-library-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 backend-library-blueprint blueprint-backend-library-v1 yes
out validation-receipt blueprint-validation-receipt-v1 yes

Starts on RunAccepted from RunControlService when payload.workflowId == 'backend-library-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 · XL-15 Upgrade without breaking consumers
  • ADRs: ADR-0014, ADR-0024, ADR-0026, ADR-0027, ADR-0030 · ADR index

Definition authored 2026-11-05 so that no awaited blueprint kind depends on a person authoring it by hand (ADR-0030, D78); 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).