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

# Agent Tasks

> Run your AI agents automatically — on a schedule, on demand, or when something happens

Agent Tasks let you attach automation to any agent. Instead of opening Mantle Chat and typing a prompt, a task fires
your agent automatically and puts the output exactly where you need it.

<CardGroup cols={3}>
  <Card title="Triggers" icon="bolt" href="/features/triggers">
    When the task runs
  </Card>

  <Card title="Instructions" icon="pen-line">
    What the agent does
  </Card>

  <Card title="Output" icon="arrow-right">
    Where the result goes
  </Card>
</CardGroup>

***

## How tasks connect to agents

Every agent in Mantle can have one or more tasks. Think of an agent as the **who** (the AI with specific skills and
tools) and a task as the **what + when**:

```
Agent: "Research Assistant"
  ├── Task: "Daily digest"        → runs every morning at 9am → posts to #research
  ├── Task: "Weekly summary"      → runs every Monday → creates a new chat
  └── Task: "Run on demand"       → runs when you press a button → creates a new chat
```

A single agent can power many different automations. Each task has its own:

| Field                 | Description                                            |
| --------------------- | ------------------------------------------------------ |
| **Name**              | A label like "Daily digest" or "Weekly report"         |
| **Task instructions** | Extra prompt added on top of the agent's system prompt |
| **Trigger**           | When the task fires (manual, schedule, event…)         |
| **Output**            | Where the result goes                                  |

***

## Setting up a task

<Steps>
  <Step title="Open an agent">Go to any agent and click the **Tasks** tab.</Step>
  <Step title="Create a new task">Click **+ New task**. Give it a name and optional task-specific instructions.</Step>

  <Step title="Choose a trigger">
    Pick when the task should run. Start with **Manual** if you just want an on-demand button.
  </Step>

  <Step title="Set the output">
    Choose where the agent's response goes: a new private chat, a team channel, or silent (no output).
  </Step>

  <Step title="Save and run">
    Save the task. For manual tasks, use the **Run now** button on the task page to fire it immediately.
  </Step>
</Steps>

***

## Output types

Where does the agent's response go when a task runs?

| Output              | Best for                                                                                       |
| ------------------- | ---------------------------------------------------------------------------------------------- |
| **New chat**        | Reports or summaries you want to read privately                                                |
| **Post to channel** | Team digests, alerts, or updates everyone should see                                           |
| **Silent**          | Background automations that write to external tools (Linear, Notion, etc.) with no chat output |

***

## Task chains

Tasks can trigger other tasks. When one task finishes, it can fire the next — passing its output along.

```
Researcher agent          Editor agent           Publisher agent
"Fetch weekly data"  ──►  "Summarize draft"  ──►  "Post to #releases"
Schedule: Mon 8am         On complete (success)    On complete (success)
Output: silent            Output: new chat         Output: #releases channel
```

This is how you build **multi-agent pipelines** in Mantle — no visual graph builder needed. Each step is a fully
autonomous agent that reasons, uses tools, and adapts based on what the previous step produced.

<Tip>
  Set **Pass upstream output** in the trigger config to give the downstream agent access to what the previous step
  produced.
</Tip>

<Note>
  Chains are capped at 10 steps deep. One task can trigger at most 5 downstream tasks. Cycles are blocked at save time.
</Note>

***

## Run history

Every task execution creates a run record. You can see the last 20 runs per task:

* **Status** — success, failed, or running
* **Triggered by** — manual press, schedule, or upstream task
* **Duration and token usage**
* **Output link** — jump to the chat or channel message the agent produced
* **Error message** — if something went wrong

***

## Example use cases

<AccordionGroup>
  <Accordion icon="newspaper" title="Daily digest">
    A research agent scrapes your sources every morning and posts a summary to a team channel. You wake up to a briefing without lifting a finger.

    **Trigger**: Schedule — daily at 8am
    **Output**: Post to #daily-digest channel
  </Accordion>

  <Accordion icon="chart-line" title="Weekly report">
    A data agent queries your metrics every Monday and emails a formatted report. Runs silently, posts a link to #reports when done.

    **Trigger**: Schedule — every Monday at 9am
    **Output**: Post to #reports channel
  </Accordion>

  <Accordion icon="hand-pointer" title="On-demand analysis">
    A research agent you run manually when you need a deep-dive. Press "Run now" from the task page, get results in a new chat.

    **Trigger**: Manual
    **Output**: New chat
  </Accordion>

  <Accordion icon="link" title="Multi-step pipeline">
    A researcher fetches data → an editor cleans and structures it → a publisher formats and posts it to the team channel. Three agents, each adding value to the previous step's output.

    **Trigger**: Schedule on the first step, On Complete for steps 2 and 3
    **Output**: Silent → New chat → Post to channel
  </Accordion>

  <Accordion icon="triangle-exclamation" title="Error handling">
    A monitoring agent checks your deployment every 5 minutes. On failure, it fires a different "alert" agent that posts to #incidents with context.

    **Trigger**: Schedule on monitor, On Complete (failure) on alert
    **Output**: Post to #incidents channel
  </Accordion>
</AccordionGroup>

***

<Card title="Trigger types" icon="bolt" href="/features/triggers">
  Learn about all the ways to trigger a task — manual, schedule, on completion, and integrations
</Card>
