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

# Scheduler

> Automate recurring tasks with scheduled agent actions.

The Scheduler lets you set up recurring tasks that agents execute automatically. Create daily reports, weekly analyses, periodic checks, and any automated workflow.

## How Scheduling Works

Scheduled tasks use CRON expressions powered by BullMQ. When a schedule triggers:

1. The system creates a new conversation thread
2. The assigned agent receives the task prompt
3. The agent executes using its configured tools and knowledge
4. Results are saved and optionally sent to connected services

## Creating a Schedule

You can create schedules directly in conversation:

> "Schedule a weekly market analysis report every Monday at 9am"

Or through the Scheduler interface:

<Steps>
  <Step title="Open Scheduler">
    Navigate to the **Scheduler** section in the sidebar.
  </Step>

  <Step title="Create new schedule">
    Click **New Schedule** and configure:

    <ParamField body="prompt" type="string" required>
      The task instruction the agent will execute each time.
    </ParamField>

    <ParamField body="schedule" type="string" required>
      CRON expression (e.g., `0 9 * * 1` for every Monday at 9am).
    </ParamField>

    <ParamField body="agent" type="string" required>
      Which agent should execute this task.
    </ParamField>
  </Step>

  <Step title="Review and activate">
    Review the schedule preview and click **Activate**.
  </Step>
</Steps>

## Common CRON Patterns

| Pattern       | Schedule                            |
| ------------- | ----------------------------------- |
| `0 9 * * *`   | Every day at 9:00 AM                |
| `0 9 * * 1`   | Every Monday at 9:00 AM             |
| `0 */6 * * *` | Every 6 hours                       |
| `0 9 1 * *`   | First day of every month at 9:00 AM |
| `0 9 * * 1-5` | Weekdays at 9:00 AM                 |

## Managing Schedules

* **Pause** a schedule without deleting it
* **Edit** the prompt, timing, or assigned agent
* **View history** of past executions and results
* **Delete** schedules you no longer need

## Execution History

Each execution is logged with:

* Timestamp and duration
* Agent response and artifacts
* Status (success, error, timeout)

<Tip>
  Start with simple schedules and iterate. You can modify the prompt and timing at any time.
</Tip>
