Execution order
- Webhook lands in the app route.
- The raw GitHub payload is pushed to
unprocessedWebhookPayload. sanitizePayload.worker.tsreads that queue, strips the payload down to the fields we need, and pushes the cleaned object tosanitizedPrPayload.extractContents.worker.tsreadssanitizedPrPayload, fetches patch, issue, comments, commits, and review comments, then pushes the full extracted content toextractedPrContent.agenticReview.worker.tsreadsextractedPrContent, runs the AI review, and sends the final result toreviewNotification.notification.worker.tsis reserved for V2 and is currently not active.- If a job fails after retries, it is sent to
deadLetter.
Queue config
- Redis connection is shared via
connectioninbackend/src/config/queue.ts. - Each queue is created with BullMQ
Queue(...). - Default job settings are consistent across queues:
attempts: 3- exponential backoff with
delay: 1000 removeOnComplete: true
- Main queues:
unprocessedWebhookPayloadsanitizedPrPayloadextractedPrContentreviewNotificationstateLogdeadLetter
Flow
Short notes
stateLogis used for state tracking.deadLetteracts as the fallback queue for failed jobs after retry limits are reached.- Worker startup is triggered in
backend/src/server.tsby importing the worker files at boot time. notification.worker.tsis intentionally deferred for now. GitHub already handles native PR comment notifications, and this worker will be used in V2 for channels such as Slack and Microsoft Teams.