How md-emran-hossain/email-automation-engine works
Email Automation Engine is a multi-tenant platform for authoring event-driven email journeys and running them asynchronously. Users manage tenants, contacts, tags, templates, triggers, steps, and conditions in the web app; the API exposes these operations and execution summaries. Events start workflow execution, where workers handle branching, delays, email, and webhooks, while SES tracking events return through the API and queue. The README documents these product capabilities; worker-to-queue dispatch details are represented only at the documented level because worker handler source was not sampled.
Main entry points: api.ts API client · handlers Queue workers · controllers Event intake · automation-event.service.ts Trigger matching
Components 29
Web application
- Web app routes
apps/web/src/App.tsx - Journey builder
apps/web/src/pages/workflow/WorkflowBuilder.tsx - Contact management
apps/web/src/pages/contacts/Contacts.tsx - Template management
apps/web/src/pages/email-templates/EmailTemplates.tsx - Tenant settings
apps/web/src/pages/settings/Settings.tsx - API client
apps/web/src/lib/api.ts
Management API
- Identity and tenants
apps/api/src/modules/iam - Workflow endpoints
apps/api/src/modules/workflow/interface/workflow.controller.ts - Workflow services
apps/api/src/modules/workflow/application/services - Contact endpoints
apps/api/src/modules/contact/interface/http/controllers/contact.controller.ts - Contact services
apps/api/src/modules/contact/application/services - Template endpoints
apps/api/src/modules/email/interface/http/controllers/email-template.controller.ts - Email services
apps/api/src/modules/email/application/services - Event intake
apps/api/src/modules/automation-event/interface/http/controllers - Execution summaries
apps/api/src/modules/contact-workflow/interface/http/controllers/execution-summary.controller.ts - Trigger matching
apps/api/src/modules/automation-event/application/services/automation-event.service.ts
Automation runtime
- Queue workers
apps/worker/src/handlers - Email delivery
apps/worker/src/handlers/send-workflow-email.handler.ts - Conditional branching
apps/worker/src/handlers/conditional-split.handler.ts - Delayed steps
apps/worker/src/handlers/watch-workflow-steps.handler.ts - Webhook delivery
apps/worker/src/handlers/call-webhook.handler.ts - Tracking events
apps/worker/src/handlers/process-email-tracking-event.handler.ts
Queue contracts
- Queue messages
packages/shared/src/queue
External services
- PostgreSQL
- AWS SQS
- AWS SES
Other components
- Tenant user
- Connected application
- Webhook target
Connections 38
- Tenant user → Web app routes: uses
- Web app routes → Journey builder: routes to
- Journey builder → API client: requests API
- Contact management → API client: requests API
- Template management → API client: requests API
- Tenant settings → API client: requests API
- API client → Workflow endpoints: manages journeys
- API client → Contact endpoints: manages contacts
- API client → Template endpoints: manages templates
- API client → Identity and tenants: manages access
- Workflow endpoints → Workflow services: invokes
- Contact endpoints → Contact services: invokes
- Template endpoints → Email services: invokes
- Workflow endpoints → PostgreSQL: persists workflow data
- Contact services → PostgreSQL: persists contact data
- Email services → PostgreSQL: persists templates
- Identity and tenants → PostgreSQL: persists identity data
- Connected application → Event intake: posts event
- Event intake → Trigger matching: processes event
- Trigger matching → AWS SQS: queues automation
- Trigger matching → PostgreSQL: reads trigger data
- AWS SQS → Queue workers: dispatches messages
- Queue workers → Email delivery: dispatches email steps
- Queue workers → Conditional branching: dispatches splits
- Queue workers → Delayed steps: dispatches waiting steps
- Queue workers → Webhook delivery: dispatches webhooks
- Email delivery → AWS SES: sends email
- Webhook delivery → Webhook target: calls webhook
- AWS SES → Event intake: posts tracking event
- Event intake → Email services: resolves message
- Event intake → AWS SQS: queues tracking
- AWS SQS → Tracking events: dispatches tracking
- Tracking events → PostgreSQL: records events
- Execution summaries → PostgreSQL: reads execution history
- API client → Execution summaries: reads summaries
- Queue workers → PostgreSQL: updates execution state
- Queue workers → Queue messages: uses message contracts
- Trigger matching → Queue messages: creates event messages