Skip to content

Workflow — API contracts

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 api-contracts · version 1 · Draft (Draft → InReview → Published → Deprecated, BC-04)
Coordinator api-contract-coordinator · family API & Gateway Design
Owner service WorkflowEngineService (BC-38) under Run Control (BC-03)
Starts on BlueprintValidated from BlueprintService (event)
Steps 4 · gated 0 · agents 1
Budget per run 600000 tokens · cap 60.0 USD · 240 min
Descriptor workflow-definition-v1 · schema
Status target

Generates the OpenAPI and gRPC contracts of a validated Service Blueprint's operations, lints them against the API governance rules and stores them as artifacts.

Authored design, Draft (D54, D57)

These definitions were authored on 2026-10-14 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.

Definition

flowchart TD
    start(("BlueprintValidated"))
    derive_operations["Derive the operations"]
    draft_contracts["Draft OpenAPI and gRPC"]
    lint[["tool: Lint the contracts"]]
    store["Store with lineage"]
    start --> derive_operations
    derive_operations --> draft_contracts
    draft_contracts --> lint
    lint --> store
    done(("WorkflowRunCompleted"))
    store --> done
    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 · parallelogram = fan-out or join · circle = timer · cylinder = sub-workflow · flag = compensation. A thick amber border marks a gated step.

Steps

# Step Kind Runs Gate Class Depends on Retry Timeout Compensation What it does
1 Derive the operations
derive-operations
agent api-designer none read — exponential ×2 PT30M — Lists operations, scopes, idempotency and side-effect classes per context.
2 Draft OpenAPI and gRPC
draft-contracts
agent api-designer none sandbox derive-operations exponential ×2 PT30M — Writes the contracts with the house conventions and the published-language envelope.
3 Lint the contracts
lint
tool shell-sandbox none sandbox draft-contracts fixed ×2 PT10M — Runs the contract linters in the sandbox; violations return to the draft step.
4 Store with lineage
store
agent api-designer none sandbox lint exponential ×2 PT30M — Stores the contracts with lineage to the blueprint.

Gates and approvals

No approval is required: every step runs in the read or sandbox class; the agents' own tool calls still carry their classes (D21). 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
in service-blueprint blueprint-service-v1
out api-contracts artifact-v1

Starts on BlueprintValidated; emits ArtifactStored, 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-08 Validated artifacts with lineageXL: XL-09 Generation yields a usable consumer · XL-15 Upgrade without breaking consumersADRs: ADR-0014, ADR-0024 · ADR index

Definition authored 2026-10-14 from the coordinator card api-contract-coordinator (D54); Draft until an evaluation gate (ADR-0021) and a review publish it as a BC-04 asset release.