Skip to content

Async job infrastructure - API Contracts #545

@chetanr25

Description

@chetanr25

Async job infrastructure

Part of #541

Depends on: Common schemas (#543 ), DB models (#544), Celery infra (#498)

Contract reference

What needs to happen

Multiple operations in FireForm are async: voice transcription, LLM extraction, form generation, report generation. All of them need a way to queue work, track progress, and let the client poll for status.

Celery setup

  • Add Redis container (broker) and Celery worker container to docker-compose.yml
  • Celery app configuration in the backend
  • Base task class that auto-creates/updates Job records in DB on state transitions (queued -> processing -> completed/failed)

Job service

  • create_job(job_type) - creates a Job record, returns job_id
  • update_job(job_id, status, progress_percent, result_url, error) - updates job state
  • get_job(job_id) - returns current job state

Endpoint

GET /api/v1/jobs/{job_id} - Universal job status polling endpoint. Returns status, progress percentage, and result_url when completed. See path/jobs.yaml for all response examples (queued, processing, completed, failed).

Metadata

Metadata

Assignees

Labels

No labels
No labels

Type

No type
No fields configured for issues without a type.

Projects

Status
Week X Done

Milestone

No milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions