Blueprints
A blueprint is a reusable workflow published in a remote repository, verified by checksum and installed against typed inputs that the operator binds at install time. Administrators decide which repositories are trusted, and installing is a household-member action.
After a blueprint install, rollback, update or repair commits, and after a workflow bundle import publishes a workflow, Reeve scans the published workflow for device references, along with the automations bound to it and the workflows that call it, so problems appear as they do after an editor publish. An update or repair whose rendered definition and input/output parameter documents are structurally unchanged writes no new workflow version and skips the scan.
The official blueprints are in reeve-iot/reeve-blueprints.
Repository manifest
The manifest is the file reeve-blueprints.json, at the repository root or under the repository's configured path:
{ "schemaVersion": 1, "blueprints": [ {
"id": "motion-lights", "name": "Motion Lights", "version": "1.0.0",
"file": "blueprints/motion-lights.json", "checksum": "sha256:<hex>",
"tags": ["lighting"], "minPlatformVersion": "1.0.0", "author": "<author>",
"description": "Turn on lights when motion is detected." } ] }
id, name, version, file and checksum are required. schemaVersion must be 1. An unknown version is
rejected and recorded as the repository's last sync error. Each referenced file is a workflow export with the
blueprint's own id, author, tags, version, inputs and changelog beside it. Any other member is refused by
name with a 400, as schemas/blueprints.schema.json lists.
Raw URLs resolve for the common hosted-Git layouts, or from a configured template such as
https://<host>/raw/{branch}/{path}. Private repositories, SSH and clone-based clients are not supported. A
repository may instead reference a stored credential, which is attached only to requests whose host belongs to that
repository.
Install-time placeholders versus runtime expressions
Blueprints use two separate syntaxes, and they must not be mixed.
| Syntax | Resolved by | When |
|---|---|---|
{{input.<name>}} |
The blueprint installer | At install time, on the server, once. Pure string substitution. |
${…} |
The runtime expression engine | At workflow execution time, on every run. |
The installer never invokes the expression engine. A bound value that itself contains an expression is substituted as a literal string, and the expression engine evaluates it later during execution.
Input schema
The input schema is published as schemas/blueprints.schema.json.
| Field | Required | Meaning |
|---|---|---|
name |
yes | Identifier referenced as {{input.<name>}}. Names must be unique within a blueprint. |
label |
yes | Form label |
description |
no | Helper text under the field |
required |
no | Defaults to true |
default |
no | Shown in the form. It is not merged into the bindings, see install processing order. |
selector |
yes | Typed selector |
The set of selectors is closed:
| Type | Config | Result |
|---|---|---|
device |
deviceType?, capability? |
A logical-device id. The picker is filtered by both constraints. |
capability |
deviceInputName (must reference an earlier device input) |
A capability key, scoped to that device. The form offers the device's canonical keys (a gang as <root>.channels[n].isOn), keeps a saved vendor key selected with a note that it is not one of the device's current capabilities, and the validator accepts both. The kinds it may take are derived from the node that consumes it, see below. |
room |
none | A room id |
number |
min?, max?, step?, unit? |
A number. Bounds and step alignment are enforced on the server, with a floating-point epsilon, and not only in the form. |
time_range |
none | { start, end }. Rejected when start is after end. |
boolean |
none | A boolean |
The allowed kinds of a capability input are not authored. The schema validator derives them from the node that
consumes the input's key in the blueprint's definitionJson and serialises them as capabilityKinds
(RequiredCapabilityKinds). A SetDeviceState node whose CanonicalCapabilityKey is {{input.X}} gives the one
kind of its Kind. A SetProperty, GetProperty or WaitForProperty node gives every kind that maps to its
typeArguments T:
T |
Kinds |
|---|---|
Boolean |
Toggle |
Number |
Number |
String |
Enum, Text, OpenEnum |
Collection<String> |
TokenSet |
For a property node, write the edge's Target mapping as a literal { "deviceId": "{{input.D}}", "key": "{{input.K}}" } together with the node's typeArguments, because a placeholder key alone gives no evidence of T.
The first consuming node wins, and an input that no node consumes stays unconstrained. At install, a bound capability
of any other kind is refused, and the error names the kinds the node requires.
A time window that wraps midnight must be two separate time_range inputs. The helper selector and the visibleIf
conditional-visibility field are reserved. Declaring either is a manifest error, and the entry is rejected at sync.
Worked example: set a numeric property
This blueprint uses the device, capability and number selectors. The user picks a device, one of its numeric
capabilities and a value.
{
"id": "set-level",
"schemaVersion": "1.0",
"name": "Set a level",
"version": "1.0.0",
"description": "Set a numeric capability of a device to a chosen value.",
"tags": [
"general"
],
"author": "<author>",
"definitionJson": "{\"nodes\":[{\"id\":\"start\",\"blockTypeId\":\"WorkflowInput\",\"position\":{\"x\":160,\"y\":160},\"configuration\":{}},{\"id\":\"set-level\",\"blockTypeId\":\"SetProperty\",\"position\":{\"x\":400,\"y\":160},\"configuration\":{},\"typeArguments\":{\"T\":\"Number\"}}],\"edges\":[{\"id\":\"start->set-level\",\"sourceNodeId\":\"start\",\"targetNodeId\":\"set-level\",\"mappings\":{\"Target\":{\"type\":\"literal\",\"literalValue\":{\"deviceId\":\"{{input.device}}\",\"key\":\"{{input.property}}\"}},\"Value\":{\"type\":\"literal\",\"literalValue\":\"{{input.level}}\"}}}]}",
"inputs": [
{
"name": "device",
"label": "Device",
"required": true,
"selector": {
"type": "device",
"deviceType": "Light"
}
},
{
"name": "property",
"label": "Property",
"required": true,
"selector": {
"type": "capability",
"deviceInputName": "device"
}
},
{
"name": "level",
"label": "Level (%)",
"required": false,
"default": 60,
"selector": {
"type": "number",
"min": 0,
"max": 100,
"step": 1,
"unit": "%"
}
}
]
}
Worked example: toggle a fan
This blueprint uses the device selector, constrained by capability and device type, and a boolean input with a
default.
{
"id": "toggle-fan-power",
"schemaVersion": "1.0",
"name": "Toggle fan power",
"version": "1.0.0",
"description": "Switch a fan on or off based on a boolean input.",
"tags": [
"general"
],
"author": "<author>",
"definitionJson": "{\"nodes\":[{\"id\":\"start\",\"blockTypeId\":\"WorkflowInput\",\"position\":{\"x\":160,\"y\":160},\"configuration\":{}},{\"id\":\"toggle\",\"blockTypeId\":\"SetProperty\",\"position\":{\"x\":400,\"y\":160},\"configuration\":{},\"typeArguments\":{\"T\":\"Boolean\"}}],\"edges\":[{\"id\":\"start->toggle\",\"sourceNodeId\":\"start\",\"targetNodeId\":\"toggle\",\"mappings\":{\"Target\":{\"type\":\"literal\",\"literalValue\":{\"deviceId\":\"{{input.device}}\",\"key\":\"fan.isOn\"}},\"Value\":{\"type\":\"literal\",\"literalValue\":\"{{input.on}}\"}}}]}",
"inputs": [
{
"name": "device",
"label": "Fan",
"required": true,
"selector": {
"type": "device",
"capability": "fan.isOn",
"deviceType": "Fan"
}
},
{
"name": "on",
"label": "Power on",
"required": true,
"default": true,
"selector": {
"type": "boolean"
}
}
]
}
Install processing order
The installer makes two passes over the workflow JSON, in this order. First it remaps ids: every id-shaped string
outside the inputs subtree is replaced with a fresh id and the old-to-new map is recorded. Then it resolves
placeholders: every string value that matches a placeholder exactly is replaced with the bound value, written as its
native JSON type (string id, number, object for a time range, boolean).
| Rule | Consequence |
|---|---|
| The two passes never run in the other order, and the installer's own chosen ids are never remapped. | Either mistake destroys the installer's choices. |
| Substitution is one pass. | It does not recurse into a bound value that itself looks like a placeholder. |
| A declared default is not merged into the bindings. | Validation treats "has a default" as satisfied, so an input left unbound ships the literal placeholder text into the generated workflow. |
| The installation row and its workflow commit in one transaction. | A failed installation insert leaves no orphan workflow. |
| Update and repair persist the re-rendered definition. | |
| Repair records the version it rendered. | The cache keeps only the latest content, so a repair always renders it, and the installation moves to that version. |
| The binding-error read-back uses the full entity-level validator. | A schema-only check confirms an id is well-formed but never notices that the device is gone. |
| An install and a marketplace rollback are an import, not an edit. | They create the workflow through the workflow import path, so a *** or an enc: value in a template is left out, a name-rule value is protected for the new workflow (or left out when references are required), and a ref: the installing user may not bind is left out. InstallBlueprintResponse and BlueprintRollbackResponse list each as droppedSecrets, and the install and rollback dialogs show them. An update or repair is an edit by the user who runs it (secrets and audit). |
| Install, update, repair and rollback apply content through one gate. | The gate refuses a tampered entry, missing or unreadable content, a scripting node without the scripting permission, and a community-trust scripting node without approval. See below. |
A scripting node is a CSharpScript node or one whose block type the block registry marks privileged. The gate checks
the definition before and after the input bindings are substituted. The approval is the approveScripts flag that
every one of these actions takes. It applies to that one action, so each update, repair and rollback asks again, and
the dialogs show the install dialog's checkbox. A refusal answers 403 with the same body on every endpoint. A missing
approval also carries errorCode script_approval_required and the scriptNodeIds it needs. The details view scans
the stored template, so a script that only an input value brings in is not flagged there. The dialog learns of it from
the 403, shows the checkbox with the named nodes and sends the action again with the approval.
Installation lifecycle
| Status | Meaning |
|---|---|
Active |
Bindings resolve and the workflow is enabled. |
BindingError |
At least one binding no longer resolves. The workflow is disabled by detaching its triggers, and the page shows a banner with a Repair action. |
Disabled |
Administratively disabled. |
A background service re-validates every active installation daily and flips stale ones to BindingError. An
installation whose blueprint left the catalogue keeps its status, and update and repair answer 404 for it. A manual
endpoint runs the same pass on demand, rate-limited per user.
Update re-renders with the same bindings when the inputs schema is unchanged. A new required input returns 409
listing the missing names, and the dialog reopens pre-filled. A removed input has its stale binding dropped and audited.
Repair does the same. Update and repair switch the workflow back on only when the binding error switched it off. The
re-validation pass records on the installation whether it did, and a workflow the user had switched off before stays
off.
When the re-render would replace a workflow that holds an unpublished draft, update and repair answer 409 with
errorCode draft_discard_required and change nothing. The dialog says the draft would be discarded and resends
with discardDraft=true once the user confirms. Published edits stay in the version history. The cache keeps one
version of a blueprint, so repair renders the latest and moves the installation to it. The dialog says so (from X to Y)
when the two differ.
API
Repository administration requires the blueprints.repositories.manage permission. Everything else requires
blueprints.install.
| Method | Path | Notes |
|---|---|---|
| GET / POST | /api/blueprints/repositories |
|
| PATCH / DELETE | /api/blueprints/repositories/{id} |
Delete also removes the repository's marketplace install history and its snapshots. Installations from it stay, with their workflows, as installations whose blueprint left the catalogue. A resource index removes its repositories the same way when it is deleted or stops listing one. |
| POST | /api/blueprints/repositories/{id}/sync |
Rate-limited per repository |
| GET | /api/blueprints and /api/blueprints/{repoId}/{blueprintId} |
Detail includes the typed inputs schema |
| POST | /api/blueprints/{repoId}/{blueprintId}/install-with-inputs |
Install with typed bindings. Answers 409 with errorCode capability_switched_off when the blueprint holds the C# script block and the deployment turned scripting off (a caller without the scripting permission gets 403 first). A privileged plugin block needs the permission and the approval but not the scripting switch, so the install dialog disables Install for the switch only when the template holds a CSharpScript node. |
| GET | /api/blueprints/updates |
|
| GET | /api/blueprint-installations and /{id} |
|
| POST | /api/blueprint-installations/{id}/update, /repair, /validate-all |
validate-all is rate-limited per user. update and repair answer 409 with errorCode capability_switched_off for a blueprint that holds the C# script block while the deployment turned scripting off, and 409 with errorCode draft_discard_required over an unpublished draft unless discardDraft=true. |
| GET | /api/blueprint-installations/{id}/binding-errors |
Names the offending input and the missing entity |
| DELETE | /api/blueprints/installations/{installationId} |
Uninstall: removes the caller's provenance row and answers 204. Another user's installation answers 404. |
| DELETE | /api/blueprints/installed/{repoId}/{slug} |
Uninstall by blueprint: removes the caller's provenance records that make the generated workflow undeletable and soft-deletes the caller's install rows. Other users' installations of the same blueprint stay. deleteWorkflow=true also deletes the generated workflow. A workflow the workflow delete guards refuse to delete stays and is listed in retainedWorkflowIds, while the installations are still removed. |
The marketplace surface is a browsable, filterable gallery with screenshots, per-blueprint version history and
rollback. It lives under /api/blueprints/marketplace, with list filters for search, category, repository and
recently-updated. The installed list (GET /api/blueprints/installed) shows the caller's own installations, one row
per repository and blueprint, whichever endpoint installed them. The caller's install history adds the install id, the
version and the prior-version count where it has rows. A row whose repository no longer lists its blueprint is marked
leftCatalogue (with repositoryName null once its repository is removed) and can still be uninstalled.
Version history and rollback work on the caller's own install history. Other users' installs of the same blueprint are not shown and cannot be rolled back to. Install history rows are retained per user and blueprint up to a configured count and soft-deleted beyond it. Soft-deleted rows stay visible in version history, are excluded from install counts, and are exported so rollback history survives a restore. A catalogue update or repair that moves an installation to a new version adds a history row for that version, with its content snapshot and input bindings, so the installed list shows the new version and a rollback can return to the one before.
Repository sync
A new installation gets the official blueprint repository and the official resource index once, when start-up creates
the built-in administrator (the index only while Managed:Indexes is absent). A later start never adds them again, so
a deleted official repository or index stays deleted. Add it back on its page. No widget repository is seeded.
Sync loads the repository into a staging table and swaps it in inside one transaction. The swap is decided only by an explicit changed/unchanged flag and never by counting staged rows, because an empty but legitimate upstream and a failed fetch look the same by row count.
An unresolvable upstream revision fails closed and leaves the live catalogue untouched. A parse failure, including a manifest entry that is not valid or a blueprint id listed twice, leaves the catalogue byte-identical and records only the error. A failure in one repository does not stop the others. A manual or index-triggered sync runs the same cycle and also fetches a repository whose upstream revision cannot be resolved.
One sync of a repository runs at a time across the cluster. A manual sync answers 409 when another sync holds the
repository or the replica cannot take the cluster lock (it is not serving, or the lock store did not answer), and the
background cycle skips that repository until its next tick. The sync service runs under distributed leader election,
and disabled repositories are skipped.
| Option | Default | Meaning |
|---|---|---|
Blueprints:SyncIntervalHours |
6 |
Periodic sync |
Blueprints:ValidationHourOfDay |
3 |
Hour of the daily re-validation pass |
Blueprints:MaxManifestSizeBytes |
2097152 |
Largest accepted manifest |
Blueprints:Marketplace:KeepLastVersions |
5 |
Install history rows kept per user and blueprint |
Blueprints:Marketplace:MarketplacePageSize |
30 |
Gallery page size |
Blueprints:Marketplace:RecentUpdatesDays |
30 |
Window of the recently-updated filter |
Trust and audit
A checksum mismatch marks the cache entry tampered. It stays listed for diagnostics and cannot be installed, updated
or repaired. A community-trust blueprint that contains a scripting node needs explicit approval at install, update,
repair and rollback. A trusted one (Verified in the API) does not.
Every add, remove, update and install writes an audit entry, and a sync writes one only when it fails. Entries carry
the blueprint id and version and, for a binding error, the offending input name, never user-supplied free text. The
events are blueprint.installation.created, blueprint.installation.updated, blueprint.installation.repaired,
blueprint.installation.binding-error-detected, blueprint.schema.rejected, blueprint.installed,
blueprint.uninstalled and blueprint.rolled_back. Browsing the marketplace writes no row.
Troubleshooting
| Symptom | Cause and fix |
|---|---|
| An installed blueprint's workflow contains literal placeholder text | An input with a declared default was left unbound. Defaults are never merged into bindings. |
| An installation flips to a binding error | A bound device or room no longer resolves. Repair rebinds and re-renders. |
| An update is refused listing missing inputs | The new version added a required input. The dialog reopens pre-filled. |
| A blueprint cannot be installed and is marked tampered | The fetched file did not match its checksum. |
| Deleting a blueprint-installed workflow returns a conflict | Its installation record still references it. Uninstall first, from the installed list. |
| An install or update fails while fetching the snapshot | Nothing is recorded: a failed snapshot fetch never stores an empty {} snapshot. Retry once the repository is reachable. |