Back to search

What are background tasks in FastAPI?

Background tasks run lightweight follow-up work after sending the HTTP response.

FastAPI Medium Theory

What are background tasks in FastAPI?

Background tasks run lightweight follow-up work after sending the HTTP response.

  • Good for email or audit logs
  • Still runs in same process
  • Not a replacement for a job queue

What are background tasks in FastAPI?