Skip to content

Cron & Scheduling

.md

Dewee includes an in-process cron scheduler (internal/cron/) supporting standard cron expressions and human-friendly interval strings like @every 24h or @every 30m.

The scheduler manages two distinct classes of scheduled executions:

  1. Agent Scheduled Tasks: Dispatches user-configured prompts and workflow triggers to specific agents at scheduled intervals.
  2. Operator System Tasks: Runs recurring background jobs such as periodic memory consolidation, session compaction, and license status checks.
Terminal window
# Create a daily summary cron task
dewee cron create --name "daily-standup" --schedule "@every 24h" --message "Summarize yesterday activities"
# List all active and paused cron jobs
dewee cron list
# Inspect detailed status of a specific job
dewee cron get <job-id-or-name>
# Trigger immediate execution of a scheduled job
dewee cron run <job-id-or-name>
# Inspect execution history runs
dewee cron runs <job-id-or-name>
# Enable or disable a job
dewee cron toggle <job-id> true
# Delete a scheduled job
dewee cron delete <job-id>

A run’s status says whether it executed (ok or error). Its outcome says what it achieved, so a run that executed but could not do its work never looks like a success:

| Outcome | Meaning | |---------|---------| | completed | The work was done | | valid_skip | Nothing needed doing this time | | blocked | The work cannot continue until someone acts (for example, an expired token) | | incomplete | Part of the work was done; the rest remains | | failed | The run failed |

The agent reports the outcome during the run through the cron tool (report_outcome with an outcome and a short reason). If it reports nothing, a run without an error is recorded as completed and a run with an error as failed. Agents whose tool profile has no cron tool (such as coding, messaging or minimal) are not asked to report and always get this default. Agents on CLI providers such as Claude CLI report through the same tool over the internal tool bridge. Credentials in the reason are redacted. A job that runs a workflow only queues it, so its runs show no outcome; the workflow run has its own status.

The outcome and reason appear in dewee cron list (OUTCOME column), dewee cron runs (OUTCOME and REASON columns), the dashboard cron pages and the workspace Schedules page. Runs from before this feature show no outcome.

  • If an agent is busy during scheduled execution, the task queues in the background event queue with exponential backoff.
  • Failed executions log structured errors with trace correlation IDs visible via dewee traces list.