Skip to content
Development preview · 2.0.0-SNAPSHOT

Hot Deployment

If the application already contains the code required by a new flow, you can update the flow without restarting the application. Publish an immutable version, then change an Alias to send requests to it. This guide covers publishing, canary releases, promotion, abort, rollback, and retiring or reactivating an Alias. For applications that manage deployments and execute flows in separate processes, see the integration guide.

The Java examples assume that the application has configured ProcessDeploymentService and its stores and applied the database migrations. flowXml is reviewed process content and metadata contains publication metadata. Use the actual process identifiers for your application. Obtain the actor from the authenticated application context; Deploy validates the actor value for audit but does not authenticate the caller.

JDBC Deploy Stores own their transactions. Configure the underlying connection pool to lend independent idle connections with autoCommit=true; do not supply a transaction-participating DataSource such as Spring’s TransactionAwareDataSourceProxy. If the application’s primary DataSource participates in host transactions, supply the underlying pool as compileFlowDeployDataSource. Both reads and writes reject false or unreadable auto-commit state before SQL. The rejected loan is aborted before its logical handle is closed, preventing pool reset from committing pending work. If abort fails, the handle is quarantined and is not returned to the pool. Cleanup failures are retained with the original failure. Deployment commands are not part of the host’s surrounding business transaction.

Apply migrations before constructing a Deploy Store, including through the Spring starter. The provider checks the five Deploy authority tables resolved by its DataSource: PostgreSQL requires ordinary logged tables, and MySQL requires InnoDB base tables. Missing or unsuitable tables are rejected even when Flyway migration history is valid.

Use case Topology Control plane Runtime worker How routes become available
Durable reads committed routes AUTHORITY true false Saves Alias, rollout, and audit records; does not deliver routes
Core workers read committed routes AUTHORITY false true Polls the assigned Aliases and installs exact versions locally
ProcessEngine Workbench Server or a single JVM EMBEDDED true false Prepares the local route after commit; Outbox supports recovery
Process accepting deployment commands DISTRIBUTED true false Delivers routes through Outbox to the projection store
Process executing flows DISTRIBUTED false true Subscribes to the projection store and installs required runtimes
Combined process DISTRIBUTED true true Both publishes and subscribes through the projection store

The starter defaults compileflow.deploy.enabled to false. When enabling Deploy, enable at least one role: control plane or runtime worker.

compileflow:
deploy:
enabled: true
topology: EMBEDDED
control-plane-enabled: true
runtime-worker-enabled: false
artifact:
mode: SOURCE

The database saves versions, Alias routes, rollout history, and Outbox state. After committing a route change, the command reads the latest Alias and waits for local convergence to the committed revision or a newer one. A live route needs its artifacts installed; a retired route needs its removal applied. Outbox can retry convergence after a failure. Local memory is a cache; after restart or eviction, the database still supplies the committed state.

Use the same Deploy database from the control plane and each execution process. Configure the control process with topology=AUTHORITY, control-plane-enabled=true, and runtime-worker-enabled=false. Choose a PostgreSQL or MySQL Deploy starter on each worker:

compileflow:
deploy:
enabled: true
topology: AUTHORITY
control-plane-enabled: false
runtime-worker-enabled: true
routing:
namespaces: [default]
codes: [order.rule]
aliases: [production]
poll-interval: 5s

The worker reads assigned Aliases in batches of at most 200, resolves immutable artifacts from the same Store, and uses the same local-ready installation pipeline as the other Core modes. No routing Outbox or projection store is required. Startup schedules the first poll with jitter; a route becomes executable only after preparation. A missing initial Alias is not an error. Failed reads retain the last locally ready route; an absent previously observed row is reported rather than treated as deletion. Configure bounded connection acquisition and database I/O timeouts in the DataSource/driver. The poll interval is a delay between completed polls, not a global activation deadline. Check every serving node’s ready revision before treating a rollout as live. With Micrometer, monitor compileflow.deploy.authority.poll.attempts (outcome=success|failure) and compileflow.deploy.authority.poll.last.success (Unix seconds; zero before the first successful pass). A successful polling pass is not runtime readiness; inspect the separate convergence and local-ready metrics.

