How marahamj/client-onboarding-pipeline- works
This is a CRM-triggered client-onboarding backend: a Deal Won webhook creates a client/onboarding record and seven persisted steps, which can then be run or resumed through the API. The orchestrator claims each step, invokes a mock provider with retries, and records success or failure for recovery. A Streamlit dashboard monitors onboardings and the dead-letter queue through the API. Provider integrations are mocked; relationships below are based on the README and excerpted source, not unsampled implementation.
Main entry points: orchestrator.py Step orchestrator · main.py FastAPI endpoints · models.py PostgreSQL state · idempotency.py Step claiming
Components 12
API and intake
- FastAPI endpoints
app/main.py - Webhook schemas
app/schemas.py
Workflow execution
- Seven-step onboarding
app/constants.py - Step orchestrator
app/services/orchestrator.py - Retry policy
app/services/orchestrator.py - Mock provider
app/services/mock_provider.py
Persistence and recovery
- Step claiming
app/services/idempotency.py - PostgreSQL state
app/models.py - Dead-letter handling
app/services/dlq_service.py - Supervisor logging
app/services/alerting.py
Monitoring
- Streamlit dashboard
dashboard/app.py
Other components
- CRM deal event
Connections 15
- CRM deal event → FastAPI endpoints: sends webhook
README.md - FastAPI endpoints → Webhook schemas: validates payload
app/main.py - FastAPI endpoints → PostgreSQL state: creates and reads
app/main.py - FastAPI endpoints → Step orchestrator: starts or runs
app/main.py - Step orchestrator → Seven-step onboarding: iterates steps
app/services/orchestrator.py - Step orchestrator → Step claiming: claims and updates
app/services/orchestrator.py - Step orchestrator → Retry policy: executes with retries
app/services/orchestrator.py - Retry policy → Mock provider: calls provider
app/services/orchestrator.py - Step orchestrator → Mock provider: receives result
app/services/orchestrator.py - Step claiming → PostgreSQL state: locks and persists
app/services/idempotency.py - Step orchestrator → PostgreSQL state: reads and updates
app/services/orchestrator.py - Step orchestrator → Dead-letter handling: records or resolves
app/services/orchestrator.py - Dead-letter handling → PostgreSQL state: persists events
app/services/dlq_service.py - Step orchestrator → Supervisor logging: logs failure alert
app/services/orchestrator.py - Streamlit dashboard → FastAPI endpoints: requests status
dashboard/app.py