Core types

The classes and interfaces that make up Skipper's API — Workflow, Actions, the factory, callbacks, and instance management.

In-workflow API — Workflow

Methods available inside a @WorkflowMethod. See Workflow API and Versioning.

SignatureDescription
waitUntil(condition): BooleanWait indefinitely until the condition becomes true.
waitUntil(condition, timeout): BooleanWait until the condition holds or the timeout elapses; returns whether it was met.
waitUntil(condition, timeout, timerId): BooleanSame, with a stable timer id — the evolution-safe form.
sleep(duration)Pause for a fixed duration.
checkpoint(block) / checkpoint(name, block)Run a block once and persist its effect; the named variant is evolution-safe.
checkpointSuspend(block)Suspend-friendly checkpoint for Kotlin suspend workflows.
version(changeId, minVersion, maxVersion): IntVersion gate for branching changed logic without breaking in-flight instances.
actions<T>() / actions(Class)Obtain a typed handle to an Actions class.
id: StringThis workflow instance’s id.
getWorkflowInstanceView(): WorkflowInstanceViewA snapshot of this instance’s status and history.
cancelWorkflowInstance(reason): WorkflowInstanceViewCancel this instance.

Defining actions — Actions

See Core Concepts, Compensation, and Error Handling.

SignatureDescription
actions.named(name) — KotlinGive the next action call a stable checkpoint name.
actions.named(Class, name) — JavaSame, with an explicit class token for a typed return.
retryStrategyProvider(): RetryStrategyOverride (Java) to set the default retry strategy for an action class.

Invocation — IWorkflowFactory

Starting and addressing workflows. See Invoking Workflows.

SignatureDescription
factory<T>(id) — KotlinCreate/address a workflow instance by id. The id is an idempotency key.
factory.invoke(Class, id) — JavaThe same, for Java callers.
factory.builder<T>(id) — KotlinBuilder for advanced invocation; reified, no class token.
factory.builder(Class, id) — JavaThe same, for Java callers.
.callbackHandler(Class)Register a WorkflowCallbackHandler for async lifecycle events.
.runAsync()Hand execution to the persistent scheduler instead of running in-process.
.detached()Return without waiting for the result — fire-and-forget. Requires a result-less workflow method.
.workflowOptions(WorkflowOptions)Per-invocation options (timeout, query-on-nonexistent).
.requestContext(payload)Opaque, persisted per-request payload surfaced to middleware.
.parentWorkflowId(id)Link this instance to a parent workflow.
.build(): TBuild the workflow handle.

Lifecycle callbacks — WorkflowCallbackHandler

Implement to receive async results. The first four are required; the rest have default no-op implementations. See Invoking Workflows.

MethodFires when…Required
onSuccess(view)the workflow reaches a successful terminal stateyes
onNonRetryableError(view, error)a non-retryable error (or exhausted retries) failed ityes
onWorkflowInWaitingStatus(view)it hit an unfulfilled waitUntil and hibernatedyes
onWorkflowTimeout(view)it exceeded its execution timeoutyes
onRetryableError(view, error)a retryable error occurred (before a retry)default
onRetriesExhausted(view, error)a PersistentRetryStrategy ran out of retriesdefault
onCompensationCompleted(view) / onCompensationError(view, error)compensation finished or faileddefault
onCancelled(view, reason)the instance was cancelleddefault

Instance management — WorkflowsService

Bulk operations over many instances. See Instance Management.

SignatureDescription
countWorkflowsByStatus(statuses): longCount instances in the given statuses.
findWorkflowsWithExhaustedRetries(limit)List workflows parked in RETRIES_EXHAUSTED.
reExecuteWorkflows(ids)Re-run workflows, retrying their last failed action.
cancelWorkflows(ids, reason)Cancel multiple non-terminal workflows.
rewindWorkflow(id, pivot)Reset an instance to a checkpoint and replay from there (incident recovery).
resetWorkflowsFromError(ids)Move errored workflows back to a runnable state.
deleteWorkflow(id)Permanently delete a workflow instance.
inspectDeadLetterQueue(limit)List tasks parked in the dead-letter queue.
redriveDeadLetterQueue(tasks) / removeFromDeadLetterQueue(tasks)Retry or permanently remove DLQ tasks.

Workflow status — WorkflowInstanceView

Returned by getWorkflowInstanceView(). Fields: id, workflowClass, workflowMethod, status, createdAt, workflowInput, state, parentWorkflowId. The status is one of:

CREATED · RUNNING · WAITING · COMPLETED · ERROR · TRANSIENT_ERROR · RETRIES_EXHAUSTED · TIMEOUT · COMPENSATION_IN_PROGRESS · COMPENSATION_ERROR · COMPENSATION_COMPLETED · CANCELLED