Skip to main content

Interface: JobExecuteResult

Defined in: packages/workflow-engine/src/kernel/commands.ts:189

Result of a job.execute command.

Properties​

attempt?​

readonly optional attempt?: number

Defined in: packages/workflow-engine/src/kernel/commands.ts:227

The job attempt that ran, echoed from the command when it carried one.


error?​

readonly optional error?: string

Defined in: packages/workflow-engine/src/kernel/commands.ts:192


ghost?​

readonly optional ghost?: boolean

Defined in: packages/workflow-engine/src/kernel/commands.ts:195

True when the job was not executed because the run is not RUNNING.


ghostReason?​

readonly optional ghostReason?: "version" | "orphan" | "race"

Defined in: packages/workflow-engine/src/kernel/commands.ts:211

Only set alongside ghost. Distinguishes the two reasons a job can find its run not RUNNING:

  • "orphan" — the run is CANCELLED/COMPLETED/FAILED, or was made so mid-execution. The job is meaningless and must be thrown away.
  • "race" — the run is still PENDING, i.e. its claim had not committed when this job was dequeued. The job is valid and simply arrived early: it must be re-delivered, not discarded, or the run wedges RUNNING with no job until run.reapStuck sweeps it up.
  • "version" — the run is pinned to a definition version this build does not serve. The job is valid but belongs to another build: it must be re-delivered so a process running that definition executes it. run.listVersions reports these runs; run.redrive with definitionVersion: "latest" moves them onto the current build.

maxAttempts?​

readonly optional maxAttempts?: number

Defined in: packages/workflow-engine/src/kernel/commands.ts:229

The attempt budget the retry decision used, when the command carried one.


nextPollAt?​

readonly optional nextPollAt?: Date

Defined in: packages/workflow-engine/src/kernel/commands.ts:193


outcome​

readonly outcome: "failed" | "completed" | "suspended"

Defined in: packages/workflow-engine/src/kernel/commands.ts:190


output?​

readonly optional output?: unknown

Defined in: packages/workflow-engine/src/kernel/commands.ts:191


retryable?​

readonly optional retryable?: boolean

Defined in: packages/workflow-engine/src/kernel/commands.ts:217

False marks a deterministic failure (e.g. Zod input/config validation) that will not succeed on retry — hosts should fail the job terminally. undefined/true preserves default retry behavior.


willRetry?​

readonly optional willRetry?: boolean

Defined in: packages/workflow-engine/src/kernel/commands.ts:225

True when the failure was recorded as a pending retry (stage left PENDING with the error on errorMessage) because the command carried attempt/maxAttempts with attempts remaining and the error was not deterministic. The host must re-enqueue the job (jobTransport.fail(jobId, error, true)).