High-Level Automation Architecture
The automation layer is built on three pillars: the Cron Scheduler, Routines, and Objectives. These components interact to ensure that agents can fire based on time, events, or persistent goals while adhering to safety and approval constraints.Natural Language to Code Entity Space: Automation Dispatch
This diagram illustrates how a user’s intent or a scheduled trigger flows from high-level concepts into the internal daemon machinery. Sources: crates/palyra-daemon/src/cron.rs#3-13, crates/palyra-daemon/src/routines.rs#94-103, crates/palyra-daemon/src/objectives.rs#3-7Routines and Cron Scheduler
Thespawn_scheduler_loop is the heart of Palyra’s proactive execution. It handles time-based triggers defined via cron expressions or natural language phrases.
- Deterministic Scheduling: The scheduler uses stable hashes for jitter to prevent “thundering herd” issues across multiple instances crates/palyra-daemon/src/cron.rs#10-13.
- Misfire & Concurrency: Supports policies like
Skip,CatchUp, andQueueOneto handle daemon downtime or overlapping runs crates/palyra-daemon/src/cron.rs#58-66. - Routine Integration: Routines wrap cron jobs with additional metadata, including delivery targets (e.g., Slack/Discord) and quiet hour constraints crates/palyra-daemon/src/routines.rs#45-50.
- Tool Interface: The
palyra.routines.controlandpalyra.routines.querytools allow agents to self-manage their own automations crates/palyra-daemon/src/application/tool_runtime/routines.rs#3-10.
Objectives, Webhooks, and Event Triggers
Objectives represent long-lived goals that may span multiple sessions and weeks. They provide a structured way to track progress and manage budgets for autonomous agents.- Goal Tracking: The
ObjectiveRecordtracks theObjectiveState(Active, Paused, etc.) and maintains a history of attempts and approaches crates/palyra-daemon/src/objectives.rs#3-7. - Budgets & Guardrails: Objectives can enforce
max_runsormax_tokensto prevent runaway costs during autonomous operation crates/palyra-daemon/src/objectives.rs#142-152. - Webhook Ingestion: The
WebhookRegistryallows external systems to trigger Palyra routines via HMAC-SHA256 signed payloads crates/palyra-daemon/src/webhooks.rs#3-9. - Workspace Projection: Objectives can project their status directly into workspace documents using “managed blocks” crates/palyra-daemon/src/transport/http/handlers/console/objectives.rs#2-11.
Code Entity Mapping: Objective Lifecycle
The relationship between objective goals and their underlying automation components.
For details on the objective judge, planning regressions, and webhook replay protection, see Objectives, Webhooks, and Event Triggers.
Summary of Key Automation Components
Sources: crates/palyra-daemon/src/cron.rs#3-8, crates/palyra-daemon/src/routines.rs#3-7, crates/palyra-daemon/src/objectives.rs#3-7, crates/palyra-daemon/src/webhooks.rs#3-9, crates/palyra-daemon/src/application/inbound_coalescer/mod.rs#1-8