How boomerang-io/flow.services works
Main Components
• Flow Service (located in service-flow): Exposes v2 RESTful APIs for front-end consumption including user/team management, relationship graphs, scheduling, authentication/authorization, and more.
• Engine Service (located in service-engine): Acts as the workflow orchestrator that executes workflows as Directed Acyclic Graphs (DAGs). This service “drives” the workflow execution and passes events to the handlers.
• Handler Service (located in service-handler): Listens for events from the Engine Service and executes tasks (the default implementation uses Tekton on Kubernetes, though additional handlers can be integrated).
• Common Library (lib-common): Contains shared domain models, entities, enums, and utility classes that are used across the services for consistency.
• External and Infrastructure Components:
• MongoDB: Used by the services for storage, including configuring TTL indexes (lock mechanism) and scheduling jobs (via Quartz).
• Kubernetes & Tekton: The Handler service uses Tekton for executing tasks on Kubernetes.
• CloudEvents: The services are designed to publish and consume CloudEvents.
• Quartz Scheduler: For distributed and scheduled job execution in the Flow service.
Relationships and Data Flow
• External Requests come in (HTTP calls) and are handled initially by the Flow Service.
• The Flow Service communicates with the Engine Service using HTTP, handing off requests for workflow execution.
• The shared lib-common ensures consistent entity and model definitions across all services.
Architectural Patterns & Design Principles
• Use a microservices or service-oriented architecture (even though they sit in a monorepo) by clearly separating Flow, Engine, and Handler responsibilities.
• The architecture is event-driven – highlight the asynchronous event dispatching from Engine to Handlers.
• Abstraction with the common library, which helps maintain consistency across services.
• Use of distributed locking (via the Mongo TTL based lock implementation) for handling concurrency.
• Usage of external scheduling (Quartz) and external container orchestration (Kubernetes/Tekton).
Technologies and Frameworks
• Java 21 and Spring Boot 3 for service development.
• Maven for build management.
• Docker (see Dockerfiles in each service) for containerization.
• MongoDB for data persistence.
• Quartz for scheduling.
• Tekton and Kubernetes for task execution.