Durable Process
An approval may arrive tomorrow, a remote job may take hours, and the application may restart in the meantime. Use CompileFlow Durable when the same process must continue through these interruptions. It saves the definition, progress, and pending work in a database. Workers continue from the last committed state.
One execution is a Run. The application uses DurableProcessEngine to create and query Runs; workers execute them. They share one DurableStore. The project provides PostgreSQL and MySQL implementations. Workers can run in the application process or on other nodes that use the same Store.
For a complete first exercise, run the Wait and recovery example tests. The example documents the JDK and PostgreSQL prerequisites, the test command, and the expected result. Its tests create Runs, exercise Timer, Effect, and Wait behavior, rebuild the application context, and recover when a publication operation commits but its response is lost. Starting the sample application by itself only starts the engine; it does not create a Run.
The integration examples below assume a configured engine named durable, at least one running worker, and process source in definitionText. Use the sections that match your task:
- Create an engine and start a definition.
- Complete an external wait or call an external service.
- Query a result, pause or stop a Run, or deliver events.
- Load published versions and start by Version or Alias.
- Store application values or commit a Run with business records on PostgreSQL.
- Read the operational rules and publication contract when preparing an integration for production.
You can start directly from a definition. Ordinary synchronous calls continue to use ProcessEngine.execute(...).
Add the starter
Section titled “Add the starter”Import compileflow-bom in your application as shown in the BOM guide, then add the process format and Durable starter:
<dependency> <groupId>com.alibaba.compileflow</groupId> <artifactId>compileflow-tbbpm</artifactId></dependency><dependency> <groupId>com.alibaba.compileflow</groupId> <artifactId>compileflow-durable-spring-boot-starter-postgresql</artifactId></dependency>The database-specific Durable starter shown above supplies a Store implementation. Add the format module separately: use compileflow-tbbpm as shown, replace it with compileflow-bpmn for BPMN, or add both when needed.
When building from source, run this command from the repository root to install the selected format module, starter, and their dependencies:
./mvnw install -pl :compileflow-bom,:compileflow-tbbpm,:compileflow-durable-spring-boot-starter-postgresql -am -DskipTestsIn the application’s application.yml, enable Durable and database migrations for development:
compileflow: durable: enabled: true database: migrate: trueFor MySQL 8.4, use compileflow-durable-spring-boot-starter-mysql with the same database configuration keys. Do not place both
Provider starters on the classpath unless compileflow.durable.database.provider explicitly selects one.
Configure a DataSource for the selected provider. If the application also has a business database, name the Durable bean compileFlowDurableDataSource; otherwise the unique or primary DataSource is used.
Every ordinary Store operation, including queries, requires an independently borrowed, idle connection with auto-commit enabled.
Configure the real underlying pool accordingly; do not supply a transaction-participating DataSource such as Spring’s TransactionAwareDataSourceProxy.
Pools configured to lend connections with auto-commit disabled are unsupported.
Before issuing provider SQL, the Store checks getAutoCommit(). A false value does not prove that a transaction is active,
but it does not satisfy the Store’s connection contract. If the value is false or the inspection fails, the Store rejects
the operation and aborts the acquired connection before closing its logical handle. It closes the handle only after abort
returns successfully; if abort fails, the handle is quarantined instead of being returned to the pool. This prevents a pool
reset from committing unresolved work. On this rejection path, the Store does not issue commit, rollback, or session-reset
commands, and does not unwrap the physical connection. Cleanup failures remain available in the operation’s failure diagnostics.
Correct the pool configuration before retrying.
Ordinary Store calls do not join a business transaction. For PostgreSQL business writes and Run admission in one database
transaction, use the explicit PostgresDurableAdmission.stage(...) or inTransaction(...) contract described below.
For MySQL, retain Connector/J’s default matched-row update counts: leave useAffectedRows unset or set it to false.
The Store requires a renewal matching the current lease to report success even when its stored values do not change.
useAffectedRows=true reports changed rows and is not supported: a valid no-op renewal can otherwise be reported as lost authority.
See the Connector/J connection properties for this option’s JDBC compatibility.
Create and close an engine
Section titled “Create and close an engine”Spring uses the same factory and manages worker startup and shutdown. Adding only a Durable starter does not create a ProcessEngine.
In a plain Java application, call DurableProcessEngineFactory.create(config) to create the engine. Application API calls are then available. The startWorkers() method starts its configured workers.
For a bean Action, use create(config, resolver). The ProcessComponentResolver returns an existing object matching the requested name and type; the application owns the resolver and returned objects. Spring supplies its own business-bean resolver. Script executors, Wait-description providers, Outbox sinks, and other extensions are still discovered and created by the extension framework.
For PostgreSQL, the minimal plain Java composition is:
var store = new PostgresDurableStore(dataSource);var config = DurableProcessEngineConfig.builder(store).build();var durable = DurableProcessEngineFactory.create(config);durable.startWorkers();For MySQL, use new MySqlDurableStore(dataSource) instead. Use the selected Provider and engine from the same release.
The application manages dataSource and must complete the Provider’s schema migrations before using the Store.
These constructors are documented composition entry points; other Provider
implementation types and methods remain internal unless separately documented.
startWorkers() is idempotent for running workers. stopWorkers() stops taking new work and waits for workers within the shutdown budget. stopWorkersAsync() stops acquisition without blocking and completes only when those workers have actually exited. Neither proves remote operations have stopped. close() rejects new operations and drains accepted application operations before starting the worker shutdown budget. If workers outlive that budget, close reports failure and keeps resources available until the workers exit; a repeated close waits for cleanup. Call close from the application lifecycle owner, outside engine operations and callbacks. The application still owns the Store and other capabilities it supplied and must bound their blocking calls.
durable.operator() provides diagnostics and audited commands; durable.tooling() prepares definitions. Both objects share the engine’s lifetime and need no separate close. getRunDefinition(runId) returns Optional<ProcessRunDefinition> for the saved root definition and its start source if the Run is visible. The application must authorize access to that source separately.
Start an explicit definition
Section titled “Start an explicit definition”ProcessRunId runId = ProcessRunId.random();// Save runId with the business request before starting, so a lost response can be retried.ProcessRun run = durable.start( runId, ProcessDefinition.inline(ProcessModelType.TBBPM, "approval", definitionText), Map.of("orderId", "o-42"));start returns after saving the new Run; it does not wait for the process to finish. Workers advance the process separately. Use getRun to check its state and getRunResult to read its final result.
An explicit definition must include its model type. Durable uses its own DurableProcessEngineConfig and the Core definition loader to save the original bytes and declared format. It has no engine-level format default.
Input variables
Section titled “Input variables”The input map can contain any subset of the definition’s param variables. A return, inner, or undeclared key fails before the Run commits. A null input map is treated as an empty map. Missing parameters use definition defaults on the first Turn; an explicitly null parameter value stays null. The Kernel saves complete state in later checkpoints. Callers cannot inject replacement state.
Start retries and business request deduplication
Section titled “Start retries and business request deduplication”Allocate and save a ProcessRunId before calling start, so you can query it if the response is lost.
While the original creation record is retained, retrying DurableProcessEngine.start(...) with the same source selector, effective routing options, and typed input returns the existing Run’s current state. The engine checks the request before resolving an Alias or reloading the source, and checks the retry’s input against the first saved definition. Input object field order does not matter; list order, decimal scale, and declared Java types do. The original definition, dependencies, and stop policy remain in effect.
A different request, or a Run without this Start retry record, returns RUN_ALREADY_EXISTS. Runs created through the PostgreSQL transaction integration have no ordinary Start retry record. The application uses its own persisted admission receipt to decide how to retry.
After an ambiguous response, finding the Run with getRun(runId) confirms that it was created. An empty result does not prove that creation failed: Start may still be committing, or retention may already have hidden or deleted the Run. Do not create a replacement Run for the same business request on that basis.
A Run ID always belongs to one execution, including after that execution is deleted. Retention does not keep a permanent record of deleted IDs.
If an HTTP request, message, or business operation must start only once, the application must decide which requests count as the same request and persist the mapping from its business ID to the Run ID. The engine does not generate a business idempotency key or keep a receipt for each application request.
Queries
Section titled “Queries”getRun(runId) and listRuns(query) return Run information without business payloads. Use getRunResult(runId) for the result. Its ProcessRunResult distinguishes NotFound, NotCompleted, Succeeded, Failed, and Cancelled. NotFound means invisible at the time of the query; it does not show that Start never committed. A terminal Run may still have unresolved external Effects under a bounded-drain stop policy. The returned Succeeded output map is unmodifiable, and its decoded values are detached from stored state; changing them does not change the Run.
Java query and page APIs use typed keyset cursors: ProcessRunCursor, ProcessTimelineCursor, and OutboxEventCursor. Request 1–200 items per page. For Run and Outbox queries, a process code filter requires a namespace; a null or empty status set means no status filter. Use the returned cursor for the next page with the same filters, and stop when nextCursor is null. A web adapter can encode and sign these cursors as opaque page tokens.
Timeline pagination freezes the retained Journal’s upper sequence bound on the first page. Events are returned in ascending sequence order; each public event contains only its sequence, event code, and observation time. Continue with the same Run ID and cursor; start a new traversal to see later events. Run and Outbox list cursors bind the filters, not the page size, and do not establish a frozen Journal snapshot.
Run diagnostic timestamps reflect the database wall clock, which can move backwards. Do not use them alone to infer execution order.
Application classes needed to read a result
Section titled “Application classes needed to read a result”Reading a committed result needs only the declared return types. It does not load input-only classes, Actions, script executors, or a compiled executable. The Store reads output and definition in one snapshot, so later retention cannot invalidate the result already read. Result decoders and full value schemas each have a bounded node-local cache, using the same configured entry limit as executable runtimes.
Wait and complete
Section titled “Wait and complete”To deliver Wait notifications, at least one running worker sharing the Store needs a declared DurableOutboxSink implementation.
Declare a public implementation with a public no-argument constructor using @ExtensionRealization, and list its class name in
META-INF/services/com.alibaba.compileflow.common.extension.Extension.
For each event, the engine chooses the first supporting sink in descending priority order, breaking ties by ascending binary class name. A node with no declared sink creates no Outbox publisher.
The sink reads the token from the WAIT_COMMITTED event’s waitToken payload field and delivers it securely and durably
to an authorized recipient. See the example’s declaration and token handling;
its in-memory sink is a test fixture. Production integrations must follow the Outbox delivery contract.
For example, an approval process declares the business fields that its Wait accepts:
<var name="approved" dataType="java.lang.Boolean" inOutType="inner"/><waitTask id="approval"> <output source="approved" target="approved"/> <transition to="afterApproval"/></waitTask>When the process reaches this Wait, it saves a waiting record. A WAIT_COMMITTED event gives the completion token to an authorized caller. Once the decision is available, the application authenticates the reviewer, authorizes the expected Run, and submits the result with that Run ID and token:
durable.completeWait( runId, new WaitToken(rawToken), Map.of("approved", true));completeWait returns after saving the result. A worker then continues the process; the completion call does not synchronously run the remaining steps.
Token permissions and application authorization
Section titled “Token permissions and application authorization”The token has 256 bits. The Wait record stores only its SHA-256 digest, while the active Outbox record temporarily holds the raw token until delivery succeeds or the Wait is completed, times out, or is revoked. Protect the Outbox as credential storage, and never log the raw token.
If the application has authorized access to a particular Run, call durable.completeWait(expectedRunId, token, result). The engine rejects a token for another Run before loading its serializer, and the Store checks the Run and token together again in the completion transaction. The application remains responsible for authorization. Integration code need not hash the token or query an internal target. The token-only overload follows the same replay, timeout, cancellation, and typed-result rules.
The globally unique token grants permission to complete one Wait. The engine uses it to find the Run, then completes the Wait in a transaction that locks the Run first. The saved Wait already identifies the element or event to resume; a completion request cannot change those positions.
A controlled RPC or message queue can carry the token unchanged. If an external service returns only its own job ID, the integration can securely store an externalJobId -> WaitToken mapping. Business systems keep their own order, payment, or inventory IDs. Durable requires no separate token table and does not provide message subscriptions, buffering, TTL, or early-arrival correlation. Keep raw tokens out of metric labels, browser URLs, third-party metadata, and Workbench views.
Repeated completion
Section titled “Repeated completion”A completion payload must supply exactly the Wait’s declared output source keys. Missing or undeclared keys fail before commit;
a Wait without outputs accepts only {}. Each source maps to its declared process-variable target, whose ordinary type rules
apply, including explicit null. Wait outputs do not declare a separate type. Sources and targets must each be unique within
the Wait, and business outputs cannot target that Wait’s outcomeVariable or resolvedAtVariable.
Durable allows at most 1,024 outputs per Wait and 256 Unicode code points per output source, matching the completion API limits.
While the Run and completed Wait record remain queryable, resubmitting the same token and canonical typed result makes no further write; a different result conflicts. Object field order is insignificant, but list order, decimal scale, and explicit null remain significant. Completion values do not undergo implicit numeric widening or narrowing. After the process consumes the Wait result, retention cleanup can delete its completion record even while the Run is still active. The token then becomes invalid. Cancelled Waits cannot be completed, and a token cannot complete a different Wait.
Scheduling limits and invalid values
Section titled “Scheduling limits and invalid values”Wait and Timer scheduling uses the inclusive UTC range 1000-01-01T00:00:00.000Z through
9999-12-31T23:59:59.499Z in both PostgreSQL and MySQL. Wait deadlines require whole milliseconds; Timer wake times may
include nanoseconds and round upward to a stored millisecond threshold within the same range. Relative durations must be
non-negative, use whole milliseconds, and be no greater than P36500D; the resulting database-time deadline must also fit.
Ordinary business Instant values are unaffected until used as scheduling values.
An out-of-range absolute literal fails preparation with DURABLE_TIME_INVALID. Invalid evaluated scheduling values or
out-of-range relative deadlines request normal Run failure with INVALID_TIME_VALUE, preserving already-consumed boundary
results and applying the configured stop policy. They do not become endless Store retries. The same rules apply to TBBPM and
BPMN; see the Wait and Timer contracts.
Completion and timeout outcomes
Section titled “Completion and timeout outcomes”When an overdue approval must escalate or a missing payment callback must be reconciled, declare a visible root process variable
of type com.alibaba.compileflow.durable.api.wait.WaitOutcome and select it with the optional outcomeVariable.
Ordinary variable rules apply: param, inner, return, and declared Action outputs are allowed. Defaults use the ordinary
type decoder: an omitted or empty default initializes this enum to null; non-empty enum defaults are not currently supported.
Like other enum variables, JSON values use constant names; numeric ordinals are rejected during decoding.
Use typed inputs or Action outputs for a non-null initial value.
For each resolved occurrence, the Kernel overwrites the variable with COMPLETED (external completion accepted) or TIMED_OUT
(waiting deadline reached) alongside accepted business values, so a later exclusive gateway or Action can decide what follows.
Business outputs cannot also target this Wait’s native result or time variable. A result variable bound to another Wait follows ordinary variable rules. Concurrent writes use the ordinary process-variable conflict rules.
The variable is a result value, not the current Wait’s status: null, defaults, inputs, and previous values do not identify a
pending or resolved Wait. Later Actions may overwrite it. It carries no original-Wait identity, timing, provenance, or business
authorization. Cancellation, Run failure, and normal Timer wake-up are separate; an unbounded Wait produces only COMPLETED.
COMPLETED means that a reply was accepted, not that approval or payment succeeded; the payload carries that business decision.
Timeout provides no business values, so a loop may retain previous values. A completed Wait writes every declared output;
unmapped variables retain their previous values. Check the outcome before consuming business outputs from a repeated Wait.
Omit outcomeVariable when both outcomes lead to the same work, such as waiting up to 30 seconds for a notification and then
reloading authoritative business state. Completion and timeout both take the ordinary successor; timeout does not automatically
fail the Run. See the Wait outcome contract for examples and constraints.
Business correlation and time
Section titled “Business correlation and time”CF retains exact Wait identities, original deadlines, and terminal decisions internally. Recovery consumes the committed
result without restarting the deadline or deciding the outcome again. A flow may read WaitOutcome; business request
identities and responses travel through ordinary explicit variables, without predecessor or variable provenance propagation.
Applications that distinguish repeated rounds must freeze the request identity before waiting, including timeout-without-payload
and delayed-notification handling.
Optional resolvedAtVariable names a visible ordinary java.time.Instant variable. On resume, the Worker writes the original
database time sample used by the Store to resolve that Wait, together with its outcome and accepted business outputs in the
same state update. Recovery reuses the committed value. It is not the physical transaction-end time, the business decision
time, or the application’s receipt or adoption time. On timeout it records the actual resolution time, which may be later
than the deadline. Omit this projection when the flow does not need native time.
Native time retains the Store’s precision. Durable control and scheduling expressions use a restricted Java expression contract rather than arbitrary method calls. To calculate a later Wait deadline, use a replayable Action to apply an explicit
whole-millisecond precision policy and write an ordinary Instant variable, then refer to that variable with
deadlineAtExpression="nextDeadline". For example, the Action can calculate
resolvedAt.truncatedTo(java.time.temporal.ChronoUnit.MILLIS).plusSeconds(1800), choosing a cutoff less than one millisecond
earlier than the exact 30-minute interval. These method calls are not allowed inside the scheduling expression itself.
Timer wake times follow their separate upward-rounding rule.
To determine whether the original Wait accepted a completion in time, consume its committed outcome. New business operations still follow the application’s authorization, budget, and deadline rules. Native projections remain ordinary variable values; they do not propagate original-Wait identity or provenance, prevent later Action writes, or grant business authority.
Effect actions
Section titled “Effect actions”A worker can stop after a payment succeeds but before it saves the result. The next worker cannot decide whether to charge again merely from the exception.
Declare operations that read or change external systems with execution="effect". Durable saves the request before dispatching it. If the outcome is uncertain, it queries, retries, or waits for an operator according to the configured policy. With no recovery policy, it waits for operator resolution rather than retrying automatically.
Prefer an existing stable business request ID. Assume the payment service identifies a charge by requestId, guarantees that repeated submissions of that ID do not charge again, and can look up the actual outcome by that ID. Here, charge attempts the payment and queryCharge checks the same payment. Both methods need only the business request ID.
Register a payment Spring bean compatible with the declared com.example.PaymentService type. Durable resolves it by
the declared name and type from the engine’s ApplicationContext, with no additional registration. A missing bean or
incompatible type fails the call. The publication approval example
shows another Spring Bean Effect, with a publication request that can be retried safely if the reply is lost.
<action type="bean" execution="effect" bean="payment" class="com.example.PaymentService" method="charge"> <input source="requestId" target="requestId" dataType="java.lang.String"/> <effectPolicy recovery="reconcile" maxAttempts="3" maxReconcileAttempts="10" recoveryDelay="PT5S" maxRecoveryDuration="PT30M"> <reconcileAction type="bean" bean="payment" class="com.example.PaymentService" method="queryCharge"> <input source="requestId" target="requestId" dataType="java.lang.String"/> </reconcileAction> </effectPolicy></action>A reconcile Action’s source reads the saved parameter of the original action, not the current process state. Here, source="requestId" refers to the field passed to charge. Reconciliation can also use the engine-generated request ID described below, but it cannot use process expressions, literals, outputs, an execution mode, or an invocation policy. A confirmed result is written through the original Action’s output mapping, if one is declared. This example discards the return value.
A reconcile Action must return EffectReconcileOutcome; an integration adapter can translate the business query result using confirmed(value), notExecuted(), or unknown().
Reconciliation checks what happened to the original business operation. It must not start that operation again. Another attempt needs a separate DISPATCH authorization.
When there is no business request ID
Section titled “When there is no business request ID”If an existing interface requires a request ID and the process has no suitable business ID, use the ID generated by the engine for this external operation.
Replace each of the two requestId input mappings in the example above with:
<input metadata="effectId" target="requestId" dataType="java.lang.String"/>Receiving this ID as a String requires no CF SDK dependency and does not change the business dispatch method signature.
In Workbench, select Engine-generated request ID as the value source.
The protocol calls this ID the Effect ID. It remains the same across initial dispatch, retries, and reconciliation of one operation; independent operations in loops, parallel branches, or other Runs receive different IDs.
It does not replace a cross-Run business deduplication key. The downstream service must support safe retries or result lookup; passing the ID alone does not guarantee idempotency.
Use metadata="effectId" in the reconcile Action if it needs the ID; an injected parameter is not a saved request field.
If a first-party integration adapter already handles request ID propagation, the process author does not need to map it. The adapter may use the read-only Effect invocation observation. That same-version bridge is not a required dependency of ordinary business methods.
Recovery policy and uncertain outcomes
Section titled “Recovery policy and uncertain outcomes”Keep the default manual policy when reliable automatic retry or reconciliation is unavailable. Choose retry only for operations that can safely be repeated.
Choose reconcile when the integration can reliably distinguish a confirmed result, confirmed nonexecution, and an unknown outcome. A temporarily missing record does not prove nonexecution.
If different occurrences of the same Action need different recovery limits, select a recovery plan through a visible process variable. For example, declare the following TBBPM variable and replace the static policy on an idempotent Effect with the policy shown below:
<var name="recoveryPlan" dataType="com.alibaba.compileflow.durable.api.effect.EffectRecoveryPlan" inOutType="param"/><!-- Inside the Effect's action element: --><effectPolicy recoveryPlanVariable="recoveryPlan"/>Supply a typed EffectRecoveryPlan.retry(3, Duration.ofSeconds(5), Duration.ofMinutes(30)) as that input, or compute the plan in a replayable Action before entering the Effect. The factory is in com.alibaba.compileflow.durable.api.effect; import java.time.Duration for its duration arguments. The machine reads and validates the current value before creating the Effect, and the Store freezes the plan with that occurrence. A later variable change does not alter its recovery policy. A missing or null plan is not a fallback to manual recovery. Do not combine the variable with static recovery attributes; if the plan can select RECONCILE, keep a static reconcileAction. See the Effect policy reference for limits.
Preparing process structure does not resolve or construct application components. Resolving a host component, constructing a Java object, evaluating a script, or invoking a method may already send a request to an external system. An exception, timeout, or lost worker after that point leaves the Effect UNKNOWN if its external outcome cannot be established. For a clear business rejection, return a value of the declared type and handle it in a conditional branch of the process.
unknownSince records when the current uncertain outcome began. Claiming recovery work, queuing a RETRY, dispatching again, or releasing a claim because a required implementation is not ready does not reset it. A confirmed result or operator decision ends that period. maxRecoveryDuration is measured from this time and checked before another automatic dispatch or recovery step. After preparation and any row-lock wait, the Store checks its own clock again before granting the invocation permit. An expired, unbegun attempt stays UNKNOWN and requires review; the original uncertain operation is not declared unexecuted. Crossing this recovery deadline alone does not revoke an already granted permit or the eligibility of its later result evidence; the original fencing rules still apply. This limit does not guarantee that physical I/O starts or all recovery finishes before a wall-clock deadline.
When reconciliation returns ConfirmedNotExecuted, the Store saves that finding before deciding the next step. An existing cancellation can finish. If dispatch attempts remain, the Effect can be queued again; otherwise, it stays PENDING for operator review, with confirmation that the operation did not execute. unknownSince can then be cleared without waiting for another dispatch.
ActiveEffect.unknownSince records unresolved external work separately from queue state. Both PENDING and UNKNOWN can have reviewRequiredAt; either is blocked from automatic dispatch while review is required.
Returned results
Section titled “Returned results”If the business method returns normally but declared-result conversion, output mapping or encoding fails, the Worker requests operator review under its current lease. The review gate takes effect only when that transition commits. If the lease is lost first, an unresolved outcome is recovered as UNKNOWN under the saved recovery policy. RETRY therefore still requires business idempotency.
Java class/bean Effects require an observable, typed invocation boundary. Preparation rejects bindings that cannot generate this boundary because their signature types are inaccessible; expose a publicly expressible signature or use a public application facade. Single-attempt ordinary calls and replayable Actions may still use directly callable Java signatures.
Once the result has been encoded, completion retries reuse those bytes instead of calling the application again. An unknown Store response or a lost lease cannot establish that the external operation was cancelled or executed only once.
Dispatch and recovery capacity
Section titled “Dispatch and recovery capacity”Dispatch and UNKNOWN recovery each have reserved capacity and cannot borrow from one another. MANUAL, RETRY, and RECONCILE decisions all use the recovery reservation; only RECONCILE calls a reconcile Action.
A blocked reconcile call still occupies a recovery slot, so application I/O needs timeouts. For a long remote job, first use an Effect to save the submission receipt, then wait through a separate Wait/callback or a query Effect with a Timer. A successful Effect does not keep polling its reconcile Action. A submission receipt means the job was accepted, not that it finished.
Operator resolution
Section titled “Operator resolution”The decisions available to an operator depend on the Effect’s state:
| Effect state | Allowed decisions |
|---|---|
UNKNOWN, before or after automatic review is requested |
Confirm success, confirm that the operation did not execute and retry, or request Run failure. |
Known-not-executed PENDING Effect waiting for review |
Retry or request Run failure; success cannot be confirmed. |
Each command must use the reviewRevision recorded for the investigation. If it has changed, investigate again before deciding.
reviewRevision prevents an old investigation from deciding a later business attempt. Every new DISPATCH lease and relevant review-state transition advances it in the same transaction. RECONCILE only investigates an existing operation and does not advance it. Releasing work because a capability is unavailable can refund an attempt, but does not roll the revision back. Two dispatches can both end UNKNOWN and still require separate decisions.
The decision and its reviewed revision are saved together. Repeating the same decision at that revision makes no new write only if the canonical typed result also matches. A different decision or result is rejected.
FAIL_RUN settles the selected Effect and requests Run failure. If cancellation committed first, the Run remains cancelled and the Effect decision is recorded once. Other RUNNING or UNKNOWN Effects still need their own outcomes to be established.
The audit record retains the target type and ID, reviewed revision, decision, actor, reason, and optional context. It still identifies what was decided after occurrence cleanup, without retaining the raw result payload.
Pause, Resume, Cancel, and Outbox
Section titled “Pause, Resume, Cancel, and Outbox”Pause and Resume require expectedControlRevision, so a stale request cannot overwrite another operator’s change. Pause blocks new Turns that continue normal process execution and new Effect dispatches. PAUSE_REQUESTED means a Worker still holds previously granted Turn or Effect execution authority; PAUSED means none remains outstanding at that moment.
Recovery and termination work can still be claimed while paused. An external operation may also have an unknown outcome after the Run reaches PAUSED; pausing does not establish that outcome. Resume uses the latest revision and applies only to a non-terminal Run.
Call cancel(runId) to request cancellation. Cancellation and deterministic process failure share one stop record; the first request committed under the Run lock wins. The Kernel then revokes active Waits and Timers, PENDING Effects with no unresolved dispatch, and their pending Wait-token deliveries.
PENDING means queued; it does not guarantee that an external call has never been sent. Operator review can also prevent a queued Effect from being claimed. A queued RETRY with an uncertain outcome becomes UNKNOWN and requires review (TERMINATION_EFFECT_OUTCOME_UNKNOWN), with a timeline entry and Outbox notification. It is not dispatched again after the stop request commits.
Once the stop request commits, the Store grants no new ordinary Turn or Effect dispatch authority. An existing Turn or application callback may continue running; the Store gives the stop request priority when a result is committed.
Dispatch authority is granted when a DISPATCH task is claimed. Under the default WAIT_CONFIRMED policy, an Effect claimed before cancellation may therefore enter its application callback after the cancellation request commits, even if that callback had not yet started. Invocation still requires a valid original lease and any applicable recovery deadline. A cancellation receipt confirms acceptance of the stop request; it does not prove that previously granted execution authority or a remote operation has been revoked.
The default WAIT_CONFIRMED policy waits until the outcomes of RUNNING and UNKNOWN Effects are confirmed. A call that already began can return and save its result; reconciliation or operator resolution can establish an unknown outcome. After the accepted Turn acknowledges the stop or loses its lease, the Run stays WAITING until those outcomes are settled, then reaches the requested CANCELLED or FAILED state.
Stop policies
Section titled “Stop policies”The default ProcessStopPolicy.waitConfirmed() waits for those outcomes. An application may instead configure DurableProcessEngineConfig.builder(store).stopPolicy(ProcessStopPolicy.boundedDrain(Duration.ofSeconds(30), "application-policy-v1")) to allow the Run to reach CANCELLED or FAILED after its original deadline without waiting for every external outcome. This duration is chosen by the application and is separate from the worker shutdown budget.
The Run saves the policy and authorization reference at creation. Its first stop request fixes the request identity, origin, reason, database time, and absolute deadline. Repeated cancellation, recovery, or a later failure cannot replace it or extend the deadline. The application authorizes the operation; authorizationRef is only an audit label.
Accepting a bounded stop immediately removes the old Turn’s permission to write to the Store and retains its last committed continuation. That Turn cannot postpone the stop check by renewing its lease or trying to commit a proposed continuation. Repeated stop requests return the original stop request without revoking a validation Turn already claimed.
Schedule and validate a stop
Section titled “Schedule and validate a stop”The stop check is scheduled through available_at, and a known result can wake it before the deadline. Pause does not prevent this check. It runs no new business steps and admits no new Effect.
The worker loads the exact saved Process definitions and their value schemas to validate every retained continuation and the root Process identity. This check does not bind Actions, compile scripts, or load an executable program.
A corrupt continuation remains parked even after the deadline; repair it and explicitly Resume.
The deadline permits settlement without further waiting for external outcomes; it does not guarantee terminal status at that instant. A worker matching the Run’s original execution requirement must still claim and execute the stop check. Missing compatible workers, unavailable saved definitions or required value types, or an unavailable database can delay settlement.
External outcomes after the Run ends
Section titled “External outcomes after the Run ends”After validating the saved state, and once the stop policy permits the Run to finish, the Kernel ends local work that can be revoked. It leaves in-flight Effects UNKNOWN and records their IDs in termination.unresolvedAtSeal. This does not cancel the remote operations or mark unconsumed results as consumed or accepted for publication. A terminal Run can therefore still have unresolved external work.
unresolvedAtSeal records the situation at sealing; activeWork reports what remains unresolved now. A late result from the original attempt can settle its Effect after passing the identity, begun-attempt, and competing-evidence checks. This reduces current UNKNOWN and review work without requiring an operator to confirm the same fact solely because the Run has ended. Existing results, another begun unresolved dispatch, and non-execution evidence still follow the same conflict rules; operator decisions still require the matching review revision.
Settling an Effect cannot resume the process, restart normal dispatch or emission publication, or rewrite the Run status, completion time, termination record, or unresolvedAtSeal. It only completes the record of the external operation. Cleanup still requires every unresolved Effect, Outbox delivery, required emission acknowledgement, and retention condition to be satisfied.
Application protocol conflicts
Section titled “Application protocol conflicts”A trusted application adapter can call DurableStore.requestFailure(FailureStopCommand) after validating a domain-specific protocol conflict, supplying a bounded source category and redacted diagnostic. The Kernel uses the same first-stop transaction. It does not infer a business finding from opaque Effect bytes or rewrite an existing stop or terminal state. Expose this operation only through an authenticated application adapter.
RUN_FAILURE_REQUESTED is a timeline record before RUN_FAILED, not a new Outbox event. An application exposing these operations must authenticate callers, identify the actor, and audit the request. Outbox operator commands use eventId + expectedRevision to reject concurrent overwrites.
Outbox delivery
Section titled “Outbox delivery”Outbox exposes only:
WAIT_COMMITTED;EFFECT_REVIEW_REQUIRED;RUN_SUCCEEDED;RUN_FAILED;RUN_CANCELLED.
Implement DurableOutboxSink to send events to an external system. When delivery is not confirmed, Outbox retries according to its retry policy, using the same event ID, type, and logical payload. Consumers may therefore receive duplicate events. Delivery order is not guaranteed, even for events from the same Run; query the Run when the consumer needs its current state.
A successful return must mean the destination has durably accepted the event. Putting it in a JVM memory queue is not enough. Deduplicate durably by event ID, or pass that ID unchanged to a downstream consumer that does. CompileFlow does not guarantee exactly-once external side effects, and this SPI does not define communication between Runs.
Terminal Run events contain no result payload. A consumer that needs a complete result receipt must read and save getRunResult before acknowledging the event, with a retention window long enough to do so.
A non-Wait event can become ABANDONED after delivery attempts are exhausted and then stops blocking terminal Run cleanup. If the application requires a complete receipt before deletion, it must manage its own receipt and retention policy. Receiving an event alone does not satisfy that requirement.
Configure a source for published versions
Section titled “Configure a source for published versions”The Version examples below require a DurableVersionDefinitionSource; Alias starts also require DurableAliasStateSource. Register Spring beans or set versionDefinitionSource(...) and aliasStateSource(...) on the Durable configuration builder. Spring’s Deploy adapters are available only when the corresponding ProcessArtifactSource and ProcessDeploymentService beans are present. See the example’s version-definition source for explicit registration.
These two sources are application-configured data dependencies, not implementations discovered through the Extension service file. The application or Spring container owns their lifecycle; the engine uses them to read published definitions and committed routes.
ProcessRef.Version process = ProcessRef.version("sales", "approval", "v17");For a new Version or Alias start, DurableVersionDefinitionSource returns a VersionDefinition containing the ProcessDefinition.Inline and its callBindings. Each binding identifies the child Version selected for a direct ProcessCall at publication. The bindings must agree with the source; they cannot be used to change the execution graph separately.
Durable stores the model type, process code, original UTF-8 bytes, and SHA-256 digest together. It derives a processId from this content and uses that ID for recovery and runtime caching. Namespace and Version record where a Run started; recovery reads the saved definition and does not query the Version source again.
Saved definition bytes and a Run’s process identity are immutable. Register or publish a new definition under its own identity.
Each definition declares its own model type. Exact-Version ProcessCalls can cross format modules, with input/output compatibility checked before the Run starts. Classpath calls use the caller’s format.
Durable accepts the documented TBBPM and BPMN features and rejects other model types or unsupported constructs before registration. The database retains ProcessModelType, so recovery does not guess the format from XML. Both formats use the same Durable storage and recovery mechanisms; node behavior follows the selected format. Message correlation, user tasks, boundary events, and event-based gateways are outside the supported feature set.
Start by Version or Alias
Section titled “Start by Version or Alias”ProcessRunId knownId = ProcessRunId.random();// Save knownId with this business request before starting.ProcessRun exact = durable.start( knownId, process, Map.of("orderId", "o-42"));
ProcessRunId aliasRunId = ProcessRunId.random();// Save aliasRunId for this separate business request before starting by Alias.ProcessRun started = durable.start( aliasRunId, ProcessRef.alias("sales", "approval", "prod"), Map.of("orderId", "o-43"), new AliasRoutingOptions("customer-43", Map.of("region", "cn")));start(runId, ProcessRef, input) accepts Version and Alias references. An Alias-only overload also accepts AliasRoutingOptions after input. An exact Version does not accept routing inputs, and a process code alone is not enough to start a Durable process.
For a new Run started by Alias, the engine reads the committed route. A retired Alias has no active route and rejects new admission; an identical retry of an ordinary Start can still return its existing Run while the creation record is retained. Without a candidate, it selects the stable version. With a candidate, it calls the named ProcessAliasTargetingPolicy, if configured. If no policy is configured or the policy returns Optional.empty(), the engine uses the protocol’s deterministic percentage selector with the routing key and candidate weight. See version routing for policy failure handling. If no routing key is supplied, Durable uses the requested Run ID.
The raw routing key and attributes are not saved with the Run. Ordinary Start stores a digest of the effective routing inputs in its creation record to recognize identical retries. The selected Version may be recorded, but workers and recovery use processId and do not query Alias again.
Persisted state types
Section titled “Persisted state types”A persisted value must survive a stable round trip: encode it, decode those bytes, and encode the restored value to get the same canonical bytes. The codec rejects setters, constructors, defaults, or other transformations that lose or repeatedly change data. POJOs and records must both pass this check.
Decimal scale, collection order, and explicit nulls are part of the saved representation. Constructors, accessors, and codecs must be deterministic and have no external side effects; save every field that influences process decisions. The round-trip check verifies the data representation. Application-code side effects still need review.
The saved definition includes source, control semantics, variable and Action declarations, and recovery positions. Host components, business method bytecode, libraries, ScriptExecutor implementations, and POJO classes come from the current application. The application must therefore maintain every Java type used by persisted variables, scope frames, Effect inputs/outputs, and Wait results.
Recovery needs those classes and registered capabilities. CompileFlow reads the saved definitions, continuations, Waits, Timers, and Effects using the current parser, semantic compiler, and validated envelope format. Kernel and Store must use the same protocol. Namespaces do not isolate worker claims. Ordinary starts create untagged Runs; PostgreSQL extended admission can separately persist an execution requirement and let matching workers claim it.
Callback inputs and parallel iterations
Section titled “Callback inputs and parallel iterations”The engine first maps Action inputs, then makes a typed copy before invoking a replayable Action or saving an Effect request. It also copies the state passed to a Wait-description callback. Mutable POJOs inside read-only containers are copied too. Changing an Action or Wait callback’s arguments cannot change saved process state; return intended changes through the declared Action output mapping or a committed typed result.
Each parallel foreach iteration saves only variables that differ from the shared controller state. Comparison uses the JSON representation after validation against the declared types, including decimal scale and explicit nulls, rather than the application’s equals(). Changed persisted fields are therefore retained even when equals() compares only a business ID.
Join an application transaction on PostgreSQL
Section titled “Join an application transaction on PostgreSQL”Suppose accepting an order must also create its Run. Saving only the order loses the work; saving only the Run could start an order that was never accepted. The PostgreSQL integration lets both writes commit in one transaction:
PostgresDurableAdmission admission = PostgresDurableAdmission.bind(durable);PostgresDurableAdmission.Prepared candidate = admission.prepare(runId, definition, exactInput);// Inside the application's writable transaction, using its existing connection:admission.stage(connection, candidate, true);Bind an engine and prepare a definition
Section titled “Bind an engine and prepare a definition”bind requires the engine’s explicit DurableAdmissionSupport capability and obtains its actual PostgresDurableStore; it does not accept a separate Store. The default engine provides this capability. A custom engine or decorator must explicitly implement the same preparation, Store, and lifecycle contract; implementing only DurableProcessEngine is insufficient. A prepared value belongs to the exact engine object passed to bind, including a decorator.
prepare validates and registers the definition and its dependencies without creating a Run. Then call stage with a connection to the same database and public schema, with auto-commit disabled. It stages the creation of one new Run. The example sets retainEmissions=true, so an external consumer must acknowledge emissions before retention can remove them.
For integrations that require a particular execution environment, prepare(runId, definition, input, requirement) accepts an ExecutionRequirementRef (a canonical lowercase SHA-256 digest). The application defines and registers the capabilities identified by this digest; it is neither a permission nor a mutable Alias. Workers using Worker.withClaimSelector(ClaimSelector.registered(requirements)) claim Run, Effect, and Outbox work only for exact matching requirements. Default workers claim only untagged work. Deploy workers with matching capabilities before admitting tagged Runs, or the work will remain waiting. Both types live in com.alibaba.compileflow.durable.spi.store in compileflow-durable-spi and belong to the Provider Preview integration surface.
The prepare overload taking an Optional<ExecutionRequirementRef> and an ExecutionHoldPolicy also fixes the hold authority and cause capacity at admission. It cannot add a policy to an existing Run.
Use an application-owned transaction
Section titled “Use an application-owned transaction”stage leaves transaction management to the caller: it does not commit, roll back, close, retry, change auto-commit, or run business code. It sets transaction-local Durable protocol markers and upgrades synchronous_commit=off to on, while preserving the other synchronous-commit modes. These settings expire when the caller’s transaction commits or rolls back. Do not override the protocol markers or weaken the commit durability setting before committing; the caller owns the connection and must preserve these guarantees. Commit the business rows and Run together, and roll back the whole transaction if any step fails. The Run is accepted only after commit. If the commit outcome is unknown, read the original admission record using the application’s durable request ID, and still check the request’s scope and content.
Prepared is an opaque value belonging to the specific engine object that prepared it. It is not a registry handle or a persistable value, needs no separate close, and does not keep unreferenced definitions alive. Retention cleanup may remove those definitions between prepare and stage; after a complete rollback, prepare again from the same saved definition and input. Prepared values from another engine object are rejected before JDBC access.
To read a result within the application’s transaction, call admission.result(connection, runId). It reads according to the connection’s transaction visibility and uses the engine’s result decoder; it is not a commit receipt and does not manage that connection. To record candidate identity, use candidate.requestFingerprint(). The digest covers the exact execution binding, input, and admission policies, not the broader business request or the retainEmissions choice; it is not a commit receipt.
Closing the engine rejects new preparation and staging calls and waits for calls already in progress. It does not wait for a caller’s later commit. Other workers can discover the Run from the Store once that transaction commits.
This transaction integration is specific to PostgreSQL; the DurableProcessEngine API remains JDBC-free. The PostgreSQL facade uses DurableAdmissionSupport from the Provider Preview SPI and has no production dependency on the Runtime implementation. The SPI exposes neither JDBC resources nor Runtime-owned prepared values. Keep the Provider Preview artifacts on the same CompileFlow version. An engine with this capability does not add transaction support to an unsupported Store. Trusted Store integrations can also use PostgresDurableStore.start(Connection, NewRun, ...).
Let the integration manage the transaction
Section titled “Let the integration manage the transaction”To let the integration manage the transaction, call admission.inTransaction(work). It obtains a connection from the bound Store and invokes the synchronous callback at most once, without automatic retries. A setup failure may prevent the callback from running. It returns PgAdmissionResult: Committed, RolledBack, or OutcomeUnknown. Connection cleanup is reported separately; a cleanup failure does not undo a confirmed commit. An unknown outcome returns no candidate value and must be checked using the original request ID.
The callback must not commit or roll back, reconfigure or close the connection, or perform external I/O. Engine close waits for the entire inTransaction call, including transaction completion. With caller-managed stage, it waits only for the method call to finish.
Operational rules
Section titled “Operational rules”For a Run that is not continuing or an Effect with an uncertain outcome, start with the operations runbook. The rules below explain the storage, migration, and recovery contracts that an integration must preserve.
-
Use the selected Store’s database time to determine when work is eligible and when leases expire.
-
Lock the Run before its specific occurrence.
-
Every successful claim creates a new random lease token; renewal keeps it. Reclaiming expired work revokes its old lease, and a later claim obtains a new token. Turn commits and other lease-controlled transitions require the current, unexpired lease. Returned Effect evidence is checked against its original attempt and can be saved after that lease expires.
-
Keep continuation, Effect, and Wait payloads and raw tokens out of logs.
-
Back up and restore all tables owned by the selected provider together, including
cf_durable_effect_attemptand PostgreSQL’scf_durable_run_hold. Stop all writers before PITR and rebuild disposable runtime caches afterwards. -
Retain definitions referenced by a recoverable Run, backup, or WAL/PITR point. Optional unused-Process cleanup deletes only definitions without Run references. Run-Process foreign keys and the Start key-share lock prevent definition loss when creation and cleanup run concurrently.
-
The application or transport layer handles authentication, authorization, approval, request deduplication, rate limits, TLS, and database access control.
Production migrations and database permissions
Section titled “Production migrations and database permissions”In production, normally run Flyway migrations as a separate deployment step and disable in-process migration. Startup checks the database product, migration history, physical columns, constraints, and triggers. A mismatch, pending or unknown migration, or incomplete schema prevents startup. Each provider creates its initial schema through V1__durable_kernel.sql.
Use separate database accounts for migration and execution. With MySQL binary logging enabled, creating immutability triggers may require elevated privileges. Give those privileges only to the migration account; do not grant them to the runtime account or weaken the database’s global trust settings.
The runtime account needs schema-validation and DML permissions. On MySQL it also needs EXECUTE ON PROCEDURE <database>.cf_durable_schema_triggers to read trigger metadata, but no TRIGGER or DDL privileges.
Definition fingerprints and recovery identity
Section titled “Definition fingerprints and recovery identity”Definitions use the semantic-v1 and durable-machine-v1 canonical formats. Java action and reconcile inputs bind by formal parameter name. The fingerprint retains XML input order because it determines expression evaluation order. The semantic form records class as the invocation kind when an action constructs its target class. It records bean for a host-resolved target and script for inline code, including Java scripts. The fingerprints include deadline literals and bound expressions. Every Wait records both optional bindings, outcomeVariable and resolvedAtVariable. An absent binding is encoded as null.
These fingerprints identify the prepared semantics and executable program, including the semantic digest passed to DurableWaitDescriptionProvider. Recovery uses a separate processId, derived from model type, process code, and the complete definition bytes. A committed Wait reads its saved due_at and typed result. Keep the definition and bindings needed by every recoverable Run.
Returned Effect evidence
Section titled “Returned Effect evidence”Before calling business code, the adapter atomically consumes the invocation permit granted by its claim. Each permit starts one call. An encoded normal return is saved against that attempt, its original process and call site, and the SHA-256 digest that the Store computed from the original input.
Losing a lease does not delete a returned result or let the old task regain scheduling permission. Starting another invocation, renewing a lease, and requeuing work require a current lease. Saving a returned result instead checks the original begun attempt and its process, call site, operation, and input digest. Operator decisions use the review revision recorded during the investigation. After a conflict, investigate again before deciding.
To establish the order of events, use the attempt identities, the record that invocation began, and the evidence saved for each attempt. Diagnostic timestamps alone are insufficient when the database clock moves backwards.
If another begun dispatch has not returned, a late result can be saved but cannot finish the entire occurrence. A finding that the operation did not execute covers only attempts present when the Run/Effect locks were taken. Later attempts have separate identities and follow normal completion rules.
When distinct attempts return different opaque bytes, the Store retains the difference for diagnosis. It does not infer mutually exclusive business results or Run failure, or replace the first canonical result. Different bytes submitted for the same attempt record a protocol conflict. findEffectResultEvidence reads the original evidence; the public Timeline reports the event category and sequence, not an Effect ID or the underlying evidence. Use separately authorized Store-level evidence queries to investigate the particular Effect.
The attempt table keeps input digests and returned evidence until Run cleanup removes them within its physical-row budget. Consumed-occurrence cleanup does not remove these rows. Releasing a claim for an unavailable capability removes attempts whose invocation never began, preventing an unbounded history of unused claims.
MySQL commit durability prerequisites
Section titled “MySQL commit durability prerequisites”For durable acknowledgement of InnoDB transactions, the deployment must use
innodb_flush_log_at_trx_commit=1 and, when binary logging is enabled, sync_binlog=1.
These are server-wide prerequisites, not connection-local options.
MySqlDurableStore neither changes nor verifies them; check the effective configuration
before admitting production Runs. Weaker settings can lose recently acknowledged transactions
after a crash, even when JDBC commit() returned successfully.
The storage stack must honor flush requests. These settings alone do not establish replica failover safety, backup recovery, or target-business idempotency. See the MySQL 8.4 documentation for InnoDB durability and binary log synchronization.
Publishing data produced by a Run
Section titled “Publishing data produced by a Run”Applications can publish data alongside process execution by implementing
com.alibaba.compileflow.durable.spi.emission.DurableTurnEmissionSource from compileflow-durable-spi.
Use a public implementation class with a public no-argument constructor, annotate it with @ExtensionRealization, and list its name in the standard Extension service file. See the extension guide for the declaration format.
The framework creates and owns the instances. The engine requires a unique highest-priority source; a tie fails assembly. Declaring an emission-source bean alone does not register the extension.
The source extracts candidate emissions before the Turn commits, and the Store commits them with that Turn. Extraction runs outside the Store transaction and may repeat after a rejected commit or recoverable failure. It may read the supplied snapshots and immutable data they reference, but must not dispatch business operations or change external business state. Only emissions from an accepted Turn commit become available for publication.
Each page holds at most 256 items and 4 MiB of total payload. Consumers deduplicate by origin and check that the sequence has no gaps. The terminal cursor is fixed once assigned. Acknowledgements provide retention hints without changing execution state; application foreign keys and other retention requirements still apply.
PostgreSQL also supports execution requirements, execution holds governed by the policy saved when the Run is created (managed separately from Pause and Resume), and closing publication before the Run ends. MySQL rejects unsupported admission extensions before database access. Early publication sealing is rejected at the fenced Turn commit, after any earlier termination intent takes precedence.
Stop publication early on PostgreSQL
Section titled “Stop publication early on PostgreSQL”DurableTurnEmissionSource.sealEmissions(...) returns false by default. Returning true on PostgreSQL commits a publication seal with the continuation and candidate emissions, under the original Run lease. If the lease is stale, the continuation cannot commit, or the transaction rolls back, neither the candidates nor the seal are visible. A cancellation committed earlier is handled before candidate publication.
The first seal sets sealedSequence to the number of accepted emissions and sealedAt to database time; when no emissions have been accepted, the sequence is zero. Later Turns can continue settling the Run without adding emissions. Repeating the seal preserves its original sequence and time. Both Store and direct SQL insertions are rejected after sealing. Insertion and sealing are serialized by the same Run row lock; startup requires the insertion guard to remain ENABLE ALWAYS.
An early seal prevents the Run from adding further emissions. It does not change Run execution state or settle an Effect or Wait. finalSequence appears only when the Run becomes terminal, and retention acknowledgement must match it. Terminalization creates a missing seal or preserves an existing seal’s first sequence and timestamp.
Consumers can tell that no more emissions will be published without assuming that execution has finished. MySQL supports closing publication at the Run’s terminal state, but rejects early sealEmissions=true after validating the current lease and honoring any earlier termination intent. Its terminal-only pages may have no sealedAt; consumers must not invent that timestamp. A definitive rejection of an unsupported early seal or of emissions after sealing parks automatic execution with PUBLICATION_SEAL_UNSUPPORTED or PUBLICATION_CLOSED respectively; it does not accept the proposed Turn. Resume requires explicit operator action.