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

# Automated Tasks

> Schedule AI Agent to execute tasks automatically at specified times

## Overview

Zeus's automated tasks allow you to schedule the AI Agent to execute prompts at specified times — whether it's a daily report, weekly code review, or a one-time data processing task. Once a task completes, Zeus notifies you of the results via email, Feishu, or in-app notification.

***

## Creating a Task

Navigate to **Settings > Automated Tasks** to create a new scheduled task. Each task requires the following configuration:

### Basic Settings

| Setting       | Description                                                                          |
| ------------- | ------------------------------------------------------------------------------------ |
| **Title**     | A descriptive name for the task                                                      |
| **Prompt**    | The instruction the Agent will execute — just like sending a message in chat         |
| **Connector** | Optional — bind a Browser or Desktop connector for tasks that require UI interaction |

### Schedule Settings

| Setting            | Options                              | Description                                     |
| ------------------ | ------------------------------------ | ----------------------------------------------- |
| **Scheduled Date** | Date picker                          | The date for the first (or only) execution      |
| **Scheduled Time** | Time picker (e.g. "09:00")           | The time of day to execute                      |
| **Timezone**       | User's timezone                      | Ensures the task runs at the correct local time |
| **Repeat Type**    | No repeat / Daily / Weekly / Monthly | How often the task should recur                 |

### Run Mode

| Mode                     | Behavior                                                                        |
| ------------------------ | ------------------------------------------------------------------------------- |
| **Auto-proceed**         | The Agent executes autonomously — no user intervention needed                   |
| **Require confirmation** | The Agent pauses before sensitive operations and waits for your approval (HITL) |

### Notification Settings

Configure how you want to be notified when a task completes:

| Channel    | Description                                         |
| ---------- | --------------------------------------------------- |
| **Email**  | Receive execution results via email                 |
| **Feishu** | Receive a message through Feishu integration        |
| **In-App** | View results in the notification center within Zeus |

You can enable multiple notification channels simultaneously.

***

## Task Lifecycle

A scheduled task goes through the following states:

```mermaid theme={null}
stateDiagram-v2
    [*] --> Pending: Created
    Pending --> Running: Scheduled time reached
    Running --> Completed: Execution succeeded
    Running --> Failed: Execution error
    Pending --> Paused: User pauses
    Paused --> Pending: User resumes
    Pending --> Cancelled: User cancels
    Completed --> Pending: Recurring task reschedules
```

| Status        | Description                                                    |
| ------------- | -------------------------------------------------------------- |
| **Pending**   | Task is scheduled and waiting for the next execution time      |
| **Running**   | The Agent is currently executing the task                      |
| **Completed** | Execution finished successfully — results are available        |
| **Failed**    | Execution encountered an error — error details are available   |
| **Paused**    | Task is temporarily suspended — will not execute until resumed |
| **Cancelled** | Task has been permanently cancelled                            |

For recurring tasks, the status automatically returns to **Pending** after each successful execution, with the next run time updated accordingly.

***

## Viewing Results

After a task completes, you can view the execution results in two ways:

1. **Notification** — Check the notification you received (email, Feishu, or in-app) for a summary
2. **Task Detail** — Click on the task in the task list to see the full Agent session, including all messages, tool calls, and outputs

Each execution creates a dedicated session, so you have a complete history of every run.

***

## Managing Tasks

From the **Automated Tasks** page, you can:

* **Edit** — Update the prompt, schedule, or notification settings of an existing task
* **Pause / Resume** — Temporarily suspend a task without deleting it
* **Delete** — Permanently remove a task and its schedule
* **View History** — See past execution results, run count, and last/next run times

***

## Use Cases

| Scenario                  | Example Prompt                                                              | Schedule                |
| ------------------------- | --------------------------------------------------------------------------- | ----------------------- |
| **Daily Standup Summary** | "Summarize yesterday's GitHub commits and open PRs for our team"            | Daily, 9:00 AM          |
| **Weekly Report**         | "Generate a weekly progress report based on completed Jira tickets"         | Weekly, Monday 10:00 AM |
| **Data Monitoring**       | "Check the error rate dashboard and alert me if it exceeds 5%"              | Daily, every 6 hours    |
| **Content Publishing**    | "Draft and publish today's social media post based on our content calendar" | Daily, 8:00 AM          |
| **Code Review Reminder**  | "List all PRs that have been open for more than 48 hours without review"    | Daily, 2:00 PM          |

***

## Architecture

The automation system is built on a two-component architecture:

```mermaid theme={null}
flowchart LR
    subgraph Web["Web (Next.js)"]
        UI["Task Management UI"]
        API["API & Database"]
    end

    subgraph Backend["AI Backend (Python)"]
        Scheduler["Scheduler"]
        Agent["Agent Execution"]
        Notify["Notifications"]
    end

    UI -->|"Create / Edit / Delete"| API
    API -->|"Sync schedule"| Scheduler
    Scheduler -->|"Trigger at scheduled time"| Agent
    Agent -->|"Update results"| API
    Agent -->|"Send notification"| Notify
```

| Component               | Responsibility                                              |
| ----------------------- | ----------------------------------------------------------- |
| **Web (Next.js)**       | Task CRUD, user authentication, result storage              |
| **AI Backend (Python)** | Schedule management, Agent execution, notification delivery |

**Reliability**: When the AI Backend restarts, it automatically syncs all pending tasks from the Web API, ensuring no scheduled tasks are lost.