compileflow:
deploy:
enabled: true
topology: DISTRIBUTED
control-plane-enabled: true
runtime-worker-enabled: false
artifact:
mode: SOURCE

The control process uses committed Outbox records to write routes to a DeploymentProjectionStore. Periodic reconciliation checks those routes against the database. When automatic repair is enabled, it fills missing projections or updates route projections with the same identity and a lower revision. Other conflicts are reported without being overwritten. See version routing for the detailed rules.

Supply one implementation of this Provider Preview interface from compileflow-deploy-spi. It must meet the atomic-update, subscription, recovery, and capacity requirements. Missing required infrastructure causes startup to fail.

compileflow:
deploy:
enabled: true
topology: DISTRIBUTED
control-plane-enabled: false
runtime-worker-enabled: true
runtime:
failure-backoff: 5m
installation-concurrency: 1
artifact:
mode: SOURCE
routing:
namespaces: [default]
codes: [order.rule]
aliases: [production]
operation-timeout: 5s

Subscriptions include every combination of routing.namespaces, routing.codes, and routing.aliases. The resulting set must be non-empty and contain at most 10,000 keys; there is no separate explicit-key setting. SOURCE artifact mode requires read access to the version repository. PROJECTION_STORE mode reads immutable artifacts from the configured projection store.

PublishedProcessVersion published = deploymentService.publish(
new PublishProcessVersionCommand(
ProcessRef.version("default", "order.rule", "2026-07-15-001"),
ProcessDefinition.inline(ProcessModelType.TBBPM, "order.rule", flowXml),
"alice",
metadata));

Publishing checks the version identifier, content size, actor, and any supplied expectedArtifactDigest, then saves the exact source. A published version has no mutable readiness status. Publication does not compile a runtime or change a route. Runtime nodes install and check the selected version separately; they reject execution if it is unavailable.

Use the same Version and exact definition when retrying a publication. If the Version already exists with that definition, the original publication record (including its actor and metadata) is returned; a retry cannot update release notes. Different definition content under the same Version is rejected. The optional digest precondition checks the executable artifact, including exact direct Process call bindings, not the release metadata or just the XML bytes.

Release metadata is an immutable snapshot: up to 64 entries, keys up to 128 Unicode code points, values up to 2,048 Unicode code points, and at most 32 KiB of UTF-8 key and value bytes combined. Null values, malformed Unicode, NUL, and duplicate keys are rejected. Empty values are allowed. Use application-owned keys for custom metadata; compileflow. is reserved (ReleaseMetadataKeys.CHANGELOG is supported).

For the first release, use an all-at-once rollout to make the published version stable. The 0L below requires production to be absent. For an existing Alias, read its current revision before changing it.

ProcessRef.Alias production = ProcessRef.alias("default", "order.rule", "production");
deploymentService.createRollout(CreateRolloutCommand.allAtOnce(production, ProcessRef.version("default", "order.rule", "2026-07-15-001"), 0L)
.idempotencyKey("order-initial-release")
.actor("alice")
.notes("initial route")
.build());
ProcessAliasState route = deploymentService.getAlias(production).orElseThrow();

Check that route.getStableVersion() is the published version and route.getCandidateVersion() is null. Retain route.getAliasRevision() for the next change. This verifies the route saved in the database. Then use the delivery checks below to verify runtime nodes or a new Durable Run and confirm which version actually executes.

The following example assumes production already has a stable version and you have published a different version, 2026-07-16-001, using the publication step above. Read the current Alias revision, then set the new version’s candidate weight to 10%:

long currentAliasRevision = deploymentService.getAlias(
ProcessRef.alias("default", "order.rule", "production"))
.orElseThrow().getAliasRevision();
ProcessRollout rollout = deploymentService.createRollout(CreateRolloutCommand.canary(ProcessRef.alias("default", "order.rule", "production"), ProcessRef.version("default", "order.rule", "2026-07-16-001"), 1_000, currentAliasRevision)
.idempotencyKey("order-v2-release")
.actor("alice")
.notes("ticket-4821")
.build());

Weights use basis points: 1_000 means 10%. This configures percentage bucketing; the observed request share in a finite sample can differ. If a named targeting policy returns STABLE or CANDIDATE, its decision takes precedence. Percentage bucketing applies only when no policy is configured or the policy returns an empty result. See version routing for the selection rules.

