---
title: Factories
description: A factory is a Foreman agent and its specialists, working on one GitLab repository.
---

Every run happens in a factory. A factory has:

- **Foreman**, the lead agent you hand work to, and the specialists it delegates to. See [Agents](/agents).
- An optional GitLab repository it works on.
- Its own Slack app and Linear teams. See [Integrations](/integrations).
- [Automations](/automations) that start runs for you.
- A dashboard, and an optional monthly budget.

Factories are shared across the workspace. Everyone who signs in can see and use every factory.

## Create a factory

Select the **New factory** (+) button in the sidebar, or **New factory** on the **Factories** page.

1. **Set up your factory**

    Give it a name, up to 60 characters and different from every other factory's name. The avatar and description are optional.

2. **Connect a repository**

    Pick the GitLab project the factory works on. The first time, select **Connect** and sign in to GitLab. That one sign-in is shared by the whole workspace, and factories can work on any project that account can see.

    You can skip this step and work without a repository, but you can only pick a repository now, not later.

3. **Configure agents**

    Check Foreman's handle. People mention `@handle` in Slack to hand it work. It's made from the factory name and must be 2–32 lowercase letters, numbers or hyphens, starting with a letter. You can't change it after this step.

    Turn off any specialists you don't need, and Foreman covers their work. A specialist you turn off can't be turned back on later.

    Select **Create factory**. The factory exists from this point.

4. **Add to your team**

    Optionally, connect Slack so people can mention `@handle` in any channel or send it a DM. You can do this later in the factory's settings.

5. **Connect an issue tracker**

    Optionally, connect Linear and choose the teams whose issues start runs in this factory. A Linear team can belong to only one factory.

The factory's dashboard opens when you finish. If you picked a repository, Foreman starts a run straight away to get to know it. It explores the project without changing anything, then reports what the project does, its stack and structure, and how to install, run, build and test it.

## Dashboard

Each factory's **Dashboard** covers the last 7, 14 or 30 days.

**Overview** shows:

- how many runs are running and how many are waiting on someone
- runs finished, success rate and median cycle time, compared with the previous period
- a daily chart of complete, failed and cancelled runs
- **Needs your attention**: the blocked runs, plus failed runs from the period
- where runs came from, and how each agent performed

**Spending** shows the model cost of the factory's runs in US dollars: totals, cost per run, spend per day, spend by agent and by model, and the most expensive runs. With a monthly budget set, it also shows how much of the budget is used and whether spending is on pace to stay under it.

## Settings

**General** holds the factory's avatar, name and monthly budget. The budget is for tracking only, and runs keep going after spending passes it. Foreman's handle is shown but locked.

**Integrations** connects Linear and Slack, and shows the GitLab repository the factory works on. See [Integrations](/integrations).

**Danger zone** has **Delete factory**. Deleting a factory removes its agents, automations, settings and Slack app, and it can't be undone. Its runs stay under **Runs**.
