Skip to main content

Blueprints

Blueprints are versioned, declarative bundles of Construction Kit (CK) models and runtime seed data that bootstrap a tenant — and continue to manage it across its lifetime. A blueprint can be installed, re-applied, updated, rolled back, uninstalled, and may depend on other blueprints. Versioned migration scripts transform tenant data when a blueprint's own version moves forward.

What a Blueprint Is​

A blueprint is essentially three things rolled into one artifact:

  • CK model dependencies — the schema (types, attributes, associations) the tenant needs before the seed data can be imported. The engine resolves and imports those CK models on apply.
  • Seed data — a runtime-model YAML file with the entities that should exist in the tenant after the apply.
  • Migration scripts — optional, versioned transformations executed when the blueprint moves from an older version to a newer one in an already-installed tenant.

Where a CK model defines the shape of data, a blueprint puts the first real data into a tenant. The two work in tandem: CK models alone leave a tenant empty; blueprints turn an empty tenant into a working one.

Properties​

PropertyDescription
VersionedSemVer (MyBlueprint-1.2.3). Version ranges express compatibility, like CK models.
Dependency-awareA blueprint may depend on other blueprints, resolved transitively at install time.
Owner-trackedEvery seed entity is tagged with rtBlueprintSource and rtBlueprintLocked.
UpdatableTenants are moved to newer versions via Safe / Merge / Full / Migration modes.
Rollback-ableDestructive operations create a tenant backup; Rollback restores the snapshot.
Multi-installA tenant can host several blueprints concurrently. Refcounted, cascade-uninstall optional.

Tenant-Scoped Storage​

Blueprint registry rows (BlueprintInstallation, BlueprintHistory, BlueprintBackup) live as CK entities inside the tenant's own runtime repository, alongside the seed data they describe. There is no cross-tenant collection — an apply in tenant X never writes outside tenant X. mongodump --db=<tenant> captures the registry along with the entities.

Blueprint Structure​

A blueprint is a directory containing a blueprint.yaml, an optional seed-data file, and optional migration scripts:

MyBlueprint-1.0.0/
├── blueprint.yaml
├── seed-data/
│ └── entities.yaml
└── migrations/
└── from-1.0.0.yaml

Blueprint YAML Schema​

$schema: https://schemas.meshmakers.cloud/blueprint-meta.schema.json
blueprintId: InfrastructureStarter-1.0.0
description: Infrastructure management starter blueprint

# CK models loaded into the tenant when this blueprint is applied
ckModelDependencies:
- System-[2.0,3.0)
- Commerce-[1.0,2.0)

# Other blueprints required before this one (resolved transitively, topo-sorted)
blueprintDependencies:
- BaseEntities-[1.0,)
- SecurityModel-[2.0,)

# Optional path to seed data (relative to blueprint root)
seedDataPath: seed-data/entities.yaml

# ... or a seed split across several files, merged into one model before import
seedDataPaths:
- seed-data/configurations/base.yaml
- seed-data/data-flows/camt053.yaml
- seed-data/identity/roles.yaml

# Optional: archives of the seed that stay Created on install and update
archiveActivation:
exclude:
- MyRollupWellKnownName

# Optional migrations from older versions of this blueprint
migrations:
- fromVersion: "0.9.0"
scriptPath: "migrations/from-0.9.0.yaml"
FieldTypeDescription
$schemastringSchema URI for validation
blueprintIdstringUnique ID with version (Name-Major.Minor.Patch)
descriptionstringOptional description
ckModelDependenciesstring[]CK models with version ranges (auto-imported on apply)
blueprintDependenciesstring[]Other blueprints with version ranges (resolved transitively)
seedDataPathstringOptional path to seed-data file (runtime-model format)
seedDataPathsstring[]Optional list of seed-data files, merged into one model before import
migrationsarrayOptional list of migration scripts keyed by source version
archiveActivationobjectOptional; exclude lists archives (rtId or well-known name) that stay Created, see Archives and rollups

Version Ranges​

Both ckModelDependencies and blueprintDependencies use the same range syntax as CK models:

FormatMeaning
1.0.0Exact version
[1.0.0,)Version 1.0.0 or higher
[1.0.0,2.0.0)Version >= 1.0.0 and < 2.0.0
(1.0.0,2.0.0]Version > 1.0.0 and <= 2.0.0
[1.5.0]Exactly version 1.5.0
CK ranges install the floor

For ckModelDependencies, the blueprint engine installs the range's lower bound on a fresh tenant (a tenant that already holds the same model at or above the floor, inside the declared range, is left untouched — no import, no downgrade; a tenant that holds a version outside the range, for example System 3.0.0 against [2.4,3.0), makes the apply fail before anything is installed, naming the model, the installed version and the range). The rule is the same for classic and range-retaining models, on the first install and on an update. The floor version must therefore be installable together with all sibling dependencies; after a dependency bump, raise the floor to the first version compiled against it. The seed-data file declares its own dependencies: pins independently of the manifest — keep both in sync. See Versioning Rules for the full picture.

Seed Data Format​

Seed data is a runtime-model YAML file. The blueprint engine stamps the source attributes during import; you do not write them yourself.

