TypeScript SDK exception reference

TypeScript errors inherit from ArcFlowError. Native Rust failures arrive as thrown Error objects with structured message prefixes; mapNativeError() converts them into typed subclasses when patterns match.

Exported exception classes

ClassExtendsWhen raised
ArcFlowErrorErrorBase; fallback from mapNativeError
WorkflowConfigurationErrorArcFlowErrorInvalid workflow before or at validation
WorkflowExecutionErrorArcFlowErrorStep failure during run
ProviderConfigurationErrorArcFlowErrorInvalid provider constructor args
ProviderExecutionErrorArcFlowErrorLLM call failed
RetryExhaustedErrorArcFlowErrorAll retries exhausted
WorkflowTimeoutErrorArcFlowErrorWorkflow or step timeout
TraceNotFoundErrorArcFlowErrorNo trace for last run
HumanRejectedErrorArcFlowErrorHITL rejection
WorkflowInterruptedErrorArcFlowErrorHITL interrupt (expected pause)

mapNativeError

typescript
import { mapNativeError } from "arcflow";

try {
 await wf.run("input");
} catch (err) {
 throw mapNativeError(err);
}

Mapping rules in arcflow/exceptions.ts:

Native message patternMapped type
ProviderExecutionError|...ProviderExecutionError with providerId, runId, failedStep
WorkflowExecutionError|...WorkflowExecutionError with runId, failedStep
failed after N attemptsRetryExhaustedError with attemptsMade
contains timed outWorkflowTimeoutError with timeoutType
No trace foundTraceNotFoundError
invalid, must be, Cannot runWorkflowConfigurationError
otherwiseArcFlowError

Pipe-separated native messages encode context fields before the human-readable tail.

Typed fields

WorkflowExecutionError

FieldType
runIdstring | undefined
failedStepstring | undefined

ProviderExecutionError

FieldType
providerIdstring | undefined
runIdstring | undefined
failedStepstring | undefined

RetryExhaustedError

FieldType
attemptsMadenumber | undefined

WorkflowTimeoutError

FieldType
timeoutTypestring | undefined (workflow or step heuristic)

HumanRejectedError

FieldType
approvalKeystring | undefined

WorkflowInterruptedError

FieldType
runIdstring
approvalKeystring
expiresAtstring | undefined

Parity gaps vs Python exceptions

These Python exception classes are not exported from the TypeScript SDK. Native failures in the same category may surface as generic ArcFlowError or WorkflowExecutionError until dedicated bindings are added:

Python onlyTypical native symptom
ToolConfigurationErrorPre-run tool validation message
ToolExecutionErrorTool failure during run
MemoryConfigurationErrorInvalid memory config
MemoryOperationErrorBackend I/O failure
InfrastructureUnavailableErrorPostgres/Qdrant unreachable
TraceStorageWarningTrace store capacity drop

If you need stable instanceof checks for these cases in TypeScript, inspect err.message prefixes or use Python SDK for tool/memory-heavy workflows.

Configuration vs execution

Same discipline as Python:

PhaseTypes
Pre-run (fix definition)WorkflowConfigurationError, ProviderConfigurationError
During runWorkflowExecutionError, ProviderExecutionError, RetryExhaustedError, WorkflowTimeoutError
HITL control flowWorkflowInterruptedError, HumanRejectedError
Post-runTraceNotFoundError

Remediation quick reference

ExceptionTypical fix
WorkflowConfigurationErrorFix workflow graph/steps, call order, empty input
WorkflowExecutionErrorwf.trace(), inspect failed step
ProviderConfigurationErrorValid model name, temperature, maxTokens
ProviderExecutionErrorAPI key env var, model availability
RetryExhaustedErrorIncrease withRetry or fix root error
WorkflowTimeoutErrorwithTimeout / withStepTimeout
TraceNotFoundErrorCall run() before trace()
WorkflowInterruptedErrorresumeWithApproval()
HumanRejectedErrorHandle rejection branch

Messages use the [ArcFlow] prefix when raised from validation layers, matching Python convention.