🫀 How agents run: routines, heartbeats & scheduled runs
ToothFairyAI agents are built to run autonomously by default — not as chat windows waiting for a prompt. Cloud agents and TF Code agents both operate on a continuous execution model: routines with heartbeats and full scheduled runs, with human check-in intervals configurable on top. This page documents the default operating model.
The default operating model
There are two scheduled job types (see Jobs for the full configuration reference):
- Task — executes a specific prompt on a schedule, for deterministic, repeatable workflows.
- Routine — performs an autonomous heartbeat check on a schedule: the agent probes its tools, plans actions, and executes them on its own.
Routines are the default operating model for open-ended agent work. On every heartbeat cycle the agent runs a three-phase protocol:
- Sensing — the agent probes its mapped tools (knowledge base, internet search, CRM, email, and any connected system) to identify opportunities, anomalies, or items requiring attention.
- Planning — the agent evaluates findings and creates an action plan, prioritising tasks by urgency and impact.
- Acting — the agent self-prompts to execute the planned actions via its tools: sending emails, updating records, generating reports, or any action its tools support.
The minimum schedule interval for Routine jobs is 30 minutes, with configurable frequency from minutes to yearly, per-agent assignment, timezone-aware scheduling, and optional start/end dates. The Max Planned Actions setting (1–20, default 5) bounds the scope of each heartbeat cycle.
Running unattended, checking in periodically
This is the key distinction: agents drive multi-step workflows on their own — a running Routine senses, plans, and acts without a person initiating each step. Human presence is configurable, not required per-step:
- Human feedback & oversight — admins and AI engineers can review agent feedback, mark resolutions, and use feedback to fine-tune models (see Human Feedback). This runs alongside autonomous execution, not as a gate on every step.
- Approval and review mechanisms — Orchestrator agents include built-in approval processes and plan-adjustment capabilities for operations where human oversight is wanted (see Orchestrator Agents).
- Execution hooks — customisable execution hooks let you run your own checks around agent actions (see API Integration).
In the shipped default configuration, a Routine agent runs its heartbeat cycles unattended: it decides what to do each cycle within its prompt instructions and tool permissions, and reports outcomes through its channels and job status.
Long-term memory across runs
Routine agents rely on Long Term Memory to maintain context across heartbeat cycles. The agent remembers previous interactions and outcomes, recognises recurring patterns and anomalies, builds institutional knowledge over time, and makes decisions informed by historical context. State that persists across runs includes:
- Long Term Memory — the agent's cross-session memory of past cycles and outcomes
- Knowledge Hub — the workspace document base (up to 5,000 documents) the agent retrieves from
- Agent configuration — tools, channels, prompts, and settings survive restarts
- Job state — schedule, status, and phase tracking for each Routine (Sensing / Planning / Acting)
The same execution model applies to TF Code agents: scheduled runs, routines, and autonomous multi-step execution with the same check-in and permission controls (see the TF Code documentation).
Related
- Jobs: Tasks & Routines — full scheduling configuration
- Failure handling & retry policy — what happens when a run fails
- Orchestrator Agents — planning and multi-agent coordination
- Human Feedback — oversight and model fine-tuning