Skip to main content
Trinity
Guides/Scheduling and Automation

Scheduling and Automation

Cron-based automation with APScheduler, reusable skills and playbooks, and human-in-the-loop approval gates for process workflows.

Scheduling

Schedule recurring tasks with timezone support, execution history, and manual triggers. Each schedule pairs a cron expression with a message or task sent to an agent at the specified times.

Autonomy Mode — Master toggle that enables or disables all schedules for an agent. Schedules will not fire if autonomy is off.
Misfire Handling — If the scheduler restarts, missed jobs within a 1-hour grace window are caught up and fired immediately.
Distributed Locks — Standalone scheduler service with Redis distributed locks for reliable execution.
Schedule lifecycle: Create (set cron, write prompt, enable) triggers Run (scheduler fires, agent executes, log result)

Creating Schedules

1

Open the agent detail page and go to the scheduling section.

2

Click Create Schedule.

3

Configure: name, cron expression (e.g., 0 9 * * 1-5 for weekdays at 9 AM), message/task, timezone, and description.

4

Optionally select a model override (Opus, Sonnet, Haiku, or custom).

5

Enable or disable individual schedules with the toggle.

6

View execution history with status, duration, and cost.

7

Click Run Now to trigger a schedule immediately.

Schedules tab showing cron schedule configuration and execution history

Execution Flow

1

Scheduler fires and sends a POST to /api/internal/execute-task with async_mode=True.

2

Backend spawns a background task and returns immediately.

3

Scheduler polls the database every 10 seconds until execution completes.

4

Execution record is updated with response, cost, and duration.

Schedule API

EndpointMethodDescription
/api/agents/{name}/schedulesGETList schedules
/api/agents/{name}/schedulesPOSTCreate schedule
/api/agents/{name}/schedules/{id}GET/PUT/DELETECRUD operations
/api/agents/{name}/schedules/{id}/enablePOSTEnable schedule
/api/agents/{name}/schedules/{id}/triggerPOSTManual trigger
/api/agents/{name}/schedules/{id}/executionsGETExecution history

Skills and Playbooks

Platform-managed skills that can be assigned to agents and invoked from the UI via the Playbooks tab or chat autocomplete.

Key Concepts

Skill — A reusable capability defined as a markdown file (SKILL.md) stored in the platform's skills library.
Skills Library — A GitHub repository synced to Trinity containing all available skills. Admins can trigger a sync from Settings.
Playbook — A skill invoked from the UI. The Playbooks tab shows assigned skills with a “Run” button.
Playbook Autocomplete — Type / in the Chat tab to see available playbooks with ghost text showing command syntax.

Managing Skills (Admin)

1

Go to Settings or the Skills admin page.

2

Sync the skills library from GitHub.

3

Create, edit, or delete skills (full CRUD). View skill details and usage.

Assigning Skills (Owner)

Open the agent detail page, go to the skills/playbooks section, and assign skills from the library. Skills are injected on the next agent start.

Running Playbooks (User)

Open agent detail, click the Playbooks tab, and click Run on a playbook. Or type / in the Chat tab to autocomplete a playbook command.

Skill Injection on Agent Start

When an agent starts, all assigned skills are written to the agent's .claude/commands/ directory. The agent can then use them as slash commands during execution.

Playbooks tab showing assigned skills with Run buttons

Approvals

Human-in-the-loop approval gates for process engine workflows. Processes pause at approval steps and wait for human decisions before continuing.

1

A process execution reaches a human_approval step. The step pauses the process (status: PAUSED).

2

An approval request appears in the Approvals inbox (accessible from the navigation bar).

3

The approver sees the process name, step description, context, and who requested it.

4

The approver can Approve or Reject, with an optional comment.

5

On approval, the process continues. On rejection, the execution is cancelled or follows the rejection path. Approvals can have configurable timeouts.

A approval_required WebSocket event is fired when a process needs human approval.

Approval API

EndpointMethodDescription
/api/approvalsGETList pending approvals
/api/approvals/{id}GETGet approval details
/api/approvals/{id}/decidePOSTSubmit decision (approve/reject)

Limitations

Execution timeout is per-agent configurable (default 15 minutes, max 2 hours).
Parallel execution is controlled by per-agent capacity slots (default 3).
Missed jobs are only caught up within the 1-hour grace window.
Approvals only apply to processes with human_approval step types defined in the process YAML.