A production-ready system that transforms HubSpot events into reliable, auditable internal workflows with human oversight where needed.
The HubSpot Operations Orchestrator is an intelligent automation platform that bridges HubSpot CRM events with internal business processes. It provides:
- Event-Driven Automation: Automatically triggers workflows based on HubSpot events
- Human-in-the-Loop Oversight: Requires approvals for critical business decisions
- Exception Handling: Manages data quality issues and integration errors
- Audit Trail: Maintains complete lineage of all operations for compliance
- Policy Enforcement: Ensures business rules are consistently applied
- LangGraph stateful workflows with Redis checkpointing
- Human-in-the-loop interruptions for approvals
- Automatic data enrichment and validation
- Integration with external systems (Airtable, Notion, Google Workspace)
- KPI monitoring and workflow visualization
- Pending approvals queue with policy context
- Exception management with one-click fixes
- Run history and audit trails
- Role-based access control (Admin, Operator, Viewer)
- JWT-based authentication
- Complete audit logging
- Policy snapshots for compliance
- HubSpot webhook ingestion with signature verification
- Event deduplication and correlation
- Queue-based processing with Redis
- Replay and recovery capabilities
┌─────────────────┐ ┌──────────────────┐ ┌──────────────────┐
│ HubSpot CRM │───▶│ Webhook Events │───▶│ Event Envelopes │
└─────────────────┘ └──────────────────┘ └──────────────────┘
│
▼
┌──────────────────┐
│ Redis Queue │
└──────────────────┘
│
▼
┌──────────────────┐ ┌──────────────────┐
│ Inngest Engine │───▶│ LangGraph Workers│
└──────────────────┘ └──────────────────┘
│ │
▼ ▼
┌──────────────────┐ ┌──────────────────┐
│ SQLite Database │ │External Services │
└──────────────────┘ └──────────────────┘
│
▼
┌──────────────────┐
│ Edge Functions │
└──────────────────┘
│
▼
┌──────────────────┐
│ Frontend UI │
└──────────────────┘
- React 18 with TypeScript
- Hono.js for Cloudflare Workers
- TailwindCSS for styling
- ShadCN UI components
- Prisma ORM for database operations
- Python 3.11+ with FastAPI
- LangGraph for workflow orchestration
- Redis for checkpointing and queuing
- Inngest for durable execution
- LangChain for AI integrations
- SQLite with Prisma ORM
- Cloudflare D1 (production)
- Node.js 18+
- Python 3.11+
- Docker (for development)
- Cloudflare account (for deployment)
-
Clone the repository:
git clone https://github.com/your-org/hubspot-orchestrator.git cd hubspot-orchestrator -
Install frontend dependencies:
cd frontend pnpm install -
Install backend dependencies:
cd backend python -m venv .venv source .venv/bin/activate pip install -r requirements.txt
-
Set up environment variables:
# Copy and configure .env files cp frontend/.env.example frontend/.env cp backend/.env.example backend/.env
-
Start the frontend:
cd frontend pnpm dev -
Start the backend:
cd backend source .venv/bin/activate uvicorn app.main:app --reload
-
Run database migrations:
cd frontend pnpm db:migrate pnpm db:seed
# Frontend tests
cd frontend
pnpm test
# Backend tests
cd backend
pytest
# End-to-end tests
cd frontend
pnpm test:e2ecd frontend
pnpm build
pnpm deploycd backend
# Deploy with your preferred platform (AWS, GCP, Azure, etc.)Frontend (.env):
# Cloudflare
CLOUDFLARE_API_TOKEN=your_cloudflare_api_token
CLOUDFLARE_ACCOUNT_ID=your_cloudflare_account_id
# Database
DATABASE_URL=your_database_url
# Authentication
JWT_SECRET=your_jwt_secretBackend (.env):
# HubSpot
HUBSPOT_WEBHOOK_SECRET=your_webhook_secret
HUBSPOT_ACCESS_TOKEN=your_access_token
# Redis
REDIS_URL=your_redis_url
# OpenAI
OPENAI_API_KEY=your_openai_api_key
# Inngest
INNGEST_EVENT_KEY=your_inngest_event_key
INNGEST_SIGNING_KEY=your_inngest_signing_keyTriggers when a new company is created or updated in HubSpot:
- Normalizes company data with AI enrichment
- Upserts to Airtable "Accounts" base
- Attaches Notion SOP for the company type
- Schedules internal kickoff if lifecycle rules match
Triggers when a contact is created or updated:
- Infers role from job title using AI
- Seeds internal permission checklists
- Attaches relevant Google Drive templates
- Links to associated account
Triggers when a deal enters a configured stage:
- Proposes internal meeting time slots
- Waits for human approval via AGUI
- Creates calendar event in Google Calendar
- Links artifacts to Airtable and Notion
Triggers when a deal crosses a monetary threshold:
- Creates procurement record in ops tool
- Waits for admin approval via AGUI with policy snapshot
- Creates internal purchase order after approval
- Tracks spend against budget
POST /webhooks/hubspot- Receive HubSpot webhooks
GET /api/runs- List workflow runsGET /api/runs/:id- Get specific run details
GET /api/approvals/pending- List pending approvalsPATCH /api/approvals/:id/decision- Approve/reject approval
GET /api/exceptions/open- List open exceptionsPATCH /api/exceptions/:id/resolve- Resolve exception
Structured logging throughout the application with:
- Request tracing with correlation IDs
- Error tracking with stack traces
- Performance metrics
- Audit trails for compliance
/healthendpoint for service status- Database connectivity verification
- External service health monitoring
- Workflow execution rates
- Approval turnaround times
- Exception resolution rates
- System resource utilization
- Fork the repository
- Create your feature branch (
git checkout -b feature/AmazingFeature) - Commit your changes (
git commit -m 'Add some AmazingFeature') - Push to the branch (
git push origin feature/AmazingFeature) - Open a pull request
This project is licensed under the MIT License - see the LICENSE file for details.
For support, please open an issue on GitHub or contact the maintainers.