sphinx-tribes
sphinx-tribes copied to clipboard
new endpoint /workflows/request
Context
Create the entry point endpoint for all Stakwork workflow requests. This endpoint will receive requests from various features, validate them, and store them in the database.
- Problem: There is currently no common reusable mechanism to handle and log incoming workflow requests from the front end.
- Need: A dedicated endpoint is required to capture and store these requests in the database for tracking and processing.
- System Fit: This endpoint is part of the larger "Stakwork Common Workflow Plumbing" feature, which aims to streamline workflow request and response handling.
- Background: This is the second step in a series of tasks designed to implement a robust workflow management system. The first step involved creating the
wf_requestsdatabase table.
This is related to a broader project defined here: For context see: https://github.com/stakwork/sphinx-tribes/issues/1922
System Schematic:
Design
- Endpoint:
/workflows/request - HTTP Method: POST
- Request Payload: JSON object containing workflow request details.
- Example:
{ "request_id": "string", "workflow_type": "string", "payload": "object" }
- Example:
- Database Interaction: Insert the request data into the
wf_requeststable. - Lookup Processing Actions: Stub out this function and just carry on as though a look up was
- Error Handling: Return appropriate error messages for invalid data or database failures.
Task Breakdown:
- [x] #1937
- [x] #1938
- [x] #1939
- [x] #1940
Assignment Criteria
- Required Knowledge/Skills:
- Proficiency in RESTful API development
- Experience with database operations (SQL)
- Familiarity with JSON data structures
- Communication: Ensure you are live on Sphinx V2 for any queries or discussions.
Acceptance Criteria
- [ ] The
/workflows/requestendpoint accepts POST requests with valid JSON payloads. - [ ] The request data is successfully inserted into the
wf_requeststable. - [ ] A success response is returned with the request ID.
- [ ] Appropriate error responses are returned for invalid requests or database errors.
- [ ] The endpoint is secured with token-based authentication (to be implemented in a subsequent ticket).
@humansinstitute Please assign me
@humansinstitute, assign me?
@humansinstitute Could you please assign me?
This would be blocked until this ticket is merged to allow access to the wf_requests table: https://github.com/stakwork/sphinx-tribes/issues/1925