Turn conversations into customers with AI-powered multi-channel automation
Conduit automatically manages your leads across WhatsApp, Email, Voice, LinkedIn, and Ads with intelligent AI responses that feel human.
Think of Conduit as your 24/7 sales assistant that never sleeps.
🎯 Captures leads from anywhere - your website, ads, social media
💬 Responds instantly with personalized AI messages
🔄 Follows up automatically across multiple channels
📊 Tracks everything so you know what's working
graph LR
A[🌐 Lead comes in] --> B[🤖 AI analyzes]
B --> C[💬 Smart reply sent]
C --> D[📱 Multi-channel follow-up]
D --> E[💰 Conversion]
Get up and running in 5 minutes:
- Sign up at supabase.com (takes 30 seconds)
- Create a new project and wait 2 minutes for setup
git clone <your-repo>
cd conduit
npm installnpm run setupFollow the prompts - it'll guide you through everything!
# Terminal 1 - API Server
npm run dev
# Terminal 2 - AI Workers
npm run worker🎉 That's it! Your automation engine is running at http://localhost:3000
Let's create your first automated conversation:
curl -X POST http://localhost:3000/lead \
-H "Content-Type: application/json" \
-d '{"name":"Jane Doe","email":"jane@example.com"}'curl -X POST http://localhost:3000/send \
-H "Content-Type: application/json" \
-d '{"lead_id":"YOUR_LEAD_ID","channel":"email","content":"Hi Jane, welcome!"}'curl -X POST http://localhost:3000/reply \
-H "Content-Type: application/json" \
-d '{"lead_id":"YOUR_LEAD_ID","channel":"email","content":"Tell me more!"}'curl -X POST http://localhost:3000/ai/reply \
-H "Content-Type: application/json" \
-d '{"lead_id":"YOUR_LEAD_ID","channel":"email"}'curl http://localhost:3000/lead/YOUR_LEAD_ID💡 Pro tip: Use our Postman collection for a visual interface, and Postman guide on how to import the collection.
Built with modern, reliable tech:
- 🔥 Node.js + TypeScript - Fast and type-safe
- 🗄️ Supabase - Serverless PostgreSQL database
- 🤖 OpenAI - Intelligent AI responses$$
- ⚡ Express.js - Lightweight web framework
- 🔄 PGBoss Queue - Reliable background processing
No Docker needed! Everything runs on cloud services.
Keep track of your automation with built-in dashboards:
# View active jobs
GET /admin/jobs?status=active
# Get performance stats
GET /admin/jobs/stats
# See what's working
GET /lead/:idScale when you're ready:
- ✅ Horizontally scalable - Add more workers as you grow
- ✅ Built-in retries - Never lose a message
- ✅ Complete audit trail - See every interaction
- ✅ Multi-channel ready - WhatsApp, Email, Voice, LinkedIn, Ads
Deploy anywhere: Vercel, Railway, AWS, or your favorite platform.
- 📚 Check out the detailed docs
- 🐛 Found a bug? Open an issue
- 💬 Have questions? Let's chat!
Multi-channel automation with AI-powered responses.
Conduit routes leads through multiple messaging channels (WhatsApp, Email, Voice, LinkedIn, Ads) and communicates with automated AI replies.
See the full architecture documentation
- PostgreSQL-based Queue (pg-boss): No Redis needed, uses Supabase PostgreSQL for queue storage
- Separate API & Workers: API enqueues jobs, workers process them asynchronously
- Channel Abstraction: Generic message interface makes adding new channels trivial
- Event Sourcing: Complete audit trail via events table
- Retry Logic: Built-in exponential backoff for failed jobs
- Runtime: Node.js 18+ with TypeScript
- API: Express.js
- Database: Supabase (PostgreSQL)
- Queue: pg-boss (PostgreSQL-based)
- AI: OpenAI API (optional, mocked if not configured)
- Validation: Zod
- Logging: Pino
conduit/
├── src/
│ ├── index.ts # Server setup & bootstrapping
│ ├── routes/ # API route definitions
│ │ ├── index.ts # Route aggregator
│ │ ├── health.ts # Health check endpoints
│ │ ├── leads.ts # Lead management routes
│ │ └── admin.ts # Admin/monitoring endpoints
│ ├── controllers/ # Request/response handling
│ │ └── LeadController.ts
│ ├── middleware/ # Express middleware
│ │ ├── requestLogger.ts
│ │ └── errorHandler.ts
│ ├── services/ # Business logic
│ │ ├── LeadService.ts
│ │ ├── MessageService.ts
│ │ ├── AIService.ts
│ │ └── EventService.ts
│ ├── workers/ # Queue job processors
│ ├── queues/ # Queue setup and helpers
│ ├── utils/ # Config, logger, Supabase client
│ └── types/ # TypeScript interfaces
├── migrations/ # Database schema
├── docs/ # Architecture & documentation
├── scripts/ # Setup & utility scripts
├── package.json
├── tsconfig.json
└── .env.example
Architecture: Clean MVC pattern with middleware
- Routes: Define URL patterns and mount to controllers
- Controllers: Handle HTTP request/response logic
- Middleware: Request logging, error handling, validation
- Services: Contain business logic (database, queue operations)
- Workers: Process background jobs asynchronously
- Node.js 18+ and npm
- Supabase account (free tier works)
- Go to supabase.com and create a new project
- Wait for database to be provisioned (~2 minutes)
- Get credentials from Project Settings:
- API URL
- Anon key
- Service role key
- Database connection string (Settings -> Database -> Connection String -> URI)
git clone <your-repo>
cd conduit
npm installOption A: Interactive Setup (Recommended)
npm run setupThis will guide you through setting up your .env file step by step.
Option B: Manual Setup
cp .env.example .env
# Edit .env with your Supabase credentialsRequired environment variables:
SUPABASE_URL=https://your-project.supabase.co
SUPABASE_ANON_KEY=your-anon-key
SUPABASE_SERVICE_ROLE_KEY=your-service-role-key
DATABASE_URL=postgresql://postgres:[password]@db.your-project.supabase.co:5432/postgres
Optional:
OPENAI_API_KEY=sk-your-key # Uses mocked service anyways
Getting your credentials:
- Go to your Supabase project dashboard
- Settings -> API: Get URL, Anon Key, Service Role Key
- Settings -> Database -> Connection String:
- Recommended: Use "Session pooler" connection string (port 6543)
- This has the password already URL-encoded
- Avoids issues with special characters in password
This checks for special characters and provides fix suggestions.
In Supabase Studio (your project dashboard):
- Go to SQL Editor
- Open
migrations/001_initial_schema.sql - Paste and run the entire file
This creates:
leads,messages,jobs,eventstables- Indexes for performance
- pg-boss will auto-create its own tables on first run
Terminal 1 - API Server:
npm run devServer runs on http://localhost:3000
Terminal 2 - Queue Workers:
npm run workerBoth processes are required for full functionality.
POST /lead
Content-Type: application/json
{
"name": "John Doe",
"email": "john@example.com",
"phone": "+1234567890",
"metadata": {
"source": "website"
}
}Response:
{
"success": true,
"data": {
"id": "uuid",
"name": "John Doe",
"email": "john@example.com",
"status": "new",
"created_at": "2024-01-01T00:00:00Z"
}
}POST /send
Content-Type: application/json
{
"lead_id": "uuid",
"channel": "email",
"content": "Hi John, thanks for your interest!"
}Channels: email, whatsapp, voice, linkedin, ads
POST /reply
Content-Type: application/json
{
"lead_id": "uuid",
"channel": "email",
"content": "Yes, I'm interested in learning more"
}This updates lead status: new or contacted -> replied
POST /ai/reply
Content-Type: application/json
{
"lead_id": "uuid",
"channel": "email",
"context": "They asked about pricing"
}Generates AI response and queues it for sending. Updates status: replied -> engaged
GET /lead/:idReturns complete timeline:
{
"success": true,
"data": {
"lead": {
/* lead object */
},
"messages": [
/* all messages */
],
"jobs": [
/* all queue jobs */
],
"events": [
/* all events */
]
}
}A complete Postman collection is included with 11 pre-configured endpoints covering all API functionality:
- Health checks and monitoring
- Lead management
- Multi-channel messaging
- AI reply generation
- Admin and queue monitoring
- Complete workflow examples
Quick Start:
- Import
Conduit.postman_collection.jsoninto Postman - Start the API server (
npm run dev) - Start workers (
npm run worker) - Run the "Complete Flow Example" folder
For detailed setup instructions and usage examples, see the Postman Guide.
# 1. Create a lead
curl -X POST http://localhost:3000/lead \
-H "Content-Type: application/json" \
-d '{"name":"Jane Doe","email":"jane@example.com"}'
# Save the lead ID from response
# 2. Send a message
curl -X POST http://localhost:3000/send \
-H "Content-Type: application/json" \
-d '{
"lead_id":"YOUR_LEAD_ID",
"channel":"email",
"content":"Hi Jane, welcome!"
}'
# 3. Simulate reply
curl -X POST http://localhost:3000/reply \
-H "Content-Type: application/json" \
-d '{
"lead_id":"YOUR_LEAD_ID",
"channel":"email",
"content":"Thanks! Tell me more"
}'
# 4. Generate AI response
curl -X POST http://localhost:3000/ai/reply \
-H "Content-Type: application/json" \
-d '{
"lead_id":"YOUR_LEAD_ID",
"channel":"email"
}'
# 5. Check timeline
curl http://localhost:3000/lead/YOUR_LEAD_IDFor monitoring and debugging the queue system:
GET /admin/jobs?status=active&limit=50Query parameters:
status: Filter by job state (active, completed, failed, etc.)limit: Number of jobs to return (default: 50)
Returns job list and statistics.
GET /admin/jobs/statsReturns:
- Jobs by state (active, completed, failed, etc.)
- Jobs by name (send-message, generate-ai-reply)
- Recent failures with details
GET /admin/jobs/:idReturns complete job details including data and output.
new -> contacted -> replied -> engaged
- new: Lead created, no outbound messages sent
- contacted: First outbound message sent
- replied: Prospect has responded
- engaged: AI reply generated/sent
- Add channel type to
src/types/index.ts - Implement channel adapter in
MessageService.sendViaChannel() - Done! All endpoints automatically support new channel
- Horizontal scaling: Run multiple worker processes
- Queue concurrency: Adjust
teamSizein workers - Database: Supabase handles connection pooling
- Rate limits: pg-boss handles retry with exponential backoff
- Workflow builder (conditional logic, delays, A/B testing)
- Webhook management (dynamic webhook registration)
- Analytics dashboard (conversion rates, response times)
- Real-time notifications (WebSocket for live updates)
# Run in dev mode (auto-reload)
npm run dev
npm run worker
# Build for production
npm run build
npm start
# Type checking
npx tsc --noEmit- API Server: Deploy to Vercel, Railway, or AWS
- Workers: Deploy as separate service/container
- Environment: Set production DATABASE_URL with connection pooling
- Monitoring: Use Supabase logs + Pino structured logging
- No Docker required: Everything runs on Supabase
- Simple deployment: API + Workers can run anywhere
- Reliable: Built-in retry logic, transactional queue
- Observable: Complete audit trail via events + jobs tables
- Extensible: Add channels/features without refactoring