For every Core runtime topology, confirm that the target nodes are ready. For Durable, inspect the versions selected by newly started Runs. Then assess the canary against the agreed sample count, observation window, and metrics. Raise the weight to 50% only after those checks pass:

rollout = deploymentService.updateCanaryWeight(new UpdateCanaryWeightCommand(
rollout.getId(), 5_000, rollout.getRolloutRevision(), "alice"));

Check the canary again before promoting it. Each command uses the rollout revision returned by the previous command. If a revision conflict occurs, reread the state and decide whether the next change is still appropriate:

rollout = deploymentService.promoteRollout(new PromoteRolloutCommand(
rollout.getId(), rollout.getRolloutRevision(), "alice"));

After promotion, read the Alias again. Its stable version should be 2026-07-16-001 with no candidate. For Core runtimes, check that the target nodes’ local-ready revisions match it. For Durable, check that newly started Runs select that version.

For an immediate switch, build the command with CreateRolloutCommand.allAtOnce(...). It creates a RolloutStrategy.ALL_AT_ONCE rollout without a canary weight. To stop an active canary, use AbortRolloutCommand; it restores the stable route captured when that canary was created.

To roll back, choose a completed rollout that captured a baseline route and supply the Alias’s expected current revision as expectedAliasRevision to RollbackRolloutCommand. Success creates a new all-at-once rollout to that baseline. The completed source record is unchanged.

Promote or abort an active canary before retirement. To stop new admissions by a stable Alias, use:

ProcessAliasState current = deploymentService.getAlias(production).orElseThrow();
ProcessRollout retired = deploymentService.retireAlias(new RetireAliasCommand(
production, current.getAliasRevision(), "retire-order-prod-001", "operator", "Service retired"));

The Alias row remains with a higher revision and no stable or candidate Version. getAlias returns that state; isRetired() distinguishes it from a live route. An empty lookup means the Alias has never existed. Published definitions remain stored, and already bound executions retain their runtimes. Retirement may release installation demand held by the Alias; a later exact-Version call still requires that version to be installed. Durable rejects new admissions on the retired authority; Core rejects new admissions once the node converges. This is not an instant fleet-wide stop. Restore the captured baseline using rollback or deploy an exact Version using allAtOnce and the retired revision; do not use revision zero.

Each new rollout needs a stable idempotency key and expected Alias revision. Keys are scoped by namespace, process, Alias, and operation kind. Reusing a key in the same scope with different request fields or a different actor causes a conflict. Canary updates also require the current rollout revision and check the Alias precondition. Stale requests fail without overwriting concurrent changes. An exact retry returns the existing rollout’s current state without preparing its historical target artifact again. A new rollout or rollback still requires artifact readiness before commit, and the Store checks replay and revision preconditions inside the same transaction.

DeploymentException.getCommitOutcome() reports whether the authoritative mutation is known not to have committed, is known committed, or cannot be confirmed. COMMITTED does not imply that artifacts have been projected or runtime nodes are ready. NOT_COMMITTED describes this attempt only; an earlier attempt may already have committed. For UNKNOWN, inspect the current published version, Alias and rollout state. Reuse the same key and intent when retrying create, rollback or retirement; for weight, promote and abort commands, read the authoritative rollout and decide whether a new revision-checked change is still needed. Do not treat a transport or storage exception as proof of rollback.

Every topology commits the route, rollout, and audit event in one transaction. Each immutable audit event records the resulting configured target weight in basis points: the requested canary weight, 10000 for full deployment or promotion, and zero for abort or retirement. Historical events do not derive their weight from the current rollout record or from observed traffic. In AUTHORITY, success means that transaction committed. This topology has no routing Outbox, synchronous post-commit local activation, or RoutingOutboxDispatcher. Core workers discover the committed routes by polling their assigned Aliases. Durable admission reads the route when it starts a new Run.

EMBEDDED and DISTRIBUTED also write a routing Outbox record in that transaction, but return success at different points:

  • EMBEDDED returns success once the local Alias state has converged to the committed revision or a newer one. A live route is ready to execute; a retired route rejects new admissions. Another concurrent command may already have superseded the requested revision. Installation can fail after the transaction commits; the command then reports local activation failure. An idempotent retry activates the latest committed revision, and Outbox retains the recovery work.
  • DISTRIBUTED returns success once the control transaction commits and requests immediate Outbox dispatch. Runtime nodes prepare the route asynchronously; inspect their readiness separately.

