Skip to main content

Workflow API Error Handling

Summary

A lightweight result type and one translator provide the main API error pattern.

Typed application results

  • Validation failures become bad-request results with a message object.
  • Missing resources become not-found results with a message object.
  • State/duplicate/key conflicts become conflict results with a message object.
  • Successful results become standard success or endpoint-selected created results.

Direct endpoint errors

Definition and instance detail handlers create their own message-shaped not-found responses.

Tenant errors

A middleware catches tenant-related invalid-operation exceptions, writes a bad-request status and serializes a message object.

Framework behavior

Route mismatch, binding errors and unhandled exceptions do not have a Workflow-specific error contract in reviewed source.

Limitations

No problem-details standard, error code, validation field map, global exception handler or persistence-exception translation exists.

Requires Confirmation

Public error schema, correlation exposure, logging of failures and persistence error normalization require confirmation.

Source References

  • microservices/src/workflow-service/Api/EndpointResults.cs
  • microservices/src/workflow-service/Application/Common/Cqrs.cs
  • microservices/src/workflow-service/Program.cs
  • microservices/src/workflow-service/Api/WorkflowEndpoints.cs

See Also

Keywords

Workflow API, approval endpoint, Workflow Service.

Revision Information

  • Status: Draft
  • Last reviewed: 2026-07-20
  • Next review: 2026-10-20