Dead Letter Queue API Enhancements
Summary
Added proper request/response schema objects for the DeadLetterQueue requeue and discard operations in the ValkyrAI Workflow Engine v2.0 API specification.
Changes Made
1. New Schema Components
Added four new schema components to api.hbs.yaml:
RequeueDeadLetterEntryRequest
- Purpose: Request object for requeuing a DLQ entry with optional input overrides
- Properties:
inputOverrides(object, optional): JSON map of input overrides to merge with original inputs for replaynotes(string, optional, max 2000 chars): Operator notes about the requeue operation
RequeueDeadLetterEntryResponse
- Purpose: Response object after successfully requeuing a DLQ entry
- Properties:
newRunId(UUID, required): ID of the newly created Runmessage(string, required): Success messagedlqId(UUID): ID of the DeadLetterQueue entry that was requeuedtimestamp(date-time): Timestamp when the entry was requeued
DiscardDeadLetterEntryRequest
- Purpose: Request object for discarding a DLQ entry permanently
- Properties:
notes(string, required, max 2000 chars): Operator notes explaining why the entry was discardedreason(enum, optional): Categorized reason for discardingDUPLICATEINVALID_DATANO_LONGER_RELEVANTFIXED_MANUALLYOTHER
DiscardDeadLetterEntryResponse
- Purpose: Response object after successfully discarding a DLQ entry
- Properties:
message(string, required): Success messagedlqId(UUID): ID of the DeadLetterQueue entry that was discardedtimestamp(date-time): Timestamp when the entry was discarded
2. Endpoint Updates
/DeadLetterQueue/{id}/requeue (POST)
- Request Body: Now uses
RequeueDeadLetterEntryRequestschema - 200 Response: Now uses
RequeueDeadLetterEntryResponseschema - Updated Description: "Optional input overrides and notes for replay"
/DeadLetterQueue/{id}/discard (POST)
- Request Body: Now uses
DiscardDeadLetterEntryRequestschema (changed from optional to required) - 200 Response: Now uses
DiscardDeadLetterEntryResponseschema - Updated Description: "Notes and reason about why entry was discarded"
Benefits
- Type Safety: Generated Java classes and TypeScript clients will have proper typed objects instead of generic maps
- Validation: Schema-based validation for request/response payloads
- Documentation: Clear, structured API documentation via OpenAPI tooling
- Maintainability: Centralized schema definitions make updates easier
- Developer Experience: Better IDE autocomplete and type checking in client code
Next Steps
After regeneration via ThorAPI:
- Generated Java classes will appear in
generated/model/:RequeueDeadLetterEntryRequest.javaRequeueDeadLetterEntryResponse.javaDiscardDeadLetterEntryRequest.javaDiscardDeadLetterEntryResponse.java
- Controller methods will be updated to use these types
- TypeScript clients in
web/typescript/backend/api/will include these types - Update business logic in
DeadLetterQueueServiceto construct proper response objects
File Modified
/Users/johnmcmahon/workspace/2025/valkyr/ValkyrAI/valkyrai/src/main/resources/openapi/api.hbs.yaml
Lines Added
- Approximately 125 lines of new schema definitions
- 2 endpoint definitions updated with proper schema references