Skip to content

Celery redis setup and Jobs endpoint#574

Open
chetanr25 wants to merge 7 commits into
fireform-core:developmentfrom
chetanr25:celery_redis_setup
Open

Celery redis setup and Jobs endpoint#574
chetanr25 wants to merge 7 commits into
fireform-core:developmentfrom
chetanr25:celery_redis_setup

Conversation

@chetanr25

@chetanr25 chetanr25 commented Jun 20, 2026

Copy link
Copy Markdown
Collaborator

Add async background workers with Celery + Redis

Summary

  • Added Celery + Redis as the task queue system for async PDF form generation
  • Implemented universal GET /api/v1/jobs/{job_id} endpoint for polling any async job status, as defined in the API contract (contracts/path/jobs.yaml)
  • Job model aligned with contracts/schemas/common.yaml#/Job:
    • UUID-based job_id
    • job_type enum (form_generation, extensible to transcription, extraction, report_generation)
    • progress_percent (0-100)
    • result_url pointing to API download path
    • Structured error object (error_code + message)
    • Status flow: queued -> processing -> completed / failed
  • Added redis (broker) and celery-worker services to Docker Compose
  • Celery task (fill_form_task) updates job progress and status on each transition
  • Added necessary tests

Fix: #498
Part of: #541

@chetanr25 chetanr25 changed the title [WIP] Celery redis setup Celery redis setup and Jobs endpoint Jun 21, 2026
@chetanr25 chetanr25 marked this pull request as ready for review June 21, 2026 12:30
@chetanr25 chetanr25 force-pushed the celery_redis_setup branch from 8278c4b to 0e51886 Compare June 21, 2026 12:53
@chetanr25 chetanr25 force-pushed the celery_redis_setup branch from 0e51886 to 60e1ce5 Compare June 21, 2026 13:01

@marcvergees marcvergees left a comment

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

In general looks good to me, but I wanna be given answers of my questions before merging it.

Comment thread app/api/router.py
api_router.include_router(templates.router)
api_router.include_router(forms.router)
api_router.include_router(v1_router)
api_router.include_router(jobs.router) No newline at end of file

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Shouldn't it be inside the v1_router? I.e. the endpoints shouldn't in be inside the v1 folder? Like Abhi did in his PR?

Comment thread app/tasks/fill.py
raise RuntimeError(f"No job row for celery task {self.request.id}")

job.status = "processing"
job.progress_percent = 10

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This value hardcoded is to know that the task is already being processed so that you had to change the progress_percent to smthg bigger than 0?

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

[FEAT]: Enable parallel form submission with background worker and queue

2 participants