Skip to content

FastAPI Example Walkthrough

The examples/fastapi package demonstrates API-layer orchestration with:

  • MongoJournal for run state
  • MinioArchive for artifact/object handling
  • CeleryLanguage for workflow dispatch

Lifespan Initialization

At startup, the app:

  1. builds journal/archive/language
  2. registers grammars for worker tasks
  3. starts language service (speak(block=False))
  4. 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

  1. Start Redis/Mongo/MinIO (if used)
  2. Launch worker processes (lingo launch or lingo launch-all)
  3. Start FastAPI app
  4. 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.