Skip to content

Routines

Automate recurring tasks with AI-powered execution and cron scheduling.

Overview

Routines let you schedule tasks that Aurora executes automatically — from daily weather reports to weekly file cleanups. Each routine runs with full access to Aurora's tool set.

Features

  • Cron scheduling — Standard cron expressions (daily, weekly, hourly, custom)
  • AI execution — Aurora processes your prompt with full tool access
  • Tool loop — Up to 5 tool iterations per execution (search, create files, fetch data)
  • Manual trigger — Run any routine immediately via "Jetzt ausfuehren"
  • Execution logs — Full result text, tool calls, success/failure status
  • Autonomous mode — Routines execute without user interaction (no questions asked)
  • Next-5-Runs preview — Vorschau der naechsten 5 geplanten Ausfuehrungen v3.12

Creating a Routine

  1. Open the Routines app
  2. Click "Neue Routine"
  3. Fill in:
    • Name — e.g., "Wetterbericht"
    • Prompt — What Aurora should do, e.g., "Suche den Wetterbericht fuer Muenchen und lege ihn als Datei in ~/Dokumente/Wetter/ ab"
    • Schedule — Cron expression or preset (daily, weekly, etc.)
  4. Save and activate

v3.12 Updates v3.12

Next-5-Runs

Jede Routine zeigt jetzt eine Vorschau der naechsten 5 geplanten Ausfuehrungszeitpunkte:

  • Berechnet aus dem Cron-Ausdruck
  • Anzeige mit Datum und Uhrzeit
  • Hilft bei der Verifizierung, dass der Cron-Ausdruck korrekt ist

Execution Engine v3.8

When a routine runs (manually or via cron), the following happens:

1. Select AI model (tools-capable, from user preferences)
2. Build system prompt (Aurora identity + routine context + tools)
3. Send user prompt to AI
4. Parse response for tool calls
5. Execute tools (file operations, web search, etc.)
6. Feed tool results back to AI
7. Repeat steps 4-6 (max 5 iterations)
8. Store final summary in logs

Autonomous Execution Rules

Routines run without a user present. The system prompt enforces:

  1. Execute all steps immediately (search, create files, create directories)
  2. Never ask follow-up questions ("Soll ich...?", "Moechtest du...?")
  3. Always save results as files when the prompt requires it
  4. Summarize the result at the end

Model Selection

The routine engine uses the shared prepareModels() and selectModel() functions from lib/ai-providers.php. It prefers a model with tools capability. If none is found, it falls back to the first enabled model.

Tool Access

Routines have access to the same tools as Aurora in chat:

  • File operations (read, write, create, delete, move)
  • Web search and webpage fetching
  • Note, document, and finance management
  • Weather data
  • Contact and calendar operations

Fallback

If the AI response is empty after tool execution (e.g., the model only returned tool calls without a summary), the system generates a fallback listing all executed tools and their results.

Logs

Each execution creates a log entry with:

FieldDescription
started_atExecution start time
completed_atExecution end time
resultAI summary text
tool_calls_jsonJSON array of all tool calls with results
successBoolean success flag

View logs by clicking "Logs" on any routine.

Cron Setup

Niuton uses separate cron jobs for E2E and PROD:

bash
# /etc/cron.d/niuton-routines
*/5 * * * * www-data php /var/www/niuton-e2e/cron/run-routines.php
*/5 * * * * www-data php /var/www/niuton-prod/cron/run-routines.php

The cron runner checks every 5 minutes for routines where next_run <= NOW() and is_active = true.

Database

sql
-- Routine definitions
CREATE TABLE niuton_routines (
    id SERIAL PRIMARY KEY,
    user_id INTEGER REFERENCES niuton_users(id),
    name VARCHAR(255) NOT NULL,
    description TEXT,
    prompt TEXT NOT NULL,
    schedule VARCHAR(100),        -- cron expression
    is_active BOOLEAN DEFAULT true,
    last_run TIMESTAMP,
    next_run TIMESTAMP,
    created_at TIMESTAMP DEFAULT NOW()
);

-- Execution logs
CREATE TABLE niuton_routine_logs (
    id SERIAL PRIMARY KEY,
    routine_id INTEGER REFERENCES niuton_routines(id),
    started_at TIMESTAMP,
    completed_at TIMESTAMP,
    result TEXT,
    tool_calls_json JSONB DEFAULT '[]',
    success BOOLEAN DEFAULT false
);

Architecture

api/routines.php         → CRUD + manual "run_now" handler
cron/run-routines.php    → Cron-triggered execution (same engine)
lib/tools.php            → Tool definitions + parseToolCalls()
lib/tool-executor.php    → Tool execution engine
lib/ai-providers.php     → AI model selection + API calls

AI-Powered Cloud Desktop OS