How moatazrabaya/webhook-driven-task-processing-pipeline works
This is a webhook-driven task-processing backend. Users configure pipelines and subscribers, send events using a pipeline source key, and later inspect jobs and delivery attempts. Webhook requests create persisted jobs; a separate worker claims pending jobs, dispatches FILTER, EXTRACT, or TRANSFORM processing, updates job state, and invokes subscriber delivery with retries. The graph preserves the documented stages and major API capabilities. Some route and worker wiring is supported by the source index; unsampled subsystem internals are not inferred beyond those references.
Main entry points: jobProcessingService.ts Job Processing · deliveryService.ts Delivery and Retries · jobService.ts Job Service · pipelines.ts Pipeline Queries
Components 23
HTTP API
- Pipeline Routes
src/routes/pipelines.ts - Pipeline Handler
src/handlers/pipelineHandler.ts - Webhook Routes
src/routes/webhooks.ts - Webhook Handler
src/handlers/webhookHandler.ts - Job Routes
src/routes/jobs.ts - Job Handler
src/handlers/jobHandler.ts
Pipeline Management
- Pipeline Service
src/services/pipelineService.ts - Subscriber Service
src/services/subscriberService.ts
Async Processing
- Job Service
src/services/jobService.ts - Background Worker
src/worker/worker.ts - Job Processing
src/services/jobProcessingService.ts - Filter Action
src/processors/filter.ts - Extract Action
src/processors/extract.ts - Transform Action
src/processors/transform.ts
Persistence and Delivery
- Delivery and Retries
src/services/deliveryService.ts - Pipeline Queries
src/db/queries/pipelines.ts - Job Queries
src/db/queries/jobs.ts - Subscriber Queries
src/db/queries/subscribers.ts - Attempt Queries
src/db/queries/deliveryAttempts.ts - PostgreSQL
src/db/schema.ts
Other components
- Pipeline User
- Webhook Sender
- Subscriber Endpoints
Connections 28
- Pipeline User → Pipeline Routes: configures pipeline
README.md - Pipeline Routes → Pipeline Handler: routes requests
src/routes/pipelines.ts - Pipeline Handler → Pipeline Service: calls
src/handlers/pipelineHandler.ts - Pipeline Service → Pipeline Queries: creates and reads
src/services/pipelineService.ts - Pipeline Service → Subscriber Service: creates subscribers
src/services/pipelineService.ts - Subscriber Service → Subscriber Queries: persists subscribers
src/services/subscriberService.ts - Webhook Sender → Webhook Routes: sends event
README.md - Webhook Routes → Webhook Handler: routes requests
src/routes/webhooks.ts - Webhook Handler → Job Service: creates job
src/handlers/webhookHandler.ts - Job Service → Pipeline Queries: looks up source key
src/services/jobService.ts - Job Service → Job Queries: persists job
src/services/jobService.ts - Background Worker → Job Queries: claims pending job
src/worker/worker.ts - Background Worker → Job Processing: processes job
src/worker/worker.ts - Job Processing → Pipeline Queries: loads pipeline
src/services/jobProcessingService.ts - Job Processing → Job Queries: updates status and result
src/services/jobProcessingService.ts - Job Processing → Filter Action: dispatches FILTER
src/services/jobProcessingService.ts - Job Processing → Extract Action: dispatches EXTRACT
src/services/jobProcessingService.ts - Job Processing → Transform Action: dispatches TRANSFORM
src/services/jobProcessingService.ts - Job Processing → Delivery and Retries: delivers result
src/services/jobProcessingService.ts - Delivery and Retries → Subscriber Queries: loads destinations
src/services/deliveryService.ts - Delivery and Retries → Attempt Queries: records attempts
src/services/deliveryService.ts - Delivery and Retries → Subscriber Endpoints: posts with retries
README.md - Job Routes → Job Handler: routes requests
src/routes/jobs.ts - Job Handler → Job Service: reads jobs and attempts
src/handlers/jobHandler.ts - Pipeline Queries → PostgreSQL: reads and writes
src/db/queries/pipelines.ts - Job Queries → PostgreSQL: reads and writes
src/db/queries/jobs.ts - Subscriber Queries → PostgreSQL: reads and writes
src/db/queries/subscribers.ts - Attempt Queries → PostgreSQL: records and reads attempts
src/services/deliveryService.ts