Both follow these delivery rules:

  • After commit, activation reads the current Alias from the database, not a potentially superseded rollout.
  • RoutingOutboxDispatcher retries persisted route-delivery tasks and is the only control-process writer of Alias route projections to a distributed projection store.
  • A database-unique key coalesces identical Outbox deliveries. Rollout events remain append-only audit records.
  • Alias payloads carry a positive revision. Older revisions are ignored, and conflicting content at the same revision is rejected. Identical repeats reach local convergence: they can retry a failed installation without reinstalling an already-ready version.
  • In DISTRIBUTED, invalid initial projection state prevents subscription startup; an invalid live projection update leaves the last valid local-ready route in use. Embedded convergence reports a failed authoritative read or installation to its caller. Neither behavior makes an unavailable new route executable.
  • Installation verifies the artifact digest; execution fails if the selected version is unavailable.
  • To stop delivery, stop the entire control-plane role. Command acceptance and delivery share one lifecycle.

Default Alias route keys:

compileflow.deployment.alias.{identityDigest}

Default projection-store artifact keys:

compileflow.process.version.{identityDigest}

See the distributed integration guide for key encoding and validation. In PROJECTION_STORE mode, the artifact payload must fit the selected backend’s documented per-item capacity.

The catalog lists processes that have published versions. It does not depend on Workbench drafts or Aliases: deleting a draft leaves the published process discoverable and deployable, and Java API publications appear in the same catalog. Names and model types do not identify catalog entries. Read the model type from the exact version you select.

PublishedProcessPage page = deploymentService.listPublishedProcesses(
new PublishedProcessQuery("default", "order", null, 50));
List<String> codes = page.codes();
// For another page, retain namespace/codePrefix and pass page.nextCursor().

codePrefix matches a case-sensitive literal prefix; _ has no wildcard meaning. Pass null to omit the filter. Request a limit from 1 to 100. A page may be empty; otherwise it contains distinct codes in ASCII order.

Keep the namespace and prefix unchanged when following a cursor. If either changes, start again from the first page. Pagination does not hold a database snapshot, so a concurrently published code that sorts before the cursor appears only on a new traversal. After choosing a code, call listVersions(PublishedVersionQuery) to list its immutable versions.

Publishing a version does not install it. To test or execute an exact version without changing an Alias, inject ProcessVersionRuntime from com.alibaba.compileflow.deploy.api.runtime alongside the ProcessEngine in the same embedded composition or Core runtime worker:

ProcessRef.Version version = ProcessRef.version("default", "order.rule", "2026-07-16-001");
try (VersionRuntimeLease lease = versionRuntime.acquireInstallation(version).join()) {
engine.execute(lease.version(), variables).orElseThrow();
}

Import VersionRuntimeLease from the same API package. Acquisition prepares the exact version and its full call graph; installation failure prevents the execution. lease.version() returns the exact retained version and is not a liveness check. Closing the lease releases this owner’s demand, not the demand of other Aliases or executions. A lease does not keep the engine available after application shutdown. Installation may begin on the calling thread; a timeout on the returned future is not an end-to-end installation or provider I/O deadline. A timed-out or interrupted wait must cancel the original acquisition future or close a lease that wins the cancellation race. Do not discard a pending future or complete it externally. Authority-only Durable admission uses its own definition source and does not require this API.

A development tool can prepare a runtime for an updated root definition and put it in one engine’s bounded cache before executing the same definition:

ProcessDefinition updated =
ProcessDefinition.inline(ProcessModelType.TBBPM, "bpm.order.process", updatedXml);
engine.runtime().warmUp(updated);
engine.execute(updated, variables).orElseThrow();

warmUp fills only this engine’s cache; it creates no process-code or Version binding. Executing a ProcessDefinition still reads that definition’s configured source. To use the warmed runtime, execute the same definition content, or bind that content to an exact ProcessRef.Version with load. Prewarming does not publish a release or change routes on other nodes.

See configuration, distributed integration, and operations.