Error Reference
This reference documents the standard error types and error handling capabilities in Lemline.
Standard Error Types
Lemline implements the standardized error types defined in the Open Workflow Specification, with the base URI https://open-workflow-specification.org/spec/1.0.0/errors/:
Error Type | URI | Default Status | Description |
|---|---|---|---|
Configuration |
| 400 | Errors in workflow definition or structure |
Validation |
| 400 | Input/output data schema validation failures |
Expression |
| 400 | Expression evaluation errors (JQ syntax or execution) |
Authentication |
| 401 | Authentication failures |
Authorization |
| 403 | Authorization/permission failures |
Timeout |
| 408 | Timeout violations (workflow or task) |
Communication |
| 500 | Errors communicating with external services |
Runtime |
| 500 | General runtime execution errors |
Error Structure
All errors in Lemline follow the RFC 7807 Problem Details format:
Field | Required | Description |
|---|---|---|
| Yes | URI reference identifying the problem type |
| Yes | HTTP status code (numeric) corresponding to the error |
| Yes | JSON pointer to the location in the workflow where the error occurred |
| No | Short, human-readable summary of the problem |
| No | Detailed explanation specific to this error occurrence |
Error Titles and Details
Lemline errors carry no numeric or symbolic error code: identify them by type (and status), and read title and detail for the specific cause. For example:
Situation |
|
| Example message |
|---|---|---|---|
A declared secret is not set on the runner |
| 403 |
|
An HTTP call returns a non-2xx status |
| the HTTP status (for example 404) |
|
An HTTP call gets no response (unknown host, refused connection, timeout) |
| 500 |
|
An A2A call gets a non-2xx status from the agent |
| the HTTP status | title |
An A2A call gets no usable answer (unreachable agent, timeout, stream cut before its final result) |
| 500 | title |
A |
| 408 |
|
An expression fails to evaluate |
| 400 | the evaluation error message |
Input or output does not match its schema |
| 400 | the schema validation message |
A failed HTTP call can therefore be caught by type and by status, for example catch.errors.with: { type: https://open-workflow-specification.org/spec/1.0.0/errors/communication, status: 503 }. The Unable to reach title names the server only, never the path or the query of the URL.
Errors raised by call: a2a use the base URI https://serverlessworkflow.io/spec/1.0.0/errors/ instead: catch https://serverlessworkflow.io/spec/1.0.0/errors/communication for the failures above, and https://serverlessworkflow.io/spec/1.0.0/errors/runtime for the others, such as an error returned by the agent in its JSON-RPC answer.
Lemline only raises timeout errors for listen tasks: workflow-level timeouts and timeouts on other tasks are not enforced yet.
CLI Exit Codes
Exit Code | Description |
|---|---|
0 | Success |
1 | Error while running the command (including a missing configuration file) |
2 | Invalid command line (unknown option, missing argument) |
Gateway API Errors
The gateway exposes gRPC (and Connect) APIs. Failed calls return standard gRPC status codes, for example INVALID_ARGUMENT for an invalid request, NOT_FOUND for an unknown definition or instance, ALREADY_EXISTS, UNAUTHENTICATED, PERMISSION_DENIED and INTERNAL.
Java Exception Hierarchy
For developers working on Lemline, workflow errors are carried by a single exception type:
An activity reports a failed exchange with an external service by throwing com.lemline.core.errors.CommunicationException, which carries the status to report; it becomes a communication error. Any other exception thrown by an activity becomes a runtime error with status 500.
InternalException holds an InternalException.Error with the standard error fields (type, status, instance, title, detail). The error type is one of the values of com.lemline.core.errors.WorkflowErrorType (configuration, validation, expression, authentication, authorization, timeout, communication, runtime).
Defining Custom Errors
Custom error types can be defined in workflow definitions:
Error Handling Examples
Basic Try-Catch
Matching Multiple Error Types
A try task has a single catch. To handle several errors differently, catch them and route on the fields of the caught error in catch.do:
Using Retry Policies
Error Debugging
When debugging errors:
Read the
workflow.faultedandtask.faultedlifecycle events of the instance in the dashboard; they carry the errortype,status,title,instance(position in the workflow) anddetail.Run the runner with
--debugto log the input of each task. Every log line carries the workflow namespace, name, version and instance id, so you can filter on the instance.
Error Handling Best Practices
Be specific with error types: Catch specific error types rather than all errors
Provide fallbacks: Use default values or alternative paths for common errors
Use conditional retries: Only retry errors that have a chance of succeeding on retry
Include context in errors: Use descriptive error messages with relevant details
Log error details: Log sufficient context for debugging
Use appropriate error status codes: Match HTTP status codes to semantics
Define custom error types: Create domain-specific error types for your application
Organize errors hierarchically: Use consistent type URIs that reflect hierarchy
Run the Examples
Every example on this page is a complete workflow. Complete the SQLite setup, save each example under the file name used below, and run the commands from the setup directory. With the JAR, substitute java -jar lemline.jar for bin/lemline.
Start the tutorial shop from the root of the Lemline source checkout:
Keep the setup worker running and use a second terminal in the setup directory.
Example | Expected result |
|---|---|
| Faults with |
| After 5 to 15 seconds, |
|
|
| The stock after one retry: the HTTP 503 has status 503, so |
Stop the shop when you are done: