3.7 KiB
3.7 KiB
Chronos Architecture
This document outlines the high-level architecture of Chronos, a Rust-based workflow automation platform.
Overview
Chronos is built as a Cargo workspace with multiple crates that implement different components:
chronos-core: Shared data models and utilitieschronos-api: HTTP API server using Axumchronos-scheduler: Scheduling servicechronos-worker: Worker execution servicechronos-workflow: Workflow enginechronos-database: Database interfacechronos-auth: Authentication systemchronos-executor: Native process execution enginechronos-notifications: Notification delivery systemchronos-metrics: Metrics collectionchronos-cli: Command-line interface
Component Interactions
┌─────────────┐ ┌──────────────┐ ┌─────────────┐
│ Browser │ │ Chronos │ │ Database │
└───────────┘ │ (API) │ └───────────┘
│ │ │ │
│ │ │ │
┌─────────────┐ │ │ │
│ Workflow│ │ │ │
│ Editor│ │ │ │
└───────────┘ │ │ │
│ │ │ │
│ │ │ │
┌─────────────┐ │ │ │
│ Scheduler │ │ │ │
│ │ │ │ │
└───────────┘ │ │ │
│ │ │ │
│ │ │ │
┌─────────────┐ │ │ │
│ Worker │ │ │ │
│ Executor│ │ │ │
└───────────┘ │ │ │
│ │ │ │
│ │ │ │
┌─────────────┐ │ │ │
│ Executor │ │ │ │
│ (Native)│ │ │ │
└───────────┘ │ │ │
│ │ │ │
│ │ │ │
┌─────────────┐ │ │ │
│ Executor │ │ │ │
│ (Native)│ │ │ │
└───────────┘ │ │ │
Core Data Flow
- User Interface: Users interact with the web dashboard to create and manage workflows
- API Layer: The Axum API server receives requests, validates them, and dispatches to appropriate services
- Scheduler: Handles scheduling decisions and job creation in the database
- Worker Pool: Workers pick up scheduled jobs and execute them via the executor
- Executor: Runs actual commands in isolated processes with resource limits
- Database: Stores all persistent state including workflows, schedules, executions, and user data
Security Model
- All user inputs are validated and sanitized
- Authentication is enforced at API layer
- Workers execute tasks in isolated native processes
- Sensitive credentials are encrypted at rest
- Access control is implemented through role-based permissions