SDK reference
SDK reference

error

Record a problem separately from the run's terminal outcome.

Signature

run.error(error: WorkflowError): void

Fields

FieldTypeMeaning
codestringRequired stable code, 1-128 characters
messagestringOptional safe description, max 2,048 characters
handledbooleanRequired; whether application code handled the problem
retryablebooleanOptional application-reported retry policy

Do not send raw exception objects, stacks, credentials, or provider response bodies. Review messages for sensitive data.

Recovered problem

run.error({
  code: "PRIMARY_PROVIDER_UNAVAILABLE",
  handled: true,
  retryable: true,
})
run.setProperties({ provider: "backup" })
// After your application's recovery succeeds:
run.done({ result: { imported: 988, skipped: 12 } })

Use handled: true when your code recovered from the problem.

Terminal problem

run.error({ code: "PAYMENT_DECLINED", handled: false, retryable: false })
run.fail({ code: "PAYMENT_DECLINED", retryable: false })

Even handled: false does not terminate the run. Only fail() reports a failed run. You can call fail() alone if a separate error event adds no useful detail. Retryability is descriptive; Flowmark never retries your business work.

Error markers after completion request or terminal failure are ignored.

On this page