The API process runs the Orchestrator's BullMQ processors. Redis stores the queue state; PostgreSQL remains the source of truth for balances, payouts, escrows, and audit records. The queue names and job types below are taken from apps/api/src/modules/queues/queue.constants.ts, queue.module.ts, and queue.service.ts in the OFFER-HUB Orchestrator.
Queues
The retry values are queue defaults in apps/api/src/modules/queues/queue.module.ts. A processor may still record a failure before the job is moved to the DLQ.
Reconciliation schedules
QueueService.onModuleInit() installs these repeatable jobs in Redis. Each run processes a bounded batch and records metrics for processed, synced, failed, and discrepant records.
Top-up and withdrawal reconciliation are skipped in crypto-only mode because they depend on AirTM. Escrow reconciliation continues to verify Trustless Work state. The missed-deposit job is the one schedule controlled by RECONCILIATION_ENABLED.
Blockchain monitor
BlockchainMonitorService opens a Horizon payment stream for each active invisible wallet and credits matching USDC deposits. It starts with the API module, reconnects through the Horizon SDK after stream errors, and closes all streams during shutdown. Set DISABLE_BLOCKCHAIN_MONITOR=true on a secondary API instance when only one instance should consume deposit streams.
Configuration
These values are read at runtime. Restart the API after changing them so queue schedules and the blockchain monitor are initialized with the new configuration.
Inspecting failed jobs and the DLQ
The queue service exposes queue counts and repeatable-job metadata for operational tooling. For a direct Redis check in a Docker deployment:
# Queue keys and waiting jobsdocker compose exec redis redis-cli keys "bull:*"docker compose exec redis redis-cli llen "bull:webhooks:wait" # Failed jobs in a queue (inspect the JSON before retrying)docker compose exec redis redis-cli lrange "bull:reconciliation:failed" 0 20
The QueueService methods getQueueStats(), getDlqJobs(), and retryFromDlq() are the supported application-level operations. DLQ jobs are not automatically processed: inspect the original queue, job name, payload, error, and attempt count, correct the provider or data problem, then retry deliberately. Do not delete a failed job before preserving its audit context.
- Configuration — runtime environment variables.
- Self-Hosting — Redis, Docker, and production operations.
- Orchestrator — request and payment flow.
- Webhooks — provider event delivery and duplicate handling.