Architecture
Kronforce is a single binary that contains a scheduler, REST API, web dashboard, and SQLite database. It distributes work to agents and reacts to events — all without external dependencies.
System Overview
The controller handles everything: scheduling, API, dashboard, database. Agents are optional — for local-only jobs, no agents needed. For distributed execution, deploy standard (Rust) or custom (any language) agents. Standard agents can dispatch MCP tool calls to external AI servers. Notifications flow out to Slack, Teams, PagerDuty, email, and SMS on failures, successes, and SLA breaches.
How a Job Executes
- Trigger — scheduler fires (cron/one-shot), API call, event match, or dependency satisfied
- Resolve target — local (controller runs it), specific agent, tagged agent, any agent, or all agents
- Dispatch — standard agents receive HTTP push; custom agents pick up from queue on next poll
- Execute — task runs (shell, HTTP, SQL, script, etc.) with timeout and output capture
- Callback — agent reports result (status, exit code, stdout, stderr) back to controller
- Post-process — output extractions run, variables updated, assertions checked, events fired
- React — notifications sent, dependent jobs unblocked, event-triggered jobs fire
Agent Types
Standard Agent (Rust)
Push-based. Controller sends HTTP requests to /execute, /cancel, /shutdown. Runs all 12 built-in task types including MCP — dispatch AI tool calls to external MCP servers. Authenticated via shared key.
cargo run --bin kronforce-agent
Custom Agent (Any Language)
Pull-based. Agent polls /api/agent-queue/{id}/next for work. Task types defined in the dashboard UI. Build in Python, Go, Node, or anything with an HTTP client.
python3 examples/custom_agent.py
Standard agents are faster (no polling delay) and support all task types. Custom agents are more flexible — define any task type in the UI and implement the handler in your preferred language. Both authenticate with the controller using API keys.
MCP Integration
Kronforce acts as an MCP (Model Context Protocol) server at POST /mcp. AI assistants can discover available tools, create and trigger jobs, query execution results, and monitor system health — all through the standard MCP JSON-RPC protocol. Tools are filtered by API key role.
Event-Driven Workflows
Jobs connect through three mechanisms: dependencies (solid arrows — job B waits for job A), event triggers (dashed arrows — job fires when an event matches), and output extraction (curved arrows — values extracted from stdout flow to the next job via global variables).
Data Storage
SQLite + WAL
All data in a single file. Write-Ahead Logging for concurrent reads. r2d2 connection pool (default 8 connections). Graceful WAL checkpoint on shutdown.
Litestream Replication
Continuous streaming to S3-compatible storage. Automatic restore on failover. 1-second replication lag. Zero-downtime disaster recovery.
Encryption at Rest
Secret variable values encrypted with AES-256-GCM when KRONFORCE_ENCRYPTION_KEY is set. Volume-level encryption recommended for full DB.
Data Retention
Automatic purge of old executions, events, and queue items (default 7 days). Audit log kept separately (default 90 days). Configurable via Settings.
Built with Rust
Kronforce is written in Rust for speed, safety, and reliability. No garbage collector pauses, no null pointer exceptions, no data races. The entire controller — scheduler, API, dashboard, and database — compiles to a single binary with 236+ tests and zero unsafe blocks. If it compiles, it runs.