Set Up Routines
Schedule agent queries on a recurring basis for automated analysis and reporting.
Prerequisites
- A Xilos account with admin access
- A query or prompt you want to run on a schedule
- (Optional) A routing rule to direct the routine's queries
What Are Routines?
Routines are scheduled queries that run automatically on a cron schedule. Each routine sends a query through the full Xilos pipeline — routing, guardrails, caching, compression — and stores the result.
Common use cases:
- Daily summary of AI activity
- Weekly cost analysis
- Periodic context engine enrichment
- Automated compliance checks
- Scheduled report generation
Step 1: Create a Routine
- Navigate to Integrations in the sidebar.
- Click the Routines tab.
- Click Create Routine.
- Fill in the form:
- Name — Descriptive name (e.g., "Daily AI Activity Summary")
- Query — The prompt to send on each run
- Schedule — Choose a preset or enter a custom cron expression
- Routing Rule (optional) — Which routing rule to use
- Click Save.
Cron Schedule Presets
| Preset | Cron Expression | Description |
|---|---|---|
| Hourly | 0 * * * * | Every hour on the hour |
| Daily | 0 9 * * * | Every day at 9:00 AM |
| Weekly | 0 9 * * 1 | Every Monday at 9:00 AM |
| Monthly | 0 9 1 * * | First day of each month at 9:00 AM |
For custom schedules, use standard cron syntax:
┌───────── minute (0-59)
│ ┌───────── hour (0-23)
│ │ ┌───────── day of month (1-31)
│ │ │ ┌───────── month (1-12)
│ │ │ │ ┌───────── day of week (0-6, 0=Sunday)
│ │ │ │ │
* * * * *Step 2: Monitor Routine Runs
Each routine tracks:
- Last Run At — When the routine last executed
- Last Result — The response from the last run
- Status — Active or inactive
- Navigate to Integrations > Routines.
- Click on a routine to view its history.
- Review the last result and any errors.
Step 3: Manual Triggers
You can manually trigger a routine without waiting for its scheduled time:
- Navigate to Integrations > Routines.
- Find the routine.
- Click Run Now.
- The query is sent through the pipeline immediately.
- Results appear in the routine's history and the Query Log.
Info: Manual runs do not affect the cron schedule — the routine will still run at its next scheduled time.
Step 4: Activate/Deactivate
Toggle routines on and off without deleting them:
- Navigate to Integrations > Routines.
- Toggle the active switch.
- Inactive routines do not execute on their schedule.
Use Cases
Daily AI Activity Summary
- Name: Daily AI Activity Summary
- Query: "Summarize yesterday's AI query activity, including total queries, blocked queries, top topics, and cost."
- Schedule: Daily at 9:00 AM
- Routing Rule: Default
Weekly Cost Analysis
- Name: Weekly Cost Report
- Query: "Analyze this week's AI spending by model and department. Identify cost optimization opportunities."
- Schedule: Weekly on Monday at 9:00 AM
Periodic Context Enrichment
- Name: Knowledge Base Update
- Query: "Review recent queries and identify new facts to add to the context engine."
- Schedule: Daily at midnight