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

Controller Single binary — everything included Scheduler REST API Dashboard Executor SQLite MCP Server Standard Agent Rust — push-based Shell, HTTP, SQL, MCP, FTP... Custom Agent Python/Go/Node — pull-based gRPC, MCP bridge, custom Browser Dashboard + API AI Assistant via MCP protocol Notifications Slack · Teams · PagerDuty · Email · SMS External MCP Servers Litestream → S3 HA replication HTTP push /execute poll queue result callback MCP JSON-RPC MCP call on failure / success / SLA breach

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

  1. Trigger — scheduler fires (cron/one-shot), API call, event match, or dependency satisfied
  2. Resolve target — local (controller runs it), specific agent, tagged agent, any agent, or all agents
  3. Dispatch — standard agents receive HTTP push; custom agents pick up from queue on next poll
  4. Execute — task runs (shell, HTTP, SQL, script, etc.) with timeout and output capture
  5. Callback — agent reports result (status, exit code, stdout, stderr) back to controller
  6. Post-process — output extractions run, variables updated, assertions checked, events fired
  7. 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

AI Assistant Claude, GPT, etc. via MCP client JSON-RPC Kronforce MCP Server 10 tools exposed role-based access list_jobs create_job trigger_job get_execution get_system_stats

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

etl-extract cron: 0 0 2 * * * etl-transform depends on extract etl-load depends on transform execution.completed deploy-notify event trigger extracts record_count {{LAST_ETL_COUNT}}

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.