> For the complete documentation index, see [llms.txt](https://docs.maiagent.ai/llms.txt). Markdown versions of documentation pages are available by appending `.md` to page URLs; this page is available as [Markdown](https://docs.maiagent.ai/maiagent-user-guide/maiagent-user-guide-en/agent-builder/schedule/schedule-setup.md).

# How to Set Up Agent Schedule

{% hint style="info" %}
This page demonstrates how to create an agent schedule. If you're not yet familiar with what agent scheduling does, read [Agent Scheduling](/maiagent-user-guide/maiagent-user-guide-en/agent-builder/schedule.md) first.
{% endhint %}

## Prerequisites <a href="#prerequisites" id="prerequisites"></a>

Before creating a schedule, confirm the following:

1. **You have created an AI assistant in Agent mode** — Agent scheduling only supports AI assistants in Agent mode. Non-Agent mode assistants will not appear in the dropdown.
2. **The AI assistant is connected to at least one conversation platform** — The schedule uses a conversation platform as its container to run the Agent.
3. **You have Agent Scheduling access** — If you don't see the "Agent Scheduling" menu, contact your organization admin to check permission settings.

## Navigate to Agent Scheduling <a href="#navigate-to-schedule" id="navigate-to-schedule"></a>

From the left menu, click <mark style="color:blue;">AI Features</mark> → <mark style="color:blue;">Agent Scheduling</mark>. You'll see the schedule list:

Column descriptions:

| Column             | Description                                                                                    |
| ------------------ | ---------------------------------------------------------------------------------------------- |
| **Name**           | The schedule's identifier                                                                      |
| **AI Assistant**   | The AI assistant used by this schedule                                                         |
| **Execution Mode** | Context mode or independent mode                                                               |
| **Schedule**       | Schedule type (Cron, interval, one\_shot) and timing                                           |
| **Delivery**       | 💬 = send to conversation, 🔗 = Webhook, `auto` = automatically created dedicated conversation |
| **Last Execution** | Time of the most recent execution                                                              |
| **Status**         | Active / Paused                                                                                |

## Create a Schedule <a href="#create-schedule" id="create-schedule"></a>

### 1. Click New Schedule <a href="#step-new-schedule" id="step-new-schedule"></a>

Click the <mark style="color:blue;">New Schedule</mark> button in the upper-right corner to open the form. The form has four tabs: **Basic Info**, **Prompt**, **Schedule Settings**, and **Delivery Settings**.

### 2. Fill in Basic Info <a href="#step-basic-info" id="step-basic-info"></a>

| Field                       | Required | Description                                                                                                                                                                              |
| --------------------------- | -------- | ---------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- |
| **AI Assistant**            | ✅        | Select an existing AI assistant (only Agent mode assistants are shown)                                                                                                                   |
| **Name**                    | ✅        | The schedule's identifier, e.g., "Daily Customer Service Summary"                                                                                                                        |
| **Execution Mode**          | ✅        | Choose context mode or independent mode                                                                                                                                                  |
| **Conversation Platform**   | ✅        | The conversation platform container used during execution; context mode uses it to accumulate Agent memory (used internally — it won't appear in the customer service conversation list) |
| **Save Results to Context** | —        | Only shown in context mode. **Only affects memory for the next execution** (doesn't affect whether you can view results — all past responses are retained on the execution log page)     |

**How to choose the execution mode?**

* **Context mode**: Retains memory across executions. Suitable for tasks that need to accumulate information, such as continuously tracking complaint resolution progress or monitoring data trends.
* **Independent mode**: Starts fresh each time with no previous memory. Suitable for standalone recurring tasks, such as daily reports or periodic statistics.

{% hint style="warning" %}
**The AI Assistant, Execution Mode, and Conversation Platform fields cannot be changed after creation.** To change them, you must delete the schedule and create a new one. Other fields (name, prompt, schedule time, delivery method) can be edited at any time.
{% endhint %}

### 3. Write the Prompt <a href="#step-prompt" id="step-prompt"></a>

In the prompt field, describe what the Agent should do **each time it runs**. The prompt is sent to the Agent as its instruction, and the Agent will use its attached tools and skills to complete the task.

**Prompt example:**

```
Query all unresolved customer complaints from the past 24 hours,
sort them by priority, and compile a bullet-point summary.
If there are any "High" priority cases, mark them with "⚠️ Urgent".
```

Tips for writing prompts:

* Clearly describe the task objective and output format
* If you need the Agent to use a specific tool, guide it in the prompt (e.g., "Query the orders table in the database")
* Avoid relying on external state beyond the current time; each execution should be an independent task (unless using context mode)

### 4. Configure Schedule Timing <a href="#step-schedule-config" id="step-schedule-config"></a>

There are three schedule types:

{% tabs %}
{% tab title="Cron" %}
Use a standard 5-field cron expression to set a precise schedule: `minute hour day month weekday`.

| Expression    | Meaning                              |
| ------------- | ------------------------------------ |
| `0 9 * * 1-5` | Monday through Friday at 9:00 AM     |
| `0 */2 * * *` | Every 2 hours on the hour            |
| `30 8 * * *`  | Every day at 8:30 AM                 |
| `0 0 1 * *`   | First day of every month at midnight |

Must be paired with the "Timezone" field, which defaults to `Asia/Taipei` (Taipei time).
{% endtab %}

{% tab title="Interval" %}
Execute once every fixed interval, configured by combining four fields — days/hours/minutes/seconds:

* The interval must be **at least 1 second**
* For example, to run "every 30 minutes," enter `30` in the "Minutes" field and `0` in all others
* Interval mode does not use the timezone field (since it's a relative time, not an absolute time)
  {% endtab %}

{% tab title="One-time" %}
Execute once at a specified time, after which the schedule automatically ends:

* Select a date and time precise to the second
* Must be paired with the "Timezone" field
* After execution, the schedule remains in the list for viewing records but will not run again
  {% endtab %}
  {% endtabs %}

**Other fields:**

| Field                  | Description                                                                                                                           |
| ---------------------- | ------------------------------------------------------------------------------------------------------------------------------------- |
| **Enabled**            | Whether to activate the schedule immediately. When off, the schedule is "Paused" and won't trigger                                    |
| **Maximum Executions** | Limit the maximum number of times the schedule runs; it will automatically pause when the limit is reached. Leave empty for unlimited |

### 5. Configure Delivery <a href="#step-delivery" id="step-delivery"></a>

Where should the results go after execution? Configure this in this tab.

{% hint style="info" %}
This tab configures **where results are actively pushed to** (specified conversations, Webhook endpoints). Even if you don't set any delivery targets, the complete results of each execution are still retained on the <mark style="color:blue;">Execution Log</mark> page — they just won't be actively pushed elsewhere.
{% endhint %}

#### Conversation <a href="#delivery-conversation" id="delivery-conversation"></a>

Click <mark style="color:blue;">Add Conversation</mark> and select a conversation from the dropdown. Results will be sent as a bot message. You can add multiple conversations.

#### Webhook <a href="#delivery-webhook" id="delivery-webhook"></a>

Click <mark style="color:blue;">Add Webhook URL</mark>. Results will be sent as a POST request to your external URL (must start with `http://` or `https://`). Common use cases:

* Integrate with Slack / Discord / LINE
* Write to your own system for further processing
* Trigger other automation workflows

{% hint style="warning" %}
It's fine not to set any delivery targets — execution results are always retained on the <mark style="color:blue;">Execution Log</mark> page. But if you want your team/colleagues to passively receive results (e.g., push to Slack), you need to set at least one conversation or Webhook, otherwise no one will be notified.
{% endhint %}

### 6. Save and Enable <a href="#step-save" id="step-save"></a>

Click <mark style="color:blue;">Confirm</mark> to save. If the "Enabled" toggle is on, the schedule will immediately start triggering according to the configured timing.

## What Happens After Saving? <a href="#after-save" id="after-save"></a>

After the schedule is saved successfully, you'll immediately see the following:

1. **The modal closes and the schedule appears in the list**
   * Status shows "Active" (green tag), or "Paused" (if the enabled toggle was off)
   * The "Last Execution" column is empty until the first trigger, after which it updates with the execution time
2. **The system does two things in the background** (no UI changes visible, but happening behind the scenes)
   * Registers the schedule with the backend scheduler to automatically trigger at the configured time
   * Context mode also creates an internal system conversation container to accumulate Agent memory (this container won't appear in the <mark style="color:blue;">Customer Service Conversations</mark> list)
3. **Wait for the schedule to trigger**
   * **Cron / Interval**: Executes automatically at the configured time, e.g., cron `0 9 * * 1-5` triggers at the next Monday–Friday 9:00 AM
   * **One-time**: Executes once at the configured time
   * Don't want to wait? Click the ▶️ <mark style="color:blue;">Run Now</mark> button in the list to trigger an immediate execution for testing
4. **During execution**
   * The list status remains "Active," and the "Last Execution" column updates with each run
   * Each execution creates a record on the <mark style="color:blue;">Execution Log</mark> page (with the complete Agent response)
   * If you added conversations or Webhooks in "Delivery Settings," results are also sent to those targets
   * For details on where to view results, see [Where Do Results Go?](#where-results-go) below
5. **When the task ends**
   * Reaches the "Maximum Executions" limit → automatically switches to "Paused" and stops triggering
   * One-time execution completes → the schedule remains in the list but won't trigger again

## Where Do Results Go? <a href="#where-results-go" id="where-results-go"></a>

After a schedule runs, the Agent's response appears in the following locations. **The Execution Log page is the primary entry point for viewing history** — regardless of execution mode, every run leaves a complete record here. Other locations depend on your delivery settings.

### 1. Execution Log Page (Primary Entry Point) <a href="#result-execution-log" id="result-execution-log"></a>

Each execution generates a record. This is the most reliable way to view historical results.

**How to access:**

<mark style="color:blue;">Agent Scheduling</mark> list → Click 🕘 <mark style="color:blue;">View Execution Log</mark> on the schedule's row → Enter the execution history page → Click 👁 <mark style="color:blue;">View Details</mark> on a specific record

**You'll see:**

* Execution status (Success / Failed / Partial Success)
* Start time, completion time
* Complete Agent response (even if subsequent delivery failed, the content is still preserved here)
* Error messages on failure

### 2. Your Specified Conversations (Conversations Added in Delivery Settings) <a href="#result-target-conversations" id="result-target-conversations"></a>

Execution results are sent as Agent messages into these conversations, just like messages seen by customers/colleagues.

**How to find:**

<mark style="color:blue;">Customer Service Conversations</mark> → Enter the conversation you added in delivery settings → The message will be at the latest position.

### 3. Webhook URLs (URLs Added in Delivery Settings) <a href="#result-webhooks" id="result-webhooks"></a>

Execution results are sent as HTTP POST to your external URL. **Body is JSON**:

```json
{
  "content": "Complete response content generated by the Agent"
}
```

**Technical details:**

* Content-Type: `application/json`
* Timeout: 30 seconds (the Webhook endpoint must respond with 2xx within 30 seconds, otherwise it's treated as failed)
* Failures are recorded in the execution log's "Error Message" field (execution log status becomes "Partial Success"), but no retry is attempted

### What Does the "Save Results to Context" Toggle Do? <a href="#save-context-effect" id="save-context-effect"></a>

This toggle **only affects the memory for the next execution in context mode** — it doesn't affect whether you can view results.

| Setting          | Effect on Next Execution                                                                                                                        |
| ---------------- | ----------------------------------------------------------------------------------------------------------------------------------------------- |
| **On** (default) | The previous prompt and Agent response are carried forward as conversation history for the next run, allowing the Agent to continue the context |
| **Off**          | No messages are retained per execution, effectively behaving like independent mode                                                              |

Regardless of the toggle state, **the Execution Log page always retains the complete response from each run** — this toggle doesn't affect your ability to view history.

### Summary: Results Visibility Reference Table <a href="#result-summary" id="result-summary"></a>

| Execution Mode / Setting                         | Execution Log | Specified Conversations | Webhook         | Agent Cross-run Memory |
| ------------------------------------------------ | ------------- | ----------------------- | --------------- | ---------------------- |
| Context mode + Save results to context (default) | ✅             | ✅ If configured         | ✅ If configured | ✅ With memory          |
| Context mode + Don't save results                | ✅             | ✅ If configured         | ✅ If configured | ❌ No memory            |
| Independent mode                                 | ✅             | ✅ If configured         | ✅ If configured | ❌ No memory            |

{% hint style="info" %}
**Why is there no "Dedicated Conversation" entry point?** Context mode creates a dedicated backend conversation to accumulate memory, but this conversation **currently does not appear in the&#x20;**<mark style="color:blue;">**Customer Service Conversations**</mark>**&#x20;list** — it's an internal system container, not a conversation for human agents to handle. To view historical results, go to the <mark style="color:blue;">Execution Log</mark>.
{% endhint %}

## Full Example: Daily Customer Service Summary <a href="#example-daily-summary" id="example-daily-summary"></a>

Below is an end-to-end example showing how to create a schedule that automatically compiles the previous day's customer service summary every morning at 9:00 AM and sends the results to Slack.

### Scenario <a href="#example-scenario" id="example-scenario"></a>

Every morning before work, you want the AI assistant to compile all unresolved complaints from yesterday, create a summary, and send it to the team's Slack #customer-support channel so the customer service manager can see it as soon as they open Slack.

### Preparation <a href="#example-prerequisites" id="example-prerequisites"></a>

* An AI assistant in Agent mode, with tools attached that can query complaint data (e.g., database tool or customer service system API tool)
* A connected conversation platform (as the schedule's execution container)
* A Slack incoming webhook URL (to receive results)

### Configuration <a href="#example-config" id="example-config"></a>

**Basic Info:**

| Field                 | Value                                                                                   |
| --------------------- | --------------------------------------------------------------------------------------- |
| AI Assistant          | `Customer Service AI Manager`                                                           |
| Name                  | `Daily Complaint Summary - 9:00`                                                        |
| Execution Mode        | Independent mode (compile independently each day, no need to remember the previous day) |
| Conversation Platform | `Internal Customer Service`                                                             |

**Prompt:**

```
Query all customer complaints with status "Unresolved" or "In Progress"
from the past 24 hours (ending at today's midnight),
sort by priority (High → Medium → Low) and compile a summary:

## Format
### 🔴 High Priority (X cases)
- [#Case ID] Customer Name — one-line description

### 🟡 Medium Priority (X cases)
...

### 🟢 Low Priority (X cases)
...

End with a summary line: "Total X cases pending, of which X high-priority cases need to be handled today."
```

**Schedule Settings:**

* Schedule type: `Cron`
* Cron expression: `0 9 * * 1-5` (Monday through Friday at 9:00 AM)
* Timezone: `Asia/Taipei`
* Enabled: On
* Maximum executions: Leave empty (run continuously)

**Delivery Settings:**

* Conversation: Don't add extra conversations (the Execution Log page already retains the Agent's complete output — no need to send it to a customer service conversation and take up space)
* Webhook URL: `https://hooks.slack.com/services/T00000000/B00000000/XXXXXXXX`

### After Saving <a href="#example-after-save" id="example-after-save"></a>

1. **Monday at 9:00 AM (first trigger)**: The schedule triggers automatically and the Agent starts querying and compiling
2. **Within \~30 seconds (depending on Agent processing speed)**:
   * The team's Slack #customer-support channel receives the summary via Webhook push (POST body is `{"content": "..."}`)
   * The "Last Execution" in the schedule list updates to `2026-04-20 09:00:12`
3. **Want to review what the Agent produced?** Two places:
   * **Execution Log page** (primary entry): <mark style="color:blue;">Agent Scheduling</mark> → Click the schedule's 🕘 → Click 👁 → View the complete bot response and token usage
   * **Slack**: Go directly to the #customer-support channel (this is the Webhook endpoint you configured)
4. **Tuesday, Wednesday… ongoing execution**: Triggers automatically every weekday at 9:00 AM with no further human intervention needed

### Troubleshooting <a href="#example-troubleshooting" id="example-troubleshooting"></a>

* **Slack didn't receive a message** → First check the Execution Log page to confirm the execution status. If "Failed," check the error message. If "Success" but Slack didn't receive it, verify the Webhook URL is correct and check for Slack rate limits
* **Summary content doesn't match expectations** → Check the Agent's actual output in the execution log details, then adjust the prompt
* **Schedule didn't trigger** → See the "FAQ" section below

## Manage Existing Schedules <a href="#manage-schedules" id="manage-schedules"></a>

Back in the schedule list, the action area on the right side of each row provides these functions:

| Icon   | Function               | Description                                                                              |
| ------ | ---------------------- | ---------------------------------------------------------------------------------------- |
| ✏️     | **Edit**               | Modify schedule content (except AI Assistant, Execution Mode, and Conversation Platform) |
| 🕘     | **View Execution Log** | Enter the schedule's execution history page                                              |
| ▶️     | **Run Now**            | Trigger an immediate execution without waiting for the scheduled time                    |
| ⏸️ / ⏻ | **Pause / Enable**     | Toggle the schedule's active status                                                      |
| 🗑     | **Delete**             | Delete the schedule. Execution logs are also removed                                     |

### Run Now <a href="#run-now" id="run-now"></a>

"Run Now" is the fastest way to test if a schedule is configured correctly. After clicking:

1. The system triggers an immediate execution without affecting the original schedule timing
2. A "Schedule triggered" notification appears
3. Check "View Execution Log" to observe the execution results

### Pause and Enable <a href="#pause-resume" id="pause-resume"></a>

After pausing, the schedule won't trigger, but settings and execution logs are preserved. You can re-enable it at any time.

## View Execution Logs <a href="#view-executions" id="view-executions"></a>

Click the 🕘 icon in the list to enter the execution log page:

### Filters <a href="#filter-executions" id="filter-executions"></a>

* **Status**: Pending / Running / Success / Failed
* **Date Range**: Specify start and end dates

### Column Descriptions <a href="#execution-fields" id="execution-fields"></a>

| Column              | Description                                                                 |
| ------------------- | --------------------------------------------------------------------------- |
| **Status**          | Pending (queued), Running, Success, Failed                                  |
| **Start Time**      | When the Agent started execution                                            |
| **Completion Time** | When execution ended                                                        |
| **Error Message**   | If execution failed, displays the error reason                              |
| **Bot Response**    | Response content generated by the Agent (full content available in details) |

### View Execution Details <a href="#execution-detail" id="execution-detail"></a>

Click the 👁 icon on the right side of each row to open the details modal, where you can view the complete bot response and error messages:

## FAQ <a href="#faq" id="faq"></a>

<details>

<summary>Why didn't the schedule trigger?</summary>

Possible reasons:

1. The schedule status is "Paused" — check the status column in the list
2. The "Maximum Executions" limit has been reached — the schedule auto-pauses
3. The cron expression or timezone setting is incorrect — check in the edit page
4. One-time execution mode has already run — one-time schedules only trigger once

Try using "Run Now" first to confirm the schedule itself can execute correctly, then troubleshoot the timing settings.

</details>

<details>

<summary>Why can't I find my AI assistant in the dropdown?</summary>

Agent scheduling **only supports Agent mode** AI assistants. If your assistant is in Chatbot mode or another mode, it won't appear in the dropdown. Go to the AI Assistant settings page to confirm the mode, then come back to create the schedule.

</details>

<details>

<summary>The schedule ran — where do I see what the Agent produced?</summary>

The primary entry point is <mark style="color:blue;">Agent Scheduling</mark> → Click the schedule's 🕘 <mark style="color:blue;">View Execution Log</mark> → Click a record's 👁. The details will show the Agent's complete response.

If you've set delivery targets (conversation/Webhook), a copy is also sent there:

* Specified conversations: Go directly to that conversation to view the message
* Webhook: Check the POST body at your external endpoint

</details>

<details>

<summary>After turning on "Save Results to Context," where do I see that conversation?</summary>

**This toggle doesn't affect whether you can see results** — all past responses are always retained on the Execution Log page.

It only affects "whether the Agent remembers what happened last time when it runs next":

* On (default): The Agent uses the same backend conversation container to accumulate memory, and can continue the context on the next execution
* Off: No messages are retained per execution, effectively behaving like independent mode

This backend conversation container currently doesn't appear in the <mark style="color:blue;">Customer Service Conversations</mark> list — it's used internally by the system, not meant for human agents to handle.

</details>

<details>

<summary>What's the data format received by Webhook?</summary>

POST request with Content-Type `application/json`, body structure:

```json
{
  "content": "Complete response content generated by the Agent (plain text)"
}
```

30-second timeout, no retry. The Webhook endpoint should respond with a 2xx status code within 30 seconds, otherwise the delivery is recorded as failed (but the Execution Log page still retains the Agent's complete response).

</details>

<details>

<summary>Independent mode vs. context mode — what's the actual difference?</summary>

The biggest difference is **whether the Agent can see the conversation history from previous runs when it executes**:

* **Context mode**: Uses the same backend conversation to accumulate messages. On the next execution, the Agent can see the prompts and responses from previous runs, allowing it to continue its analysis (suitable for tasks that need to track trends, avoid duplicates, or accumulate context)
* **Independent mode**: Creates a temporary conversation each time, deleted immediately after execution. The Agent starts from scratch every time with no knowledge of what happened before (suitable for tasks with independent daily output, such as daily reports)

The execution results from both modes **are saved on the Execution Log page** — the difference isn't "whether you can view history," but "whether the Agent carries memory while working."

</details>

## Further Reading <a href="#related" id="related"></a>

* [Agent Scheduling](/maiagent-user-guide/maiagent-user-guide-en/agent-builder/schedule.md) — Conceptual introduction to agent scheduling
* [Agent (AI Assistant)](/maiagent-user-guide/maiagent-user-guide-en/agent-builder/agent.md) — Create an AI assistant in Agent mode
* [Platform Integration: Website](/maiagent-user-guide/maiagent-user-guide-en/conversations/web-chat/website.md) — Set up a conversation platform (using website as an example)


---

# Agent Instructions
This documentation is published with GitBook. GitBook is the documentation platform designed so that both humans and AI agents can read, navigate, and reason over technical content effectively. Learn more at gitbook.com.

## Querying This Documentation
If you need additional information that is not directly available in this page, you can query the documentation dynamically by asking a question.

Perform an HTTP GET request on the current page URL with the `ask` query parameter, and the optional `goal` query parameter:

```
GET https://docs.maiagent.ai/maiagent-user-guide/maiagent-user-guide-en/agent-builder/schedule/schedule-setup.md?ask=<question>&goal=<endgoal>
```

`ask` is the immediate question: it should be specific, self-contained, and written in natural language.
`goal` is optional and describes the broader end goal you are ultimately trying to accomplish on behalf of the user. GitBook uses it to tailor the answer towards what is most useful for that goal.

The response will contain a direct answer to the question and relevant excerpts and sources from the documentation.

Use this mechanism when the answer is not explicitly present in the current page, you need clarification or additional context, or you want to retrieve related documentation sections.
