> ## Documentation Index
> Fetch the complete documentation index at: https://docs.woopilot.xyz/llms.txt
> Use this file to discover all available pages before exploring further.

# Scheduled AI Scenarios

> Configure automated recurring business workflows, daily briefings, and periodic store audits

# Scheduled AI Scenarios 🕒

**Scheduled Scenarios** are time-driven autonomous workflows that execute periodic analytics and catalog health checks on a schedule defined by you.

Whether you need a daily morning briefing before your team begins work or a weekly audit of aging inventory, WooPilot AI runs the scenario in the background and delivers actionable insights directly to your Telegram chat.

```text theme={null}
┌─────────────────────────────────────────────────────────────────────────────┐
│ ⏰ EVERY MORNING AT 09:00 AM:                                               │
│ WooPilot AI autonomously compiles yesterday's sales, compares revenue with  │
│ the previous week, checks low-stock items, and delivers a Retina PNG card!  │
└─────────────────────────────────────────────────────────────────────────────┘
```

***

## ⚙️ Flexible Scheduling Engine

Inside the Telegram Mini App (**App $\to$ WooAuto $\to$ Scenarios**), you can configure two distinct scheduling modes:

### 1. `Exact Time` Mode

Specify one or more exact hours during the day and choose the active days of the week:

* **Time Points:** e.g. `09:00`, `14:00`, `19:00` (up to 24 time points).
* **Active Days:** Select any combination (e.g. `Mon`, `Tue`, `Wed`, `Thu`, `Fri`).
* **Timezone Aware:** Automatically respects your local WooCommerce store timezone (e.g. `America/New_York`, `Europe/London`, `Europe/Kiev`).

### 2. `Interval` Mode

Run scenarios on a recurring cycle with a defined active working window:

* **Interval Step:** Every `30 min`, `1 hour`, `2 hours`, `4 hours`, `6 hours`, or `12 hours`.
* **Active Window:** Active from `09:00` to `21:00` (silencing notifications overnight).
* **Active Days:** e.g. `Mon–Sun` or business days only.

***

## 💬 Example Scenario Recipes

### 1. Daily Morning Revenue Briefing

```text theme={null}
"Generate a morning sales summary for yesterday: net revenue, order count, top 3 products, average check, and compare with the same day last week."
```

* **Schedule:** Exact Time: `09:00` | Days: `Mon–Sun`

### 2. Friday Inventory & Stale Stock Audit

```text theme={null}
"Scan the entire store catalog. Find products with stock < 5 units or products with > 20 units in stock and zero sales in the last 60 days. Calculate total frozen capital."
```

* **Schedule:** Exact Time: `18:00` | Days: `Fri`

### 3. Periodic Abandoned Cart Scan

```text theme={null}
"Check all orders in 'Pending Payment' status created in the last 4 hours. Group them by payment gateway and flag any failed checkout patterns."
```

* **Schedule:** Interval: Every `3 hours` | Active: `09:00 – 21:00` | Days: `Mon–Sun`

***

## ⚡ Precision Architecture: Redis ZSET Scheduler

To guarantee sub-minute timing accuracy without running heavy database polling loops:

* **Next-Tick Recalculation:** Cloud Core stores strictly **ONE** next execution timestamp per scenario in a Redis Sorted Set (`ZSET`).
* **Zero Missed Runs:** If the server is restarted during redeployment, a self-healing bootstrap immediately rehydrates all future timestamps from PostgreSQL.


## Related topics

- [WooAuto: The 24/7 Autopilot](/wooauto/overview.md)
- [Hardware Safeguards & Blocklists](/security/hardware-safeguards.md)
- [Introduction](/introduction.md)
- [Frequently Asked Questions](/faq.md)
- [AI Context & Tone of Voice](/tma/ai-tone-of-voice.md)
