sphinx-tribes icon indicating copy to clipboard operation
sphinx-tribes copied to clipboard

new endpoint /workflows/request

Open humansinstitute opened this issue 1 year ago • 4 comments

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_requests database table.

This is related to a broader project defined here: For context see: https://github.com/stakwork/sphinx-tribes/issues/1922

System Schematic:

Image

Design

  • Endpoint: /workflows/request
  • HTTP Method: POST
  • Request Payload: JSON object containing workflow request details.
    • Example:
      {
        "request_id": "string",
        "workflow_type": "string",
        "payload": "object"
      }
      
  • Database Interaction: Insert the request data into the wf_requests table.
  • 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.

Image

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/request endpoint accepts POST requests with valid JSON payloads.
  • [ ] The request data is successfully inserted into the wf_requests table.
  • [ ] 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 avatar Nov 11 '24 02:11 humansinstitute

@humansinstitute Please assign me

aliraza556 avatar Nov 11 '24 02:11 aliraza556

@humansinstitute, assign me?

MirzaHanan avatar Nov 11 '24 02:11 MirzaHanan

@humansinstitute Could you please assign me?

MahtabBukhari avatar Nov 11 '24 02:11 MahtabBukhari

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

humansinstitute avatar Nov 11 '24 04:11 humansinstitute