FastAPI Example Walkthrough
The examples/fastapi package demonstrates API-layer orchestration with:
MongoJournalfor run stateMinioArchivefor artifact/object handlingCeleryLanguagefor workflow dispatch
Lifespan Initialization
At startup, the app:
- builds journal/archive/language
- registers grammars for worker tasks
- starts language service (
speak(block=False)) - exposes dependencies through app state
Endpoint Families
- Admin endpoints (
/admin/*) for search, restart/requeue, and active monitoring - Job endpoints (
/job/*) for status, result, and cancellation - Start endpoints for standard/compare/plot/flaky workflows
Typical Local Run Sequence
- Start Redis/Mongo/MinIO (if used)
- Launch worker processes (
lingo launchorlingo launch-all) - Start FastAPI app
- Submit jobs and query status/progress
Why This Example Matters
It documents the intended boundary between API concerns and orchestration concerns, and provides concrete request/response models for downstream integrations.