Hot-deploy integration
Use this guide when the application that manages deployments runs separately from the applications that execute flows. It covers the components and configuration needed to connect them. For publication, canary, promotion, abort, rollback, and Alias retirement commands, see Hot deployment.
For database-only Core workers, use the AUTHORITY setup. The rest of this guide covers DISTRIBUTED projection delivery.
Process roles
Section titled “Process roles”Every distributed process declares its role explicitly. Missing infrastructure is an error; it does not select a fallback mode.
| Role | Control plane | Runtime worker | Required infrastructure |
|---|---|---|---|
| Control plane | true |
false |
DeployStore, DeploymentProjectionStore |
| Runtime worker | false |
true |
DeploymentProjectionStore, subscriptions, artifact resolver |
| Combined | true |
true |
Both sets; configure explicitly |
All roles require compileflow.deploy.enabled=true and topology=DISTRIBUTED.
Artifact modes
Section titled “Artifact modes”| Mode | Resolution | Required access |
|---|---|---|
SOURCE |
Workers read immutable content from the version repository through ProcessArtifactSource. |
Read access to the version store. |
PROJECTION_STORE |
The control plane copies immutable artifacts to DeploymentProjectionStore, where workers read them. |
Projection-store durability, capacity, access control, and atomic create-if-absent. |
Both modes carry and verify content digests. In projection mode, the writer rejects oversized encoded artifacts before attempting a remote write; readers must also validate received payloads. If an existing artifact conflicts with the new content or is corrupt, fail without overwriting it.
Control plane
Section titled “Control plane”The control process accepts publication and rollout commands through ProcessDeploymentService.
Its DeployStore saves immutable versions, Alias routes, rollout history, and Outbox state.
A route change and its Outbox record commit in the same Provider transaction.
RoutingOutboxDispatcher copies committed routes to DeploymentProjectionStore for runtime nodes to consume.
Failed delivery can be retried. Inspect counts of pending and processing records, expired claims, and dead letters to assess delivery.
Supply one complete database Provider and a projection store that meets the contract below.
CompileFlow does not bundle a remote projection-store implementation. The projection-store SPI is Provider Preview and must match the CompileFlow version; independently verify your remote implementation before production use.
PostgreSQL and MySQL 8.4 are supported Deploy databases. Use exactly one matching Provider starter.
H2 is test-only. The neutral starter requires a complete DeployStore supplied by the application and provides no driver, Store, or migration.
Apply the packaged migrations before accepting commands or starting background delivery.
Provider starters default to compileflow.deploy.database.migrate=false: startup validates migration history and
checksums and rejects pending or unknown migrations. This is not a full validation of the physical schema; changes made outside the migration process may go undetected.
Setting it to true applies migrations with the configured DataSource account.
On MySQL with binary logging, creating the packaged triggers requires the relevant administrator privileges;
schema-scoped DDL grants alone may not be enough. Run migrations separately, then run the application with a DML-only
account and migration disabled. Do not bypass this requirement by globally enabling log_bin_trust_function_creators.
compileflow: deploy: enabled: true topology: DISTRIBUTED control-plane-enabled: true runtime-worker-enabled: falseRuntime worker
Section titled “Runtime worker”Each execution node has one Spring-managed DeploymentRuntime. Spring starts and stops its subscriptions,
reconciliation, and runtime installation. Let Spring construct and start these components.
compileflow: deploy: enabled: true topology: DISTRIBUTED control-plane-enabled: false runtime-worker-enabled: true artifact: mode: SOURCE routing: namespaces: [default] codes: [order.rule] aliases: [production]Subscriptions specify which routes a node serves and therefore which versions it must keep installed. When a node receives an updated Alias route, it installs the specified versions and verifies their digests before making the new route locally ready. While this is in progress, it continues executing the last valid local-ready revision. If it has no valid revision, requests fail. Retirement delivers a higher-revision tombstone without version targets. Once applied locally, new Alias calls fail, and delayed older updates cannot reactivate the route. Do not simulate retirement by deleting a projection key.
Projection contract
Section titled “Projection contract”Only committed state is published to the projection store. The store must provide server-side atomic compare-and-set, including create-if-absent. Reading and then writing from the client is not atomic and does not satisfy this requirement. The store must be thread-safe, compare exact content, honor operation deadlines, and preserve interruption. After a subscription is established, successful updates must eventually be reflected in callbacks; intermediate updates may be coalesced and callbacks may be delayed or duplicated. Isolate callback failures from the listener and other subscriptions. The caller closes its subscriptions; the application owns the store lifecycle.
Projection keys use the prefixes below. Their digests identify an Alias or exact Version. They are separate from the per-request routing key used to choose canary traffic:
compileflow.deployment.alias.{identityDigest}compileflow.process.version.{identityDigest}To compute identityDigest, encode the identity fields in order as length-prefixed UTF-8, calculate SHA-256, and use
lowercase hexadecimal. Alias state uses (namespace, code, alias); artifacts use (namespace, code, version).
Each payload includes the full identity, which consumers verify against the key. Alias payloads also have a monotonically
increasing revision. Consumers ignore older revisions. Identical repeats reach local convergence so a failed installation can retry without creating a new authoritative revision; already-ready versions are not reinstalled. Different content at the same revision is a conflict. Keep the last valid state and investigate the authoritative record.
Startup and recovery
Section titled “Startup and recovery”- A control plane without a projection store fails startup.
- A runtime without subscriptions, a projection store, or its selected artifact source fails startup.
- Installation never falls back to unversioned source or process-local desired state.
- Reconciliation checks repository-to-projection differences. In repair mode it enqueues a route correction for an absent projection or one with the same identity and a lower revision. It creates missing immutable artifact projections only in
PROJECTION_STOREmode, traversing the active Alias targets and their bound dependencies. Conflicting content is not overwritten. A queued correction is not proof of delivery. The Alias scan is paginated, and each active Alias has a bounded artifact graph walk. Exceeding the traversal limit marks reconciliation incomplete; it does not invalidate the published process. The reported mismatch details can be truncated independently of the counts. A complete scan is not proof that every mismatch is repaired; see configuration and version routing. - Operators monitor Outbox backlog, runtime installation failures, and the time until a new route becomes ready on each node.
After connecting the components, verify the complete path with a controlled release:
- Publish a test version and create an Alias. Read
ProcessDeploymentService.getAlias(...)to confirm the expected version and revision were saved. - Inspect node-local runtime diagnostics on every node that must serve the Alias. For a runtime implementation’s internal inspection,
DeploymentRuntime.snapshot()provides these diagnostics; see the operations playbook for the supported diagnostic entry points. Confirm that the required version is installed and the local-ready route has the expected revision. - Execute test input through the Alias and check the effective version and route revision in protected execution logs. A successful control command establishes only the first check.
If a check fails, use the operations playbook to investigate that component. After the repair, repeat the failed checks until all three produce the expected result.