Skip to main content

Error Handling

The Stepflow Protocol uses JSON-RPC 2.0 error handling with standardized error codes for consistent error reporting across all implementations. This specification defines standard error codes, error response formats, and best practices for error handling.

Error Response Format

All errors follow the JSON-RPC 2.0 error response specification:

{
"jsonrpc": "2.0",
"id": "<request_id>",
"error": {
"code": <error_code>,
"message": "<human_readable_message>",
"data": <optional_additional_data>
}
}

Error Response Fields

  • code (required): Integer error code from standardized ranges
  • message (required): Human-readable error description
  • data (optional): Additional structured error information for debugging

Standard Error Codes

The protocol defines error codes in standardized ranges following JSON-RPC conventions:

JSON-RPC Standard Errors (-32768 to -32000)

CodeNameDescriptionWhen to Use
-32700Parse ErrorInvalid JSON was receivedMalformed JSON in request
-32600Invalid RequestThe JSON sent is not a valid Request objectMissing required fields, invalid structure
-32601Method Not FoundThe method does not exist / is not availableUnknown method name
-32602Invalid ParamsInvalid method parameter(s)Schema validation failure, wrong parameter types
-32603Internal ErrorInternal JSON-RPC errorServer implementation error

Stepflow Protocol Errors (-32099 to -32000)

CodeNameDescriptionWhen to Use
-32000Server ErrorGeneric server errorUnspecified server-side error
-32001Component Not FoundRequested component does not existUnknown component name
-32002Server Not InitializedServer has not been initializedMissing initialization
-32003Invalid Input SchemaInput does not match component schemaSchema validation failure
-32004Component Execution FailedComponent failed during executionBusiness logic error
-32005Resource UnavailableRequired resource is not availableExternal dependency failure
-32006TimeoutOperation timed outLong-running operation timeout
-32007Permission DeniedInsufficient permissionsAuthorization failure
-32008Blob Not FoundRequested blob does not existInvalid blob ID
-32009Expression Evaluation FailedFlow expression could not be evaluatedInvalid reference or path
-32010Session ExpiredHTTP session has expiredSession cleanup or timeout
-32011Invalid ValueInvalid value for a fieldValue in a field is not valid
-32012Not foundReferenced value is not foundReferenced entity does not exist