Skip to content

About

No description, website, or topics provided.

Resources

Stars

0 stars

Watchers

0 watching

Forks

Latest commit

 

History

5 Commits

Folders and files

NameName
Last commit message
Last commit date
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

Workflow Orchestrator API

I built this API to practise receiving workflow events, storing them, and tracking their status through a small REST interface.

It uses FastAPI with SQLAlchemy and SQLite. The current event lifecycle has three statuses: queued, processed, and failed.

Features in the code

  • Create an event with POST /events.
  • List stored events with GET /events.
  • Update an event status with PATCH /events/{event_id}.
  • Store event records in a local SQLite database.
  • Serve a browser interface at /ui.
  • Expose interactive API documentation through FastAPI at /docs.

Technology

  • Python
  • FastAPI
  • Pydantic
  • SQLAlchemy
  • SQLite

Run locally

On Windows PowerShell:

python -m venv .venv
.\.venv\Scripts\Activate.ps1
python -m pip install -r requirements.txt
uvicorn app.main:app --reload --port 8001

Open the local API documentation at http://127.0.0.1:8001/docs or the interface at http://127.0.0.1:8001/ui.

API examples

Create an event:

POST /events
Content-Type: application/json
{
  "source": "n8n",
  "event_type": "order.created"
}

Update its status:

PATCH /events/1
Content-Type: application/json
{
  "status": "processed"
}

The available status values are queued, processed, and failed.

Development status

The API routes and SQLite persistence are present in the source. This README does not claim that the application has passed tests or been deployed; those checks still need to be run and recorded.

Next improvements

  • Add automated tests for event creation, listing, and status updates.
  • Add validation for allowed status transitions.
  • Add retry handling and a dead-letter strategy for failed events.
  • Add authentication before exposing the API outside a local environment.

Author

Afzal Hussain · @Afzu01

About

No description, website, or topics provided.

Resources

Stars

0 stars

Watchers

0 watching

Forks

Releases

Packages

Contributors

Languages