> For the complete documentation index, see [llms.txt](https://docs.origami.tech/llms.txt). Markdown versions of documentation pages are available by appending `.md` to page URLs; this page is available as [Markdown](https://docs.origami.tech/bots/lifecycle.md). Agents can also search and read this documentation through its [MCP server](https://docs.origami.tech/~gitbook/mcp).

# Bot lifecycle

What Start, Stop and Delete do for grid and Lua bots — open orders, positions, statuses, and how to stop cleanly.

A bot is either **Active** or **Stopped**; **Pending** shows for the second or two while a change is applied. Start and stop are the same action from every place in the app — the Bots page, the bot header (**Run** / **Stop**) and the **Bots** widget in the Terminal.

## Grid bots (Spot and Futures)

| Action              | Bot                                                                                           | Open orders                                                                                           | Position (futures)                                                          |
| ------------------- | --------------------------------------------------------------------------------------------- | ----------------------------------------------------------------------------------------------------- | --------------------------------------------------------------------------- |
| **Run** / **Start** | Begins the cycle: evaluates every enabled grid, places orders. Needs at least one saved grid. | Placed on the first cycle                                                                             | Opened by fills                                                             |
| **Stop**            | Ends the cycle.                                                                               | Cancelled by the bot — only the orders it placed itself; manual orders on the same pair are untouched | **Left open**. Close it manually or with a Reduce-Only grid before stopping |
| Grid switch off     | Stops one grid; the bot keeps running the others.                                             | That grid's orders are cancelled on the next cycle                                                    | Unchanged                                                                   |
| **Delete Bot**      | Stops the bot and removes it with its grids and error log. *This action can't be undone.*     | Cancelled as on Stop                                                                                  | **Left open**                                                               |

{% hint style="warning" %}
Stopping or deleting a futures bot does not close its position. Check [Open Positions](https://docs.origami.tech/terminal/positions.md) after stopping and close what should not stay open.
{% endhint %}

Editing while running: arguments saved with **Save** take effect on the next cycle; the bot is not restarted. Switching a grid between **Long** and **Short** requires a stopped bot.

## Lua bots

Lua bots do **not** cancel orders on stop. **Stop bot** stops the process and leaves open orders on the exchange; **Delete Lua bot** stops the process and deletes its strategies, orders stay. To stop cleanly, disable each strategy first with an error policy that cancels orders, or cancel in [Active Orders](https://docs.origami.tech/terminal/active-orders-and-history.md). Details in [Lua bot](https://docs.origami.tech/bots/lua-bot.md#start-stop-reset-delete).

## Bulk start and stop

On the Bots page select several bots and use **Start** / **Stop** / **Delete** in the toolbar; confirm **Are you sure you want to … the selected bot(s)?**. In the Terminal **Bots** widget the same toolbar shows progress toasts — **Starting 0/N…**, **N bot(s) started**, **N started, M failed**. A failed bot keeps its previous state; open its **Error Log** to see why.

## Statuses

| Status      | Meaning                                                                                                                |
| ----------- | ---------------------------------------------------------------------------------------------------------------------- |
| **Active**  | The bot is running its cycle.                                                                                          |
| **Stopped** | Not running. Orders it placed have been cancelled.                                                                     |
| **Pending** | A start or stop request is being applied. If it stays for more than a minute, reload the page and check **Error Log**. |

## Checklist before stopping a bot for good

1. Open **Simulate** to see which levels are live, then **Stop**.
2. Check **Active Orders** filtered by the bot's name — nothing should remain.
3. Futures: check **Open Positions** and close the position if needed.
4. Save the grids as a [preset](https://docs.origami.tech/bots/presets.md) if you may want them again, then **Delete Bot**.

## Related

* [Bots overview](https://docs.origami.tech/bots/overview.md)
* [Error Log](https://docs.origami.tech/bots/overview.md#error-log)
* [Active Orders and Orders History](https://docs.origami.tech/terminal/active-orders-and-history.md)
