Documentation Index
Fetch the complete documentation index at: https://docs.nanoclaw.dev/llms.txt
Use this file to discover all available pages before exploring further.
Overview
v2 has no separate task scheduler. A scheduled task is a row inmessages_in with a process_after timestamp (and optionally a recurrence cron expression). The host sweep runs every 60 seconds, finds rows whose time has come, wakes the session’s container, and the agent picks it up like any other inbound message.
That means everything scheduled — daily briefings, weekly reports, per-hour polls, one-time reminders — goes through the same pipeline as a user message. You only learn one model.
Task types
- Recurring (cron)
- One-time
Use cron expressions for complex recurring schedules:Each occurrence creates a new row in the session database sharing a
series_id.Creating tasks
Tasks are created through natural language requests to the agent:How it works
When you request a scheduled task, the agent:- Parses your request to extract the schedule and prompt
- Calls the
schedule_taskMCP tool (writes tooutbound.db) - The host’s delivery system creates the task in
inbound.db - The host sweep picks up the task when it’s due
Task execution
The host sweep runs every 60 seconds and:- Finds tasks where
process_after <= now - Wakes the session’s container (or spawns a new one)
- The agent-runner’s poll loop picks up the task
- Agent executes the task prompt
- Host sweep syncs
processing_ackand marks the task completed - For recurring tasks, creates the next occurrence with updated
process_after
Tasks share the container concurrency pool with interactive messages. If all container slots are busy (default: 5), tasks wait until a slot is available.
Timezone configuration
Tasks use the configured timezone for cron evaluation. The resolver checks:process.env.TZ.envfile’sTZvalue- System locale
- Falls back to
UTC
Task management
Manage tasks through natural language:Available operations
| Operation | What it does |
|---|---|
schedule_task | Creates a new task with process_after and optional recurrence |
cancel_task | Marks all rows in the series as completed, nulls recurrence |
pause_task | Toggles task to paused (skipped by host sweep) |
resume_task | Toggles task back to pending |
update_task | Updates prompt, script, schedule, or recurrence in-place |
Task scripts
For recurring tasks, add ascript to minimize unnecessary agent wake-ups. The script runs first, and the agent is only invoked when the script determines action is needed.
How it works
- The script runs first (30-second timeout)
- It prints JSON to stdout:
{ "wakeAgent": true/false, "data": {...} } - If
wakeAgentisfalse— task completes silently, no agent invocation - If
wakeAgentistrue— the agent wakes with the script’s data in its prompt
Example
Always test your script first
Before scheduling, run the script in the sandbox:When NOT to use scripts
If a task requires agent judgment every time (daily briefings, reminders, reports), skip the script.Frequent task guidance
If a task runs more than roughly twice a day and a script can’t reduce agent wake-ups:- Each wake-up uses API credits
- Restructure with a script that checks conditions first
- Find the minimum viable frequency
Scripts have a 30-second timeout and 1 MB output limit. If the script fails or produces no output, the agent is not invoked.
Recurring task series
Recurring tasks use a series model:- Each occurrence gets a new
messages_inrow sharing the sameseries_id - When an occurrence completes, the host creates the next one
cancel_taskstops the entire seriesupdate_taskmatches byseries_idto hit the live next-occurrence row
Example use cases
Daily standup summary
GitHub PR monitor (with script)
Weekly report
One-time reminder
Error handling
If a task fails:- Processing is acknowledged with error state
- For recurring tasks, the next occurrence is still created
- For one-time tasks, the task is marked completed even if it failed
- Check container logs for error details
Related documentation
- Messaging — the inbox/outbox pattern that scheduling rides on
- Customization — sweep interval, timezone, and concurrency