$schema: https://schemas.meshmakers.cloud/runtime-model.schema.json
dependencies:
- System-2.0.0
entities:
- rtId: 507f1f77bcf86cd799439011
ckTypeId: System/Entity
rtWellKnownName: InitialEntity
attributes:
- id: System/Name
value: My Initial Entity
- id: System/Description
value: Created by blueprint

Seed data is applied with upsert strategy: existing entities (matched by rtId) are updated; new ones are inserted.

Variables in Seed Data​

Seed values may contain blueprint variables in the form ${name}. The engine resolves them on install and update, with the values of the tenant the blueprint is applied to:

VariableValue
octo.tenantIdThe tenant being initialised
octo.systemTenantIdThe system tenant (default OctoSystem)
octo.isSystemTenant"true" in the system tenant, otherwise "false"
octo.versionThe OctoMesh release (three-part version, e.g. 3.5.75)
octo.environmentdev, test, staging or production
octo.environmentModeThe matching System/EnvironmentModes value (Development, Testing, Staging, Production)
octo.schemeURL scheme for composed service URLs (default https)
octo.domainPublic DNS suffix of the cluster, e.g. test-2.octo-mesh.com, without a trailing slash (empty when not configured)

A service can add further variables for the blueprints it applies through its own variable provider.

Variables are resolved in rtWellKnownName, in string attributes, in string lists and in the string members of records and record arrays at any depth. Numbers, booleans and enum values are left alone. An unknown ${name} is kept as it is and the install reports the warning Unknown blueprint variable (message 27), so a typo does not silently write an empty string.

Keeping a runtime placeholder: $${name}​

Some seed values hold placeholders that are filled later, at run time: a notification template whose ${count} is replaced when the notification is sent, or a KPI formula. These names come from query columns, not from the blueprint variables. Write them with a doubled $ so that the install stores them unchanged and does not warn:

- rtId: 'ec0000000000000000000d12'
ckTypeId: System.Notification/NotificationTemplate-1
rtWellKnownName: eda-process-failed
attributes:
- id: System.Notification/SubjectTemplate-1
value: 'Failed EDA processes in ${octo.tenantId}: $${count}'

After the install the template holds Failed EDA processes in <tenant>: ${count}; the notification fills in ${count} when it is sent.

  • $${…} becomes the literal ${…}; the text between the braces is kept as written ($${a->b} becomes ${a->b}) and may not contain braces.
  • The escape wins over a variable of the same name: $${octo.tenantId} stays ${octo.tenantId}.
  • Only $$ directly before { is an escape; $$5 stays $$5.
  • It works in every field that is resolved (see above), also in a blueprint whose tenant has no variables.
  • An unescaped unknown ${name} keeps its old behaviour: unchanged, with the warning. A placeholder that is not a variable name, such as ${a->b}, stays unchanged without a warning.
Minimum engine version

Older engines do not know the escape. They read $${name} as $ followed by the placeholder: an unknown name such as $${count} is stored with both $ and reported with the warning, a known variable such as $${octo.tenantId} becomes $ followed by its value. Use the escape in a blueprint only when every cluster that installs the blueprint runs an OctoMesh release that contains it: the first release after 3.5.75 (see the release notes). For the same reason a seed that already contains $${ is stored differently after the upgrade.

Splitting the Seed Across Several Files​

One entities.yaml becomes unreadable long before a rich blueprint is finished — data flows, pipelines, configurations, identity roles and master data all end up interleaved in a file where no diff is reviewable and no feature has an owner. seedDataPaths replaces the single seedDataPath with a list, so the seed can be organised by feature:

MyBlueprint/
├── blueprint.yaml
└── seed-data/
├── configurations/base.yaml
├── data-flows/camt053.yaml # one pipeline + its data flow per file
├── identity/roles.yaml
└── master-data/accounts.yaml
seedDataPaths:
- seed-data/configurations/base.yaml
- seed-data/identity/roles.yaml
- seed-data/data-flows/camt053.yaml
- seed-data/master-data/accounts.yaml

Each file is a complete runtime-model document with its own $schema and dependencies. The engine loads all of them, unions their dependencies, concatenates their entities and imports the result as one model:

  • Order does not matter. The merged import writes every entity before any association, so an association in the first file may reference an entity declared in the last one.
  • Duplicate entities across files are rejected — identity is the CK type plus the rtId, so the same id under two types stays legal (octo-bpm validate warns about it) while a real repeat is refused.
  • A missing file is an error as soon as more than one file is declared: importing the rest would leave the tenant partially seeded and still report success.
  • octo-bpm validate warns about YAML files under seed-data/ that no path references.
  • Backwards compatible — seedDataPath keeps working unchanged.

There is no directory or glob form: blueprints are served to the runtime over GitHub Pages, which offers no directory listing, so the set of files is written down in the manifest that is fetched anyway.

Lifecycle​

Apply Flow​

ApplyBlueprintAsync(tenantId, blueprintId, force)
│
├── 1. Resolve transitive blueprint dependency closure (topo-sorted)
│
├── 2. Conflict-check (CK versions, entity ownership, rtId collisions)
│ → BlueprintApplicationResult.Conflicts; abort on hard conflicts
│
├── 3. For each blueprint in topo order:
│ ├── Idempotency: same version installed → no-op
│ │ same version installed + --force → re-apply (upsert)
│ │ different version installed → Update path
│ ├── Import CK model dependencies (auto-resolve via ICkModelUpgradeService)
│ ├── Apply seed data via IImportRtModelCommand (Upsert)
│ ├── Activate the archives the seed created, queue rollup backfills
│ ├── Tag entities with rtBlueprintSource / rtBlueprintLocked / rtBlueprintAppliedAt
│ ├── Persist BlueprintInstallation
│ └── Publish BlueprintApplied event
│
└── 4. Append history entry, return result

Force Re-Apply and Runtime State​

Re-applying an installed blueprint version with --force (octo-cli -c InstallBlueprint -b MyBlueprint-1.0.0 -f) upserts every seed entity back to its seed values. This is the intended way to repair drifted seed data — but it also means any attribute value that operators or services changed after install is reset to what the seed ships, unless one of the following protects it:

  • Tenant-owned seed entities (rtBlueprintLocked: false in the seed) are created once and never overwritten; an unlocked tenant copy of a product-owned seed entity goes through conflict resolution.
  • Tenant-owned attributes (ownership: TenantOwned or Secret) are preserved in the same way as runtime state. The four ownership values, the blanking guard that keeps filled values when a seed is empty, and the preview with explicit confirmation are described in Blueprint Ownership.
  • Runtime-state attributes are preserved. A CK attribute flagged isRuntimeState: true in its model declares that its value is owned by the running system, not by seed data: the runtime import keeps the tenant's current value on upsert and applies the seed value only when the entity is first inserted. The preserve logic sits in the shared runtime-model import, so it covers blueprint applies and plain ImportRt -r alike.
  • Identity and creation stamp are kept. An upsert replaces the stored entity under the same rtId and keeps its rtCreationDateTime and rtCreatedBy (unless the imported file carries them, as an export does), so an updated entity does not look recreated. If the import cannot read the stored entities of a type, it stops before anything is written instead of replacing their runtime state with the seed values; retry the update.

Well-known runtime-state attributes:

ModelAttributesSince
System.StreamDataArchive.Status — a force re-apply no longer deactivates activated archives1.7.0
System.CommunicationHostname, IngressEnabled, ChartVersion, ValuesYaml, Values on workloads — operator- or CD-set deployment values survive a force re-apply3.28.0
System.CommunicationDeploymentState on pipelines and the other deployable entities — a deployed pipeline stays deployed through an update or a force re-apply, also when the seed declares DeploymentState: 0. When the update changes the definition of a deployed pipeline, the communication controller pushes the new definition to the running adapter after the update; no redeploy is neededearlier releases
Operational state in seed data

When authoring a blueprint, avoid shipping mutable operational state (status flags, counters, deployment values) in seed entities. If the attribute is not flagged isRuntimeState in its CK model, every force re-apply resets it to the seed value — which can silently disable archives, undo deployment configuration, or reset processing watermarks on a production tenant. Either leave such attributes out of the seed, or flag them isRuntimeState in the owning CK model (a MINOR model change).

Capabilities a Blueprint Needs​

A blueprint that lists System.Communication or System.Ai in its ckModelDependencies gets the matching tenant capability switched on by the platform. This happens for a tenant created with the blueprint (blueprintId of the tenant create), for InstallBlueprint, for a force re-apply and for UpdateBlueprint:

Dependency of the blueprintEnabled by the platform
System.CommunicationCommunication (Communication Controller)
System.AiAI and Communication (AI needs Communication)

The blueprint itself stays declarative - there is no capability field. The blueprint engine reports the CK model dependencies of the applied blueprint and of the blueprints it pulled in with the BlueprintApplied / BlueprintUpdated event, and the Communication Controller and the AI service enable their capability from it. A capability is enabled only for the tenant of the event, only while that blueprint is installed there in exactly the version of the event, and never for the system tenant. AI waits for Communication and never enables it itself. Nothing is ever disabled, and a failure to enable never fails the blueprint operation: it is logged with the tenant and the cause, and the capability can be enabled by hand. A successful automatic enable is logged at Information level.

EnableCommunication / EnableAi are still needed:

  • for a tenant that has no blueprint with such a dependency (for example a tenant whose pipelines are imported by hand);
  • after DisableCommunication / DisableAi, until a blueprint that needs the capability is installed, force re-applied or updated again - that operation enables it again;
  • when the services that reported the event run an older version (the event then carries no dependencies and nothing is enabled).

Names match exactly: System.Communication.Extra or System.Ai.Builder enable nothing.

Known limitation

CK model dependencies of CK models are not followed. When only your own CK model depends on System.Ai or System.Communication, list System.Ai / System.Communication directly in the blueprint's ckModelDependencies, otherwise nothing is enabled.

Switching Communication on brings the Mesh Adapter (System.Communication/Adapter, rtId 670000000000000000000002) into the tenant. A blueprint whose pipelines point at it (System.Communication/Executes) is applied before the platform switches Communication on, so the adapter does not exist yet when the seed is imported. Such associations are not lost: the blueprint operation keeps them and reports them as a warning in its result ("... association edge(s) of the seed point at entities the tenant does not hold yet; they are kept and written as soon as both ends exist"). As soon as Communication is switched on - by the platform right after the install, or later with EnableCommunication - the associations are written and the pipelines are attached to the adapter exactly as if Communication had been on before the install.

Kept associations are written only while the blueprint is still installed and never over a link the tenant made in the meantime (a pipeline already attached to another adapter keeps it; this is logged as a warning). Associations with attribute values and identity associations are not kept: they are reported as a warning, and you apply the blueprint again once both ends exist. Older platform services drop such associations; there, run EnableCommunication before you install the blueprint.

Archives and Rollups in a Blueprint​

A blueprint can ship stream-data archives (raw, time-range and rollup archives) in its seed. On install, forced re-apply and update the platform activates every archive the seed created and queues a backfill for every new rollup, so a new tenant gets working archives without ActivateArchive or BackfillRollup:

  • Raw and time-range archives are activated first, then the rollups, each after the new rollups it reads from.

  • A new rollup gets a background backfill over the history of its sources. Empty sources mean "nothing to backfill"; a rollup of a new rollup fills when the backfill of its source has finished. Follow the jobs with the recompute jobs of the rollup.

  • Archives that already exist on the tenant are never touched, whatever their status. Re-applying a blueprint (also with --force) activates nothing, and an archive an operator left Created or Disabled stays so. An update that adds an archive activates only that one.

  • Opt-out: list archives that must stay Created in blueprint.yaml:

    archiveActivation:
    exclude:
    - GridConnectionRollup1h # well-known name
    - 6a0e000000000000000a0007 # or rtId
  • Stream data switched off: the install succeeds without the stream-data part: the System.StreamData dependency is not installed and the archives of the seed are not created. The result reports each of them as SkippedStreamDataDisabled with a warning. After EnableStreamData, re-apply the blueprint with force to create and activate them.

  • A failed activation does not fail the install: the archive is set to Failed (retry with RetryArchiveActivation), the result names it and the reason, and the other archives are activated.

  • Limitation: a new rollup with TimeWeightedAvg or StateDuration over a raw archive is activated, but its history is not backfilled automatically (the statement over a long history exceeds the CrateDB memory limit). The result carries a warning; the rollup aggregates new data.

  • Give every seed archive an rtId and leave Archive.Status at 0 (Created) or out of the seed.

The install and update results list every archive with its outcome (Activated, SkippedPreExisting, SkippedOptOut, SkippedStreamDataDisabled, Failed) and, for rollups, the backfill (Queued with the job id, NothingToBackfill, NotQueued, Failed): REST field archiveActivations of the install and update result, GraphQL BlueprintApplyResult.archiveActivations.

Behaviour change

Before this change a blueprint left its archives Created and every archive had to be activated by hand. Blueprints that relied on that should list such archives in archiveActivation.exclude.

Secret Attributes in Seed Data​

A blueprint never ships credentials. For attributes of value type Secret, seed data may contain only no value, an empty value or null. Placeholders such as <set-after-install> or TODO_SET_CLIENT_SECRET are not allowed — they would be imported as an ordinary (encrypted) value.

entities:
- rtId: 65f1c0a2b3d4e5f601234567
ckTypeId: System.Communication/EMailReceiverConfiguration
rtWellKnownName: SupportMailbox
attributes:
- id: System.Communication/UserName
value: support@example.com
- id: System.Communication/Password
value: ""

The secret is imported as "not set". Because the ownership of a Secret attribute is always Secret, a re-apply — including a force re-apply — keeps a value that was set after installation. Set the secrets after installing the blueprint, in the Studio, with octo-cli or through the API (see Secret Attributes in the API).

The blueprint build lint fails when a seed sets any non-empty value for a Secret attribute, placeholders included; the error names the entity and the attribute, never the value. Secret sub-attributes inside records are checked too. If a real credential was ever committed, rotate it — removing it from the seed is not enough.

Types Whose Create Is Replaced by a Method​

A blueprint writes its seed data, its update diff and the Add steps of its migrations directly; it never calls a CK method. A type whose static method declares replacesGenericCreate (or a type derived from it) can therefore not be created by a blueprint: the seed would skip what the method guarantees, for example a certificate or the provisioning of a device.

The engine checks this before anything is written:

  • Install and re-apply: if the seed data contains a new entity of such a type, the apply fails and no entity of that blueprint is written. The blueprint is not recorded as installed.
  • Update: a new entity of such a type in the update refuses the whole update, in every update mode. ContinueOnError does not soften it.
  • Migration: the Add step fails with the same error.

An entity whose rtId already exists in the tenant is not new: it is upserted as before. A seed entity without an rtId counts as new. Blueprints without such types are not affected.

Every refused entity gets its own error with the number 136 (BlueprintSeedCreateReplacedByMethod, see compiler messages). It names the rtId, the CK type, the qualified method id (for example Industry/Device.Provision-1) and the reason GENERIC_CREATE_REPLACED_BY_METHOD.

To ship such entities, create them through the method after the blueprint is applied (for example from a pipeline), or leave them out of the seed.

Attributes Only a Method May Write​

A blueprint never calls a CK method, so it cannot set an attribute whose CK assignment declares access: Hidden or access: MethodOnly (also as a member of a record). The engine checks this before anything is written, at the same places as the replaced create check:

  • Install and re-apply: a seed entity that carries such a value refuses the whole apply. The blueprint is not recorded as installed.
  • Update: an entity of the update diff that carries such a value refuses the whole update, in every update mode. ContinueOnError does not soften it.
  • Migration: an Add step whose entity carries such a value, and an Update or Transform step that writes (or, for Rename and Delete, clears) such an attribute, fail before the first entity is changed.

Every refused value gets its own error with the number 139 (RtAttributeWriteRestricted, see compiler messages); it names the rtId, the CK type and the attribute path. ReadOnly attributes can be set by a blueprint.

Entity Source Tracking​

Every seed entity is stamped with three system attributes when applied:

AttributeTypeDescription
rtBlueprintSourcestringOwning blueprint, full id (Infrastructure-1.0.0). Exactly one owner per entity.
rtBlueprintLockedbooltrue = managed by blueprint, updates will overwrite; false = tenant-owned: created once, never updated or re-created (see Blueprint Ownership).
rtBlueprintAppliedAtDateTimeUTC timestamp of the most recent apply/update touching this entity.

A blueprint that ships an entity but wants to leave it user-editable from day one can set rtBlueprintLocked: false in its seed data. Such an entity is tenant-owned: it is created on the first install, and afterwards no update or forced re-apply changes its attributes or brings it back after the tenant deleted it. Only its blueprint stamp is refreshed.

Read-only for users: ProtectBlueprintLocked​

By default rtBlueprintLocked only steers blueprint updates: a user can still edit or delete a locked entity. A blueprint author can make the product-owned entities of a CK type read-only for users in the guarded entity-write paths (all GraphQL mutations), by shipping a data policy that opts the type in. This is done in the blueprint's seed data, not in code.

  1. Add a System.Identity/DataPolicy entity to the seed data, with the type in TargetCkTypeIds and the attribute ProtectBlueprintLocked: true (Boolean, default false). Use a policy of its own for each protected type; do not set the flag on shared policies such as a master-data policy.
  2. The policy is a restriction, not a grant: it applies whatever other policies grant, and derived types of the target type inherit it. Because the type is now covered by a policy, give the roles that may work with the type the normal grants (Read, Write, Delete) through the policy's permission, as for any other data policy.
  3. Raise the blueprint's dependency on System.Identity to the version that introduced ProtectBlueprintLocked.

Effect for non-system callers on a protected type (the paths that are not covered are listed at the end of this section):

  • Updating, replacing or deleting an entity whose stored rtBlueprintLocked is true is refused with the stable error BLUEPRINT_LOCKED (message number 6384). The whole change set is rejected, nothing is written.
  • Entities with rtBlueprintLocked false or absent stay fully editable. Seed the entities that the tenant should own with rtBlueprintLocked: false.
  • Users cannot set rtBlueprintLocked, rtBlueprintSource or rtBlueprintAppliedAt on insert and cannot change them on update; an unchanged round trip of a form passes. Other types are unchanged.
  • Reads are never affected.
  • The policy's enforcement mode applies: Enforce refuses, AuditOnly lets the change through and publishes one DataPermissions.BlueprintLockViolation audit event.

Blueprint install, update and forced re-apply run in the system context and are not blocked. Models/ImportRt applies the same rule end to end: the import job runs on behalf of the initiating caller and fails as a whole, before anything is written, when the file would overwrite a locked entity of a protected type. rtBlueprintLocked, rtBlueprintSource and rtBlueprintAppliedAt of an exported file are stripped from the incoming entities of protected types, so an export from another tenant can still be imported (the entities become tenant-owned). A pipeline node with Identity: ServiceAccount is guarded like a user; use Identity: System for pipelines that must write product-owned entities. The setting is read from a cache that is refreshed within a minute. Associations of locked entities are not covered.

Creating a Blueprint​

A blueprint is just three files (or two if it has no migrations). The minimum viable case:

Step 1 — Create the folder layout​

HelloBlueprint-1.0.0/
├── blueprint.yaml
└── seed-data/
└── entities.yaml

Step 2 — Write blueprint.yaml​

$schema: https://schemas.meshmakers.cloud/blueprint-meta.schema.json
blueprintId: HelloBlueprint-1.0.0
description: |
Seeds two AutoIncrement counters used by the demo invoice and order flow.
ckModelDependencies:
- System-[2.0,3.0)
seedDataPath: seed-data/entities.yaml

Step 3 — Write seed-data/entities.yaml​

$schema: https://schemas.meshmakers.cloud/runtime-model.schema.json
dependencies:
- System-2.0.0
entities:
- rtId: 65d5c447b420da3fb1238201
ckTypeId: System/AutoIncrement
rtWellKnownName: InvoiceCounter
attributes:
- id: System/AutoIncrement.End
value: 999999
- id: System/AutoIncrement.CurrentValue
value: 1000
- id: System/AutoIncrement.Format
value: "INV-{0:D6}"
- rtId: 65d5c447b420da3fb1238202
ckTypeId: System/AutoIncrement
rtWellKnownName: OrderCounter
attributes:
- id: System/AutoIncrement.End
value: 99999
- id: System/AutoIncrement.CurrentValue
value: 100
- id: System/AutoIncrement.Format
value: "ORD-{0:D5}"

Step 4 — Place the folder into a catalog​

The simplest catalog is the local file system. The asset-repo service expects blueprints at the path configured via LocalFileSystemBlueprintCatalogOptions.RootPath. For local development that defaults to ~/.octo/local-blueprint-catalog/:

~/.octo/local-blueprint-catalog/
└── blueprints/v1/
└── HelloBlueprint/
└── 1.0.0/
├── blueprint.yaml
└── seed-data/
└── entities.yaml

For published catalogs (GitHub-Pages-hosted), the same layout applies, but a generated catalog.json index sits at each level — see GitHub Catalog Layout below.

Step 5 — Install​

octo-cli -c InstallBlueprint -b HelloBlueprint-1.0.0

Or via Refinery Studio: see the Studio user guide.

Building On Top of Another Blueprint​

Blueprints compose through dependencies, not by bundling. To extend an existing blueprint:

  1. Declare the dependency in your blueprint.yaml:

    blueprintDependencies:
    - HelloBlueprint-[1.0,2.0)
  2. Reference its CK models indirectly. You don't list them again — the dependency closure already imports them.

  3. Add your own seed data. Your entities live in your blueprint's rtBlueprintSource namespace; the entities from HelloBlueprint remain owned by it.

  4. Apply normally. The engine resolves the transitive closure, applies dependencies first (topo-sorted), then your blueprint:

    octo-cli -c InstallBlueprint -b ExtendedHello-1.0.0

    ListBlueprintInstallations then shows both blueprints — HelloBlueprint carries IsDependency: true.

Ownership Rules​

  • Each entity has exactly one owning blueprint (rtBlueprintSource).
  • A dependent blueprint cannot mutate entities owned by its dependencies through seed data — that path raises a UserModified / OwnershipConflict during apply.
  • If the dependent really needs to evolve those entities, ship a migration script that targets them by rtId or by rtWellKnownName + blueprintSourceOnly: true.

Uninstall and Refcounts​

  • Uninstalling ExtendedHello does not remove HelloBlueprint if any other installed blueprint still depends on it (refcount > 0).
  • octo-cli -c UninstallBlueprint -n ExtendedHello -c cascades: removes ExtendedHello and orphan-cleans transitively-depending blueprints whose refcount drops to zero.

Update Modes​

ModeBehaviour
SafeAdd new entities only. Existing entities are left alone, even if locked.
MergeAdd new + upsert locked entities. Tenant-owned seed entities (rtBlueprintLocked: false in the seed) are skipped without a conflict; an unlocked tenant copy of a product-owned seed entity raises a UserModified conflict (default: skip).
FullLike Merge, plus delete entities that exist in the tenant but no longer in the seed. Unlocked → conflict.
MigrationExecute the migration script from the installed version to the target. Required for any non-additive change.

A pre-update backup is created by default (CreateBackup = true). Disable it with CreateBackup = false only when you have an alternate snapshot mechanism.

Updates That Would Break an Installed Model​

A blueprint installs its ckModelDependencies as the floor of each range, as an exact model version. If the tenant holds that model in an older version, the install replaces it, and an installed model that is pinned to the old version (a classic, exact-pinned model such as EnergyCommunity.Registration-2.8.0 pinned to Basic-2.4.0) turns ResolveFailed. The tenant upgrade guard that judges a CK library import (see Library Management) therefore also judges a blueprint:

  • The update set is the CK models the blueprint installs or raises: every ckModelDependencies floor the tenant does not already hold in a satisfying-or-newer version (a newer version inside the range is kept and is not part of the set). Service-managed models (System, System.*) are not judged. The set is judged as one set, together with the dependency blueprints of a first-time install, and together with the dependency updates the import of these models pulls in: the same set the import dialog and the library status judge. If a declared model brings a newer catalog dependency with it (for example Industry.Energy-3.6.0 brings Basic-2.5.0) and an installed model is pinned to the old version of that dependency, the preview shows the blueprint as blocked and names the pulled-in dependency update in update, the installed model in dependent and the pin in subject. ckUpdateSet still lists the models the blueprint itself installs or raises; the pulled-in dependency updates appear as the update of a blocker.
  • Preview (POST {tenantId}/v1/blueprints/updates/preview, octo-cli PreviewBlueprintUpdate) is read-only and reports isBlocked, ckUpdateSet and blockers[] next to the existing members (same entries as the LibraryStatus blockers: dependent, update, kind, subject, code, message, resolveHint). canProceed is unchanged: it answers for entity conflicts only.
  • Apply (POST {tenantId}/v1/blueprints/apply for a first install, POST {tenantId}/v1/blueprints/updates/apply for an update; octo-cli InstallBlueprint and UpdateBlueprint) refuses a blocked set with HTTP 409 and the stable code CK_UPGRADE_BLOCKED before the first change: no CK model is installed, no seed data is written, the installation record and the history are unchanged. The body is the same application/problem+json as the import refusal (code, updateSet, blockers[], an English detail), plus blueprintId.
  • A dry run (dryRun: true, UpdateBlueprint --dry-run) never refuses: it answers 200 with isBlocked and the blockers and writes nothing.
  • The override is the request member forceBreakingUpdate (default false; octo-cli UpdateBlueprint --force, InstallBlueprint --forceBreakingUpdate). It needs the Data Model Management policy (403 without it, with or without blockers). A forced operation proceeds, returns the forced blockers in blockers[] and leaves one WARN log line with the tenant, the caller, the blueprint, the update set and every blocker. If the guard itself fails, the operation fails with 500 even when forced. InstallBlueprint --force keeps its meaning (re-apply the seed data) and does not override the guard.
  • A blueprint whose CK models only add models, or raise models nobody depends on, is not affected: nothing in the request, the response or the behavior changes.
  • The GraphQL mutations blueprints { install } and blueprints { applyUpdate } (roles AdminPanelManagement and, since r3.5.67, DataModelManagement) enforce the guard as well and have no force option. A refused call answers HTTP 200 with one error (path = blueprints.install / blueprints.applyUpdate) and the mutation field null; there is no second error and blueprints itself stays in the response. The language-neutral data is in the error's extensions: code = CK_UPGRADE_BLOCKED, blueprintId, updateSet (full model ids) and blockers[] with the same members as the LibraryStatus blockers (dependent, update, kind, subject, code, message, dependentIsInUpdateSet, suggestedDependentUpdate, resolveHint). The English message names the blueprint, the update set and the blockers, and tells the caller to update the dependent models first. The mutation fields install, applyUpdate and uninstall are nullable so that an error never cascades to the parent fields. previewUpdate returns isBlocked, ckUpdateSet and blockers without an error. Blueprints that the platform applies itself at tenant setup (service-managed blueprints) are not guarded.
{
"type": "https://schemas.meshmakers.cloud/errors/ck-upgrade-blocked",
"title": "The update would break installed CK models",
"status": 409,
"detail": "Blueprint Shop-2.0.0 would install Basic-2.5.0, which would break 1 installed model(s): ... Nothing was changed. ...",
"code": "CK_UPGRADE_BLOCKED",
"blueprintId": "Shop-2.0.0",
"updateSet": ["Basic-2.5.0"],
"blockers": [ { "dependent": "EnergyCommunity.Registration-2.8.0", "update": "Basic-2.5.0", "kind": "ExactPin", "subject": "Basic-2.4.0", "code": "CK_UPGRADE_EXACT_PIN", "message": "...", "resolveHint": "update EnergyCommunity.Registration to 2.10.0 first" } ]
}

Compatibility: a blueprint install or update that breaks an installed model is now refused with 409 - clients that predate the guard see an unexpected error status. The request member is optional and the response members are additive.

Conflict Resolution​

A conflict is raised when an unlocked tenant entity (rtBlueprintLocked = false) is in the way of an update, unless the seed itself declares the entity tenant-owned: that entity is skipped without a conflict.

TypeTriggered when
UserModifiedThe seed wants to update this entity, but the tenant entity has been unlocked.
DeleteModifiedFull mode wants to delete this entity (no longer in seed), but the tenant entity has been unlocked.

Default per-entity resolution is Skip. The caller can override per-entity:

ResolutionBehaviour
KeepUserKeep the user's version, skip the blueprint change.
KeepBlueprintApply the blueprint's version. UserModified: seed is re-applied and the entity is re-locked. DeleteModified (Full only): entity is erased.
MergeCurrently treated as KeepUser (semantic 3-way merge is out of scope).
SkipSkip this entity.

Migration Scripts​

For non-additive changes (rename, delete, transform), ship a migration script and reference it from blueprint.yaml:

# MyBlueprint-2.0.0/migrations/from-1.0.0.yaml
$schema: https://schemas.meshmakers.cloud/blueprint-migration.schema.json
sourceVersion: "1.0.0"
targetVersion: "2.0.0"
description: "Migration from v1 to v2"

preConditions:
- type: EntityExists
target:
ckTypeId: System/Entity
rtWellKnownName: MainConfig

steps:
- stepId: rename-config-field
action: Transform
target:
ckTypeId: System/Entity
blueprintSourceOnly: true
transform:
type: Rename
sourceAttribute: LegacyVersion
targetAttribute: Version

- stepId: delete-deprecated
action: Delete
target:
ckTypeId: System/Entity
rtWellKnownName: LegacyConfig
blueprintSourceOnly: true

postValidations:
- validationId: still-have-config
type: EntityCount
target:
ckTypeId: System/Entity
expectedCount: 5
severity: Error

Reference from the manifest:

migrations:
- fromVersion: "1.0.0"
scriptPath: "migrations/from-1.0.0.yaml"

Supported step actions​

ActionPurpose
AddInsert an entity (data carries the full RtEntityTcDto payload).
UpdateUpdate attributes on matching entities (data is a { attributeName: value } dict).
DeleteErase matching entities (DeleteOptions.Erase — permanent).
RenameRename an attribute on matching entities (shorthand for Transform of type Rename).
TransformType-driven: Rename, Copy, Delete, SetValue, MapValue.

For CK model migrations (when the schema itself evolves), see CK Model Migrations. Blueprint migrations transform runtime entities; CK migrations transform the schema and the entities together.

Multi-Blueprint Installation​

A tenant can host any number of blueprints concurrently. Two services track this state:

InterfacePurpose
ITenantBlueprintInstallationsThe current set of installed blueprints (one row per blueprint, with IsDependency flag).
ITenantBlueprintHistoryAppend-only operation log (install, update, rollback, uninstall) with timestamps and counts.

Both are persisted as CK entities (System/BlueprintInstallation, System/BlueprintHistory) inside the tenant's own runtime repository.

Backup and Rollback​

Every update creates a pre-update backup by default. Rollback restores the entire tenant snapshot — it is a full restore, not a semantic undo of migration steps. After rollback, the BlueprintInstallation rows match the snapshot; partial undo is not supported.

Catalogs​

CatalogDescription
LocalFileSystemBlueprintCatalogLoads blueprints from the file system.
EmbeddedResourceBlueprintCatalogLoads blueprints from assembly resources.
PublicGitHubBlueprintCatalogReads blueprints from a public GitHub Pages site.
PrivateGitHubBlueprintCatalogReads blueprints from a private/internal GitHub repository (writes via Octokit).

GitHub Catalog Layout​

blueprints/v1/
├── catalog.json # Root catalog index
└── m/ # First letter of blueprint name (lowercase)
└── MyBlueprint/
├── catalog.json # Library catalog (one entry per major version)
└── 1/
├── catalog.json # Version catalog (list of versions)
└── MyBlueprint-1.0.0/
├── blueprint.yaml
├── seed-data/
└── migrations/

The three catalog.json levels are generated by the publish flow on the engine side — application code talks to IBlueprintCatalogManager, not to the catalog files directly.

Publishing and Versions​

A published blueprint version is immutable: installations that already hold it rely on its content. Change the content, raise the version. octo-bpm checks this before anything is published:

octo-bpm -c validateVersion -p <blueprint dir> -cn <catalog>
octo-bpm -c publish -p <blueprint dir> -c PrivateGitHubBlueprintCatalog

validateVersion compares every file below the blueprint directory with the published version (line endings normalized) and never writes anywhere:

ResultMeaning
validThe version is new and higher than every published one, or it is already published with identical content (the publish then skips it). A new version with content identical to the highest published one is valid with a warning.
OCTO-BP100The version is already published with different content. Raise the version.
OCTO-BP101The version is lower than the highest published version. Downgrades are not allowed.
OCTO-BP102The catalog could not be read, so the baseline is unknown. Never treated as a first publication.
OCTO-BP103A blueprintDependencies range is satisfied by no published version and by no blueprint validated earlier in the same call.

Each of OCTO-BP100 to OCTO-BP103 ends the command with a non-zero exit code; a warning does not. Gate CI on != 0. A file that exists only in the published version (deleted or renamed locally) cannot be detected through the catalog, so renaming or removing a file needs a version bump as well.

publish checks the target catalog only: a version that is already there is reported as already exists and is not written again. -f / --force overwrites it — use it only for the development lane catalog (octo-catalog-dev), never for the private or the public catalog.

Meshmakers CI (pipeline step validate-and-publish-blueprints) validates every build and publishes only after the build and the tests have passed: development builds to the private catalog, releases to the private and the public catalog.

Best Practices​

  1. Small, focused blueprints. One blueprint per domain/feature. Compose via blueprintDependencies, not by bundling unrelated entities.
  2. Use version ranges for dependencies. [1.0,) keeps things flexible; pinning exact versions is fine for blueprintId but rarely useful in dependencies.
  3. Sparse seed data. Ship essential bootstrap data only — no test data, no per-customer specifics, and never credentials (see Secret attributes in seed data).
  4. Lock managed entities. Default rtBlueprintLocked is true; only override to false when you intend the user to take ownership immediately: an unlocked seed entity is created once and then belongs to the tenant, no update changes it and none brings it back after a delete. Keep the entities the product needs locked. To keep users from editing locked entities, opt the type in with ProtectBlueprintLocked.
  5. Migration scripts for breaking changes. Schema renames, deletes, and value transformations need an explicit script. Additive changes work via Merge alone.
  6. Test with dry-run and read the preview. UpdateBlueprint -dr simulates without persisting; PreviewBlueprintUpdate lists the tenant values a seed would blank (see Blueprint Ownership) and the installed models the blueprint's CK models would break (see above). Raise the floor of a CK dependency only together with the dependents that are pinned to the old version.
  7. Keep backups. Default backup creation is on; only disable it when you have an alternate snapshot mechanism.

See Also​