Execution Failure Model
When an execution fails, first identify the stage: before the process started, during an action, or while converting the result after the invocation returned normally. This determines whether a retry is appropriate and whether it could repeat business operations.
Engine API
Section titled “Engine API”execute(...) and trigger(...) return ProcessResult<T> for execution outcomes. Each result includes ProcessExecution details and one of:
- success:
outputand no error; - failure: a
ProcessErrorwith a stablecodeand a human-readablemessagethat must exclude sensitive data.
Check isSuccess() or isFailure() first, and read getError().getCode() only for a failure. A successful output may be null. Branch on the stable error code, not message text. Use the no-argument orElseThrow() when the caller needs an exception: it converts a failed result to ProcessExecutionException, preserving the same ProcessError and in-memory ProcessExecution.
Invalid Java API arguments throw before the invocation is accepted. Lifecycle misuse, infrastructure interruption, and rejected infrastructure work can also throw. An Error not handled by an internal component propagates to the caller instead of becoming a ProcessResult.
Invalid definition format, including an XSD violation, is classified as CF_VALIDATION_002. A structurally invalid or unsupported definition may have another validation code. Execution APIs return handled failures in ProcessResult; tooling().preflight(...) reports failed checks in its stage diagnostics. Common execution and mapping failures include:
| Failure stage | Error code | Effect on execution |
|---|---|---|
| Interruption or action failing to stop after cancellation | CF_EXEC_007 |
Do not retry blindly. An earlier action or the interrupted action may have produced side effects; an action that ignores cancellation may still be running. |
| Input mapping | CF_EXEC_010 |
The process has not started; correct the input or mapping. |
| Output mapping | CF_EXEC_009 |
Execution has returned normally, at the end or a Wait entry, and side effects may have occurred; fixing conversion does not undo them. |
| Alias route missing, target selection failed, or selected target not authorized by the route | CF_EXEC_011 |
At runtime admission, no Action in the affected invocation has run; inspect the route and targeting policy. |
| Selected root or required child runtime unavailable on this node | CF_EXEC_012 |
At runtime admission, no Action in the affected invocation has run; inspect the exact call graph and local readiness. |
| Nested call beyond the configured depth | CF_EXEC_013 |
Child actions have not run; inspect the call graph and depth setting. |
Invalid call target, a classpath child in a versioned process, or a cycle |
CF_EXEC_014 |
Child actions have not run; correct the call relationships in the definition. |
CF_VALIDATION_006 indicates an unsupported process element or execution semantic. CF_VALIDATION_005 indicates a process structure validation failure, including a capability that is not supported by the selected execution mode.
Input and output mapping errors expose neither the mapper’s original exception nor the application object. This applies to conversion performed by the engine, not to ProcessResult.map(...): that method invokes the caller’s mapper after a successful invocation (including a successful null output), and exceptions from that mapper propagate to the caller.
When constructing a ProcessError yourself, supply a safe message. Its constructor validates the code and message format, not their confidentiality; getMessage() returns the supplied message unchanged. Do not put exception text, credentials, or business data into either field.
Information available for diagnosis
Section titled “Information available for diagnosis”ProcessExecution includes trace and invocation IDs, namespace, process code, an optional exact Version, start and completion times, and the optional reached trigger entry. The ProcessEvent emitted when execution ends separately carries ExecutionAttribution for the parent invocation, call depth, model type, source digest, and Alias used at admission. Neither object exposes routing keys, process variables, source content, arbitrary metadata, or raw exceptions.
Execution HTTP Contract
Section titled “Execution HTTP Contract”Workbench Server and the local development gateway return process outcomes with HTTP 200. The success field indicates whether execution succeeded. For example, this response reports a process failure:
{ "success": false, "message": "Process execution failed", "errorCode": "CF_EXEC_001", "error": "Process execution failed", "traceId": "4a04d9f8d8bb4d6fb2ae1e577d99dfe2", "invocationId": "inv-...", "processCode": "order.rule", "durationMs": 12, "routing": { "namespace": "default", "requestedAlias": "production", "effectiveVersion": "2026.07.1", "alias": "production", "routeRevision": "8", "target": "STABLE" }}A successful response contains success: true, may include an object-valued result, and contains no error fields. When no output is supplied, result may be absent. A failed response contains success: false and non-empty errorCode and error fields, without result. A response may also contain reachedTrigger, with a required nodeId and optional event. It identifies the trigger entry reached by the ordinary invocation, not a persisted Wait or recovery token; it may also be retained when output mapping fails. Workbench checks the success/failure distinction in TypeScript and when reading responses at runtime.
HTTP failures—such as malformed requests, failed authentication, capacity rejection, or an unavailable upstream—use non-2xx status codes and RFC 9457 Problem Details:
{ "type": "urn:compileflow:problem:invalid-request", "title": "Invalid request", "status": 400, "detail": "request body is required", "instance": "/api/executions/preview", "code": "INVALID_REQUEST"}Workbench Server and the development gateway use the same application/problem+json format for preview requests. A production gateway may generate its own transport errors, but must still return a non-2xx status. Clients branch on the stable uppercase code field. detail explains the failure without exposing sensitive information. Clients should display it to users and use code to decide how to handle the error.
Deployment command failures also use non-2xx Problem Details. They return a stable DeploymentErrorCode in code, a fixed detail that excludes sensitive information, validated process context, and a commitOutcome of COMMITTED, NOT_COMMITTED, or UNKNOWN. This field describes the authoritative write, not runtime readiness. Read the current published version or route before retrying a command whose outcome is unknown. The response does not copy the original DeploymentException message, cause, SQL diagnostics, transport details, or credentials. Detailed diagnostics stay in protected server logs.
Retry Rules
Section titled “Retry Rules”- The browser never automatically resends a synchronous execution POST.
- When
CF_EXEC_011orCF_EXEC_012originates from runtime admission, no Action in that invocation has run. The error code alone does not establish that the enclosing business request had no side effects. For example, an earlier action may have charged a payment before a later Action calls the engine and receives one of these errors. Retrying the whole request could charge that payment again. Require application-level idempotency and explicit attempt and time limits; if retries are exhausted, inspect the route and runtime. CF_EXEC_013requires fixing the call graph or depth limit.CF_EXEC_014requires fixing the call target, the child’sclasspath/versionreference, or the cycle. Waiting and retrying the same request cannot resolve either problem.- Workbench persisted asynchronous invocation defaults to one attempt. Setting
maxAttempts > 1permits retrying the entire invocation after a failure; it does not guarantee eventual business success. Even with a single attempt, a failed result does not prove an external operation never occurred, and an explicit dead-letter redrive may repeat it. - A stable
invocationIdcorrelates records and deduplicates asynchronous submissions. The same ID and request fingerprint return the existing invocation, even if the Alias has since changed; a different fingerprint returns a conflict. JSON object field order does not affect the fingerprint, but array order, numeric precision, decimal scale, signed zero, and missing versus null values can. It also includes the requested route and effective retry settings. This does not guarantee that external operations happen exactly once. - Every action that may be retried and produces side effects must use a stable business key for idempotency.
- For a new Alias-based asynchronous invocation, Workbench selects the exact Version before persisting the invocation. A request for an exact Version needs no Alias selection. It stores that Version and the necessary execution attribution.
Raw routing keys and policy attributes are not persisted, but contribute to the SHA-256 request fingerprint used for idempotency checks.
If no
routingKeyis supplied, the invocation ID is used as the routing key. Supply your own stableinvocationIdif you need to deduplicate submissions after losing a response; omitting it allows the server to generate a new ID on each submission. The fingerprint is an unkeyed digest, not encryption or a confidentiality guarantee. Keep sensitive data out of routing inputs.
Handled unexpected worker or API exceptions are converted to stable diagnostics before being stored or returned over HTTP. An async attempt that exits without committing its outcome (for example, because an unhandled Java Error escapes) can remain running in the Store until its lease expires. Recovery records LEASE_EXPIRED; it does not prove that the attempt performed no business operations. Public responses do not include raw exception messages for unexpected failures.