---
title: "Creating a factory from an existing definition"
description: "Create a factory from an existing definition in GitHub, GitLab, or Azure DevOps. The repository remains the source of truth for the factory's configuration."
canonical: "https://docs.warp.dev/factories/link-existing-definition/"
---

> For the complete documentation index, see [llms.txt](https://docs.warp.dev/llms.txt).
> Markdown versions of each page are available by appending .md to any URL.

# Creating a factory from an existing definition

Create a factory from an existing definition in GitHub, GitLab, or Azure DevOps. The repository remains the source of truth for the factory's configuration.

If you already have a [factory definition](https://docs.warp.dev/factories/factory-as-code/) in a repository, you can create a factory from it instead of building one from scratch. For example, you might use a definition from [warp-factory-examples](https://github.com/warpdotdev/warp-factory-examples) or one stored in your team’s repository. Warp reads `factory.yaml` and worker definitions to create a factory linked to the repository. Merges to the linked branch update the factory.

The factory takes its name, description, alias, credential strategy, and repositories from `factory.yaml`. The repository that holds the definition is always one of the factory’s repositories, even if `repositories` doesn’t list it.

## Prerequisites

-   A [Warp account](https://app.warp.dev/signup) and membership in a [Warp team](https://docs.warp.dev/factories/teams-and-admin-controls/).
-   Team or workspace admin access, or the team-wide [factory Editor role](https://docs.warp.dev/factories/permissions/).
-   A paid [Warp Factories plan](https://docs.warp.dev/support-and-community/plans-and-billing/plans-pricing-refunds/#warp-factories-plans). Definitions hosted in your own repository aren’t available on the free plan.
-   Access to a GitHub, GitLab, or Azure DevOps repository containing a valid `factory.yaml`. [Validate the definition](https://docs.warp.dev/factories/factory-as-code/#validate-a-definition) before linking it.
-   A top-level [`alias`](https://docs.warp.dev/factories/factory-as-code/#alias) in `factory.yaml` that no other factory in your workspace uses. You can’t add it after the factory is created.

## Creating the factory

Start from the Warp Factories web app sidebar. Linking an existing definition isn’t available during first-time onboarding.

1.  Open the [Warp Factories web app](https://platform.warp.dev). In the sidebar, click **Create factory**.
2.  Select **Link an existing factory definition**, then click **Continue**.
3.  Select **GitHub**, **GitLab**, or **Azure DevOps**, depending on where the definition is stored. If prompted, connect your account.
4.  Select the organization or group that contains the repository. For Azure DevOps, also select the project. Then select the repository containing `factory.yaml`.
5.  Enter the definition’s location:
    -   In “Factory folder,” enter the repository-relative folder containing `factory.yaml`, such as `factories/payments`. Leave this blank if the file is at the repository root.
    -   In “Branch,” enter the branch containing the definition. Leave this blank to use the repository’s default branch. Merges to the selected branch update the factory.
6.  Click **Link and create factory**.

Warp validates the definition, then creates the factory and syncs its worker definitions. The setup summary shows the sync’s progress. Confirm that the sync succeeds before [connecting a source](https://docs.warp.dev/factories/connect-your-factory/) to send work to the factory.

If validation fails, Warp displays errors on the form without creating a factory. If the first sync fails, the factory exists, but its workers aren’t available until a sync succeeds. See [Troubleshooting](#troubleshooting).

To update the factory later, edit the definition in its repository and merge to the linked branch. See [Factory definition as code](https://docs.warp.dev/factories/factory-as-code/#where-the-definition-lives).

## Troubleshooting

**No factory.yaml at the repository root. If it’s in a subfolder, enter that folder.**  
`factory.yaml` isn’t at the root of the repository. Enter the folder that contains it in “Factory folder”.

**No factory.yaml in “FOLDER”.**  
The folder doesn’t exist on the selected branch, or it doesn’t contain `factory.yaml`. Check the folder path and the branch.

**Branch “BRANCH” not found.**  
The branch doesn’t exist in the repository. Check the spelling, or leave “Branch” empty to use the default branch.

**Can’t access OWNER/REPOSITORY. Check that Warp has access to it.**  
Warp can’t read the repository through the connected code host. Make sure the Warp app has access to the repository: see [GitHub](https://docs.warp.dev/factories/integrations/github/), [GitLab](https://docs.warp.dev/factories/integrations/gitlab/), or [Azure DevOps](https://docs.warp.dev/factories/integrations/azure-devops/).

**The factory definition has errors: …**  
`factory.yaml` or its worker files don’t pass validation. The message lists up to five problems with their file and line. Fix them in the repository, then try again. To find every problem at once, [validate the definition locally](https://docs.warp.dev/factories/factory-as-code/#validate-locally-or-in-ci).

**factory.yaml must declare an alias; add a top-level alias to the definition, then try again**  
Add a top-level [`alias`](https://docs.warp.dev/factories/factory-as-code/#alias) to `factory.yaml` on the branch you selected, then try again.

**The alias in this definition is already used by another factory in your workspace.**  
Change `alias` in `factory.yaml` to a value no other factory in your workspace uses, then try again.

**The first sync fails or doesn’t finish**  
The factory was created, but it has no workers until a sync succeeds. Check the repository contents, then click **Try again** on the setup summary to start a new sync.

## Related pages

-   [Factory definition as code](https://docs.warp.dev/factories/factory-as-code/) - Look up the fields `factory.yaml` accepts
-   [Warp Factories quickstart](https://docs.warp.dev/factories/quickstart/) - Create a factory from scratch instead
-   [Connect your factory](https://docs.warp.dev/factories/connect-your-factory/) - Route work from Slack, issue trackers, and code hosts to the new factory
