Download

AI Task Scheduler — User Guide | YoBench

How to use the AI Task Scheduler in YoBench: cron-driven AI runs, approval flow for dangerous plans, live timeline, tool whitelist and full run history.

What the AI Task Scheduler module does

AI Task Scheduler runs the AI assistant on a schedule. You define a prompt, pick a provider and a context, attach an optional toolset, and tell the scheduler when to run it — every minute, hourly, daily, weekly or monthly. The assistant executes autonomously; if it builds a plan flagged as dangerous, the run pauses with a clear Approve / Deny prompt instead of failing.

What you get:

  • Cron-driven AI runs — five schedule types (minute, hour, day, week, month).
  • Manual runs on demandRun Now on any task.
  • Per-task isolation — each task picks its own provider, context, system prompt, temperature, max iterations and allowed tools.
  • Approval flow — dangerous plans are persisted as pending_approval so you can review them before execution continues.
  • Live timeline — real-time messages and tool results while a run is in progress.
  • Run history with status, trigger type, duration, tokens and cost.
  • Scope-bound cancellation — every run has a unique scope key; long-running tools are cleaned up when you cancel.

Concepts

Term Meaning
Task A reusable AI configuration: prompt, provider, schedule, tool whitelist.
Run One execution of a task. Triggered manually or by cron.
Trigger manual (button) or cron (schedule).
Status running / done / error / pending_approval / cancelled.
Approval A pause point where the assistant asks for confirmation before it executes a plan it flagged as dangerous.
Scope The cancellation root for a run (scheduler-run:{runId}). All tools spawned by the run belong to this scope.

Schedule types

Schedules are stored as schedule_type plus auxiliary fields and translated to a cron expression on the fly.

Type Configures Example
Minute Interval in minutes every 15 minutes
Hour HH:MM in the hour XX:30 every hour
Day HH:MM every day at 09:00
Week Weekday (1=Mon … 7=Sun) + HH:MM every Monday 08:30
Month Day of month (1–31) + HH:MM 1st of every month 00:05

Manual triggers (Run Now) ignore the schedule.

Tool control

Each task can either:

  • Run with all tools available (legacy / new tasks where tools_enabled is on and the tool list is empty/null), or
  • Run with a whitelist — pick the exact tool ids the assistant may call (web search, browser automation, terminal, file system, document tools, etc.), or
  • Run with tools disabled entirely — the assistant has only its prompt and context.

This is the main lever for a safe scheduled task: a daily report task probably doesn't need terminal access; a code-review task might want only web and browser.

Approval flow

The pipeline runs in autonomous mode — every plan that is not flagged as dangerous executes without asking. When the assistant emits a plan with requiresConfirmation = true:

  1. The run transitions to pending_approval.
  2. The plan is persisted; the run is paused.
  3. The UI shows the plan with two buttons: Approve and Deny.
  4. Approve — the pipeline resumes from the saved point.
  5. Deny — the run ends with status cancelled and reason "Rejected by user".

Pending approvals are surfaced both in the run view and in a dedicated Pending Approvals list at the top of the page so they don't get lost.

Run lifecycle

schedule fires (or Run Now)
        │
        ▼
   create run
   status = running
        │
        ▼
  ─── messages stream into the timeline ───
        │
        ├─ done            → status = done
        ├─ error           → status = error  (error message saved)
        ├─ user cancels    → status = cancelled
        └─ dangerous plan  → status = pending_approval
                                  │
                                  ├─ approve → status = running → continues
                                  └─ deny    → status = cancelled

Each run records: trigger, started/finished timestamps, duration, token usage, dollar cost, error string (if any) and the full message log.

Settings

A task is created from Scheduler → Create which opens the form drawer. Fields:

  • Title — display name.
  • Prompt — the main instruction the assistant runs every tick.
  • System Prompt — optional persistent role / behaviour. Empty by default.
  • Provider — the AI provider used by the run.
  • Context — optional RAG context injected into the run.
  • Temperature — 0.0 – 1.0, default 0.3.
  • Max auto-iterations — cap on tool-use rounds inside one run, default 5.
  • Schedule type + the matching time / weekday / day fields.
  • Is active — toggle to pause the schedule without deleting the task.
  • Tools enabled — global on/off for the toolset.
  • Allowed tools — multi-select, used when tools are enabled.

The form can also save a draft of the task without activating it.

Workflow

1. Create a scheduled task

  1. Open Scheduler from the sidebar.
  2. Click Create → the task drawer slides in.
  3. Fill in title, prompt and pick a provider.
  4. (Optional) attach a context, tighten the system prompt, lower the temperature.
  5. Choose the schedule type and the time.
  6. Choose the tool policy: enabled + whitelist, enabled + open, or disabled.
  7. Enable Is active and save.

2. Run on demand

  • Open the task → Run Now → the run appears in the timeline immediately.
  • Watch live messages and tool results stream in.
  • Stop at any time with Stop — the scope is cancelled, long-running tools are torn down.

3. Handle a pending approval

  1. Either the run badge turns yellow (pending) or the Pending Approvals list shows a new item.
  2. Open the run → review the proposed plan.
  3. Approve — the run resumes. Deny — the run is cancelled.

4. Review history

  • The task view lists every run with status, trigger, duration, token usage and cost.
  • Click a run to open the full message log and any tool outputs.
  • Errors include the full error message; cancellations record who / what cancelled them.

Tips and limitations

  • Use manual runs to test a prompt before activating the schedule.
  • Keep the system prompt task-specific — global persona belongs in the AI Chat settings.
  • The token / cost numbers come from the provider response; for self-hosted local models cost shows as zero.
  • The scheduler runs inside the desktop app — when YoBench is closed, the cron does not fire. Plan around that or keep the app open in the tray.
  • Set max auto-iterations conservatively at first; raise it once you trust the prompt.

Next steps

  • Connect an AI provider and at least one context.
  • Pair a scheduled task with the DB Manager — for example, a nightly run that summarises slow-query logs.
  • For periodic non-AI work (pure cron + scripts) use the embedded DB tasks or the Scenarios module.

Help and feedback

Found a bug or want a new schedule type? Contact us via the feedback form.