Skip to content

Errors

Every error extends RungsError and has a stable code. Branch on the class or the code, never on the message, which may become more helpful over time.

ClassCodeWhen
FlowDefinitionErrorFLOW_INVALIDInvalid flow definition
FlowNotFoundErrorFLOW_NOT_FOUNDNo flow with this key (and version) for the tenant or globally (EC-56). Exposes flowKey, version?, tenantId?
ConfigurationErrorCONFIG_INVALIDcreateRungs was given unusable options (missing store, clock or ids, an invalid dispatchRetry duration, events: "discard" with onEvent), clock or ids returned unusable values, or dispatchPending was called without onEvent
InvalidCommandErrorCOMMAND_INVALIDMalformed command input (e.g. empty IDs, non-JSON payload, override without a comment). The message names each problem
FlowNotApplicableErrorFLOW_NOT_APPLICABLESubmit refused because every step was skipped and the flow uses onAllSkipped: "fail" (EC-39). Exposes flowKey, skippedStepIds
RequestNotFoundErrorREQUEST_NOT_FOUNDUnknown request
NotAssignedErrorNOT_ASSIGNEDActor has no pending task on this request, or is not the requester for resubmit / withdraw
InvalidTransitionErrorINVALID_TRANSITIONe.g. approving a closed request
ConflictErrorVERSION_CONFLICTexpectedVersion mismatch or concurrent write (EC-15). Exposes requestId, expectedVersion, actualVersion
ResolutionErrorRESOLUTION_FAILEDA host callback (role lookup, named resolver, isActiveUser) threw or returned invalid data (EC-05). Usually transient: nothing changed, so the command can be retried. The original error is in cause; exposes stepId
NoApproversErrorNO_APPROVERSSubmit refused because a step has no approvers (onEmptyStep: "fail") or cannot reach its quorum (EC-02, EC-04, EC-43, EC-45). A configuration or data problem: retrying will not help. Exposes stepId, reason, removed
ConditionErrorCONDITION_INVALIDA gt/gte/lt/lte condition meets a missing field or a type mismatch (EC-40). Exposes field, op, expected, received

Rungs checks workflow routing (is this actor assigned to a task?), not authentication or permissions. Your application signs people in and decides, for example, who is an administrator, before it calls a command.

ResolutionError is usually worth retrying: a callback failed and nothing changed. NoApproversError is not: a step has nobody who can approve it until your data or the flow changes.