A fully event-driven workflow orchestration system built to understand how distributed schedulers like Airflow work under the hood.
This system executes workflows defined as Directed Acyclic Graphs (DAGs) using a decoupled, event-driven architecture.
Instead of tightly coupled services, execution is driven by state transitions and Kafka events.
Workflow Service → Kafka → Scheduler → Kafka → Worker
↑
(task-completed)
- Creates workflows and tasks
- Defines DAG (task dependencies)
- Publishes
workflow-startedevent
- Consumes
workflow-started - Finds executable tasks using DAG constraints
- Marks tasks as READY
- Publishes
task-readyevents - Handles
task-completedto trigger next tasks - Detects workflow completion
- Consumes
task-ready - Executes tasks
- Updates status (RUNNING → SUCCESS / FAILED)
- Publishes
task-completed - Ensures idempotent execution
- Shared event contracts
- DTOs for inter-service communication
- Workflow is started
- Scheduler identifies root tasks
- Tasks are sent to workers via Kafka
- Workers execute tasks
- Completion events trigger next tasks
- Loop continues until workflow completes
Tasks execute only when all dependencies are satisfied.
No direct service-to-service calls. Everything is coordinated via Kafka.
Prevents duplicate task execution due to Kafka re-delivery.
- Retry handling implemented
- Failures are isolated at task level
All execution state is stored in the database.
fetch-order → process-payment → send-notification
- Java 21
- Spring Boot
- Apache Kafka (KRaft)
- MySQL
- Docker
docker-compose up -d- workflow-service
- scheduler-service
- worker-service
POST /api/workflows
POST /api/tasks
POST /api/dependencies
POST /api/workflows/{id}/start
✔ Event-driven orchestration ✔ DAG-based execution ✔ Retry + failure handling ✔ Idempotent task execution ✔ Workflow completion detection
- Dead Letter Queue (DLQ)
- Task timeouts
- Distributed tracing
- Real task execution (API calls, jobs)
- UI dashboard
This project helped me understand:
- How schedulers actually work internally
- Difference between execution and orchestration
- Designing for failure in distributed systems
- Event-driven system design
Built as a deep dive into distributed systems and orchestration engines.