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

# Explore changes with drafts

> Create drafts to test changes, including database changes, in a copy of your project, and accept the ones you want to keep.

Drafts let you make changes in a copy of your project instead of the main version itself. Each draft has its own project chat, preview, and edits. When you're ready, accept the draft to add its changes to your project, or delete it to discard them. Accepting can change your live app's backend immediately, before you publish.

On a project that uses the [built-in backend](https://docs.lovable.dev/features/cloud), a draft usually has a backend of its own, filled with example data instead of your real records. Other drafts share your live backend, so changing data in them changes your live app. In both kinds of draft, secrets and connected services use their live values. See [Which backend a draft uses](#which-backend-a-draft-uses).

Drafts are available on all plans, and you need edit access to work in them. Messages you send in a draft cost the same as messages in the main version of your project, and creating, updating, accepting, and deleting a draft don't use credits. To start a separate project from a copy instead, see [Remix a project](https://docs.lovable.dev/features/projects/remix.md).

## When to use a draft

Use a draft to test a change before your users see it, to try several ideas side by side, or to work without changing the version everyone else is working on. For example:

* **Test a change to your app's data.** Add a dietary-needs field to a booking form, make test bookings against example data, and accept the draft when the form works.
* **Check who can see what.** Build a members-only page or an admin view, then sign in as test accounts with different roles in the draft to check what each one sees.
* **Test a redesign.** Try new colors, fonts, or a different layout in a draft, and compare it with your current design before you commit to it.
* **Find the words that work.** Write different headlines, product descriptions, or calls to action in separate drafts, and keep the version that reads best.
* **Prepare changes for later.** Build a sale banner or a seasonal page in a draft today, and accept it when you're ready to publish it.
* **Hand changes to someone else.** Let a teammate or client work in a draft, then review the changes and accept them when they're ready.

Drafts are optional, and you can keep building exactly as you do today. Make quick changes such as typo fixes directly in your project.

## Create and test a draft

If your change needs setup that only the main version can make, such as enabling the built-in backend, setting up payments, or setting up email, make it there before you create a draft. See [Changes you make in the main version](#changes-you-make-in-the-main-version).

Follow these steps to create a draft, check which backend it uses, build your change, decide whether to keep it, and publish it.

**1. Open the draft switcher**

In the editor, click your project's name at the top to open the draft switcher. The switcher lists your project's drafts, if it has any, above **New draft**.

![The draft switcher opened from the project's name on a project with no drafts yet, showing New draft, Settings, and the credits you have left](https://mintcdn.com/lovable-f9060f1e/HohMn0OJbVUFg8B6/images/create-first-draft.png?fit=max\&auto=format\&n=HohMn0OJbVUFg8B6\&q=85\&s=249c8dea20ceac4d73147d9ecf6dfc8c)

**2. Create a draft**

Click **New draft**. The new draft opens as a copy of the main version of your project. It starts with a numbered name such as **Draft 1**, and Lovable renames it based on your first prompt.

If the draft gets its own backend, Lovable sets it up while the draft opens.

**3. Check which backend the draft uses**

If your project doesn't have a backend, skip this step. Otherwise, check the preview before you add, change, or delete any data:

* **A banner above the preview says you're viewing example data.** The draft has its own backend, and data you change stays in the draft.
* **No banner appears.** The draft shares your live backend, and anything you add, change, or delete changes your live app too.

![The preview of a draft that has its own backend, with a banner at the top saying you're viewing example data while working on this draft](https://mintcdn.com/lovable-f9060f1e/HohMn0OJbVUFg8B6/images/drafts-example-data-banner.png?fit=max\&auto=format\&n=HohMn0OJbVUFg8B6\&q=85\&s=7cc56b6da8f16ddae92fdb483555596a)

The banner appears when the draft finishes setting up, and you can't close it. In both kinds of draft, secrets and connected services use their live values, so requests and emails your app sends through them are real. See [Which backend a draft uses](#which-backend-a-draft-uses).

**4. Build and compare**

Work with Lovable in the draft's chat as you always do. Edits to your app's pages and code stay in the draft until you accept it, and the preview shows the draft's version of your app.

Use the draft switcher to move between the main version of your project and your drafts. To return to the main version, select **Back to project chat** in the switcher. The top of the editor always shows which version you're viewing: your project's name for the main version, or the draft's name with a **Draft** badge while you're in a draft. The project chat and preview change to match it.

![The draft switcher opened inside a draft, showing the draft's name with a Draft badge at the top, Back to project chat above the list of drafts, and New draft and Settings below it](https://mintcdn.com/lovable-f9060f1e/HohMn0OJbVUFg8B6/images/drafts-back-to-project-chat.png?fit=max\&auto=format\&n=HohMn0OJbVUFg8B6\&q=85\&s=09a9afc355bf551573981fbf3ede0cb5)

**5. Accept the draft, or delete it**

When you want to keep a draft's changes, select **Accept** in the top right of the editor, where **Publish** usually is. Lovable shows you a one-line summary of what the draft changes, followed by the draft's edits. When you confirm, Lovable accepts the draft and returns you to the main version of your project.

When accepting finishes, changes to your database's structure, file storage settings, and backend functions take effect in your live app. The structure is the tables, their columns, and the rules about who can read or change data. Backend functions are the code your app runs on the server. See [Accept a draft](#accept-a-draft) for what changes and what can't be undone.

If you don't want to keep the draft, [delete it](#delete-a-draft) instead.

**6. Publish the updated pages and screens**

Accepting adds the draft's pages and screens to your project's unpublished changes. To show them to visitors, [publish your project](https://docs.lovable.dev/features/publish.md) from the main version.

Until you publish, visitors see the previous version of your app, which already uses the new database structure and backend functions.

> [!TIP]
>
> Press **Cmd+K** (Mac) or **Ctrl+K** (Windows/Linux) to open the [command palette](https://docs.lovable.dev/features/projects/editor.md#command-palette). The **Drafts** group lists the main version of your project, labeled **Preview**, and every draft in the project, so you can switch without leaving the keyboard.

## Which backend a draft uses

> [!NOTE]
>
> Drafts with a backend of their own are rolling out gradually, so your drafts may share your live backend for now.

Your app keeps its information in a [database](https://docs.lovable.dev/features/database), organized into tables. Drafts handle two parts of it differently:

* **Structure**: the tables, their columns, and the rules about who can read or change data. A reviews table, for example, has columns for the rating, the comment, and the product being reviewed.
* **Data**: the records stored in those tables, such as each review.

Accepting a draft can change your live database's structure, but it never copies data from the draft. If your project has a backend, a draft either has a backend of its own or shares your live backend, and the difference decides what you can safely do while testing:

| | Draft that has its own backend | Draft that shares your live backend |
| :- | :- | :- |
| **Database structure** | A copy of your live app's structure. | Your live app's structure. |
| **Data you add, change, or delete** | Stays in the draft. | Changes in your live app immediately. Deleting the draft doesn't undo the change. |
| **New tables and columns you ask for** | Added to the draft's database, so you can test them in the preview. | Added to your live database when you accept the draft. Until then, pages that use them show an error in the preview. |
| **User accounts** | Two demo accounts, or the test accounts in your example data file (`db/seed.sql`), plus any you sign up with in the draft. See [Sign in to your app in a draft](#sign-in-to-your-app-in-a-draft). | Your live app's accounts. |
| **Files** | The same storage settings as your live app, with no files. | Your live app's files. |
| **Backend functions** | Their own copies, which run the draft's code. | Lovable deploys your edits to them when you accept the draft. |
| **Secrets and connected services** | The live values. | The live values. |
| **Preview** | A banner shows that you're viewing example data. | No banner, and the preview shows your real data. |

The **Files** row is about your app's file storage. Files in your project's [Files tab](https://docs.lovable.dev/features/generate-files.md#manage-generated-files) are different: the main version and every draft share them, and changes there save immediately, even in a draft that has its own backend.

> [!WARNING]
>
> Secrets and connected services use their live values in a draft. An API call that your app makes through them from a draft is real, and so is an email your app sends through a connected service.
>
> Replies from those services, such as a payment confirmation, go to your live app, not the draft, so a checkout you test in a draft never completes there. With [built-in payments](https://docs.lovable.dev/features/payments.md#testing), checkout in a draft uses test mode and charges no money. With [your own Stripe account](https://docs.lovable.dev/integrations/stripe.md) and a live key, the payment is real.

### When a draft shares your live backend

A draft shares your live backend when:

* Your project uses your own [Supabase](https://docs.lovable.dev/integrations/supabase.md) project instead of the built-in backend.
* Lovable can't set up the draft's backend. This happens when your database already uses an extension outside the [supported list](https://docs.lovable.dev/features/database#supported-postgresql-extensions), when the database is paused or unavailable, or when Lovable can't copy the database's structure. Some older extensions outside that list still work in drafts, such as `citext`, `plpgsql_check`, and `supabase_vault`, if your database already uses them.

## Test in a draft that has its own backend

A draft that has its own backend is the place to build a change that stores new information. You ask for the change, test it with example data, and your live database changes only when you accept. For example, to add a dietary-needs field to a booking form:

1. **Ask for the change in the draft's chat.** For example:

   ```text wrap theme={null}
   Add a dietary-needs field to the booking form and save it with each booking.
   ```

2. **Lovable changes the draft's database and builds the form.** Your live database stays unchanged.

3. **Make a few test bookings in the draft's preview.** Check that each one saves the dietary needs.

4. **Accept the draft** when the form works. Lovable adds the same column to your live database, and the test bookings are deleted with the draft's data. See [Accept a draft](#accept-a-draft).

5. **Publish your project** when you want visitors to see the new form. See [Publish your project](https://docs.lovable.dev/features/publish.md).

### Test with example data or your own data

Every new draft that has its own backend starts with example data, so its preview looks like a working app instead of an empty one. Unless your project has an example data file, Lovable writes a few example rows for each table when it creates the draft.

To start every draft with the same data instead, such as the customers and bookings you always test with, ask Lovable in a draft's chat to create an **example data file**. For example:

```text wrap theme={null}
Create an example data file so every draft starts with three customers, a week of bookings for each one, and an admin account for testing the dashboard.
```

Lovable saves the rows in `db/seed.sql`, a file in your project's code. After you accept the draft that created or changed the file, every new draft starts with the rows in the file instead of rows Lovable writes.

To keep the example rows Lovable wrote in a draft, ask Lovable to save them to the example data file. If your app has user accounts, those rows include the two demo accounts Lovable creates for signing in, so the file then also holds their password. Lovable asks you before it saves the file. See [Sign in to your app in a draft](#sign-in-to-your-app-in-a-draft).

When an update rebuilds a draft's database, the rebuilt database gets back only the rows in the example data file. Rows you added while testing are removed, and so are example rows you didn't save to the file. To keep test data through a rebuild, add it to the file. See [Update a draft](#update-a-draft) for when an update rebuilds the database.

To test with your live app's real records instead, ask Lovable in the draft's chat to copy them in, and say which tables to include. Lovable adds a copy of those rows to the example data file, so every new draft starts with them after you accept the draft. Lovable asks you before it copies people's names, email addresses, or other personal details, and it doesn't copy your app's user accounts.

The copied rows aren't kept in sync with your live app, and anything you change in the draft stays in the draft.

> [!TIP]
>
> Leave out personal information you don't need for the test, such as real email addresses or payment details. Ask Lovable to replace them with example values as it copies the rows.

### Sign in to your app in a draft

A draft that has its own backend has separate user accounts, so the accounts from your live app don't exist there.

If your app has user accounts and your project has no example data file, a new draft starts with two **demo accounts** that Lovable creates with the example data: Demo User, with the address `demo@example.com`, and a second example account. They're made up and belong to nobody. Lovable sets them up with the profile and role details your app expects, which can include an admin role.

When the preview opens, Lovable signs you in as Demo User, so you see your app as a signed-in user immediately. Lovable doesn't share the demo accounts' password. To see which accounts the draft has, ask Lovable in the draft's chat.

To test as several users, ask Lovable to add test accounts to the example data file. For example:

```text wrap theme={null}
Add two test accounts to the example data file, one admin and one member without admin access, and tell me their email addresses and passwords.
```

Lovable tells you each account's email address and password. Every new draft starts with these accounts after you accept the draft that added them.

When your project has an example data file, new drafts start with the accounts in the file instead of the demo accounts, and Lovable signs you in with one of them. If the file creates no accounts, a new draft starts with none.

To test signing up or signing in yourself, sign out inside the preview, then sign up with a new account in the draft. After you sign out, the preview stays signed out in that browser until you sign in again. The draft uses your live app's sign-up settings, so if your live app doesn't allow new sign-ups, signing up in the draft doesn't work either.

Sign-in emails work in a draft, so you can test sign-up confirmation and password reset. Lovable sends them to the email address of the account in the draft, and their links open the draft. Each hour, Lovable sends up to 20 sign-in emails per draft and 100 per project.

Your live app's accounts aren't copied into the draft, so your users receive these emails only if someone signs up or invites them with their address in the draft.

To get the emails yourself, sign up in the draft with an email address you can check. The demo accounts use example addresses, so their emails don't arrive anywhere.

Single sign-on through SAML, for example with Microsoft Entra ID, doesn't work in a draft. Test that sign-in in the main version of your project.

### View draft data

While you're in a draft that has its own backend, **Database**, **Users**, and **Storage** are disabled in the **More** menu, because they show your live app's data. If you open one of them from a direct link, a notice shows that you're viewing live app data.

To see the draft's tables, accounts, or files, ask Lovable in the draft's chat. For example:

```text wrap theme={null}
Show me the rows in the orders table.
```

### When draft data is deleted or reset

Lovable deletes or resets a draft's data when:

* **You accept the draft.** Changes to the database's structure reach your live database, and the draft's rows, accounts, and files are deleted.
* **You delete the draft.**
* **An update rebuilds the draft's database.** The draft's rows and accounts are reset, and its files stay. See [Update a draft](#update-a-draft).
* **Lovable can't restore the draft's database and has to rebuild it.** The update dialog shows a message when this happens.

## Work in a draft that shares your live backend

A draft that shares your live backend uses your project's live database, files, and settings, the same as the main version. When Lovable changes the backend from this draft, the change happens in your live app. When an action is harder to undo, Lovable explains it in the draft's chat first and asks you to confirm.

> [!WARNING]
>
> In a draft that shares your live backend, adding, editing, or deleting information changes it in your live app too, and deleting the draft doesn't undo it. Create your own records to test with.

A few changes would reach your live app as soon as Lovable makes them, so you can make them only in the main version of your project:

* **Deploying backend functions.** You can edit a backend function's code in a draft, and Lovable deploys it when you accept the draft.
* **Changing sign-in methods**, including social login providers such as Google and Apple.
* **Changing file storage settings**, such as whether a storage bucket is public.

If you ask for one of these in the draft, Lovable tells you to make the change in the main version instead. Make the change there, then update your draft to bring it in.

New database tables and columns work differently. See [Add database tables and columns](#add-database-tables-and-columns).

### Add database tables and columns

You can ask for new tables and columns in a draft that shares your live backend. That draft uses the same database as your project, so Lovable prepares the change in the draft and adds it to your database when you accept the draft:

1. **You ask for it in the draft's chat.** For example:

   ```text wrap theme={null}
   Add a reviews table with a rating, a comment, and the product it belongs to.
   ```

2. **Lovable prepares the change and builds the pages that use it.** The table doesn't exist yet, so any page that reads or saves reviews shows an error in the draft's preview. That error is expected, and it disappears when you accept the draft.

3. **You accept the draft.** Lovable adds the table to your live database and describes what it added in your project's chat. See [Accept a draft](#accept-a-draft).

This works for additions: new tables, new columns, and new rules about who can read or change the information. Lovable doesn't remove or rename an existing table or column from a draft, or change the kind of information a column stores.

If you ask for one of those changes, Lovable reaches the same result by adding to your database instead, for example by adding a new column and copying the data over. The old column stays in place, and your app stops using it.

When a change can't be made by adding, Lovable tells you to make the change yourself in the SQL editor, at **More → Database → Manage → SQL editor**. See [Run SQL queries](https://docs.lovable.dev/features/database#run-sql-queries).

## Changes you make in the main version

You can make some changes to your app only in the main version of your project, not in a draft. If the change you want to test needs one of them, make it in the main version first, then create the draft:

* **Enable AI features for your app.** See [AI features for your app](https://docs.lovable.dev/features/ai).
* **Set up payments**, including enabling payments and creating products and prices, whether you use the built-in payments or [your own Stripe account](https://docs.lovable.dev/integrations/stripe.md). See [Add payments to your app](https://docs.lovable.dev/features/payments.md).
* **Set up email**, including your email domain. See [Send branded emails from your own domain](https://docs.lovable.dev/features/custom-emails.md).
* **Enable the built-in backend**, if your project doesn't have it yet. See [Built-in backend](https://docs.lovable.dev/features/cloud).
* **Change or delete secrets**, the values your app uses to reach other services. You can still add a new secret from a draft after you confirm it. See [Secrets](https://docs.lovable.dev/features/secrets.md).

If you ask for one of these in a draft, Lovable tells you to make the change in the main version instead, and continues with the rest of your request. Make the change in the main version, then create a new draft to test with it.

Secrets work differently. You still change or delete a secret in the main version, but you don't need a new draft afterwards. A change to your secrets applies to your project and every draft immediately.

## Update a draft

A draft starts as a copy of your project. Changes you or a teammate make to the project afterwards don't appear in the draft until you update it. When newer changes are available, the draft's row in the switcher shows a hollow gray ring labeled **Updates available**, and the draft's chat shows a reminder with an **Update draft** button.

![The Update and Accept buttons in the top right of the editor while you're in a draft that is missing newer project changes](https://mintcdn.com/lovable-f9060f1e/HohMn0OJbVUFg8B6/images/drafts-update-and-accept.png?fit=max\&auto=format\&n=HohMn0OJbVUFg8B6\&q=85\&s=b56f0563244344ac84625bb90bc725a6)

To update a draft, select **Update** next to **Accept** in the top right of the editor, or from the draft's **⋮** menu. You can also ask Lovable to update the draft in its chat. The update dialog lists the changes coming in from your project.

If the newer project changes overlap with edits in the draft, Lovable adjusts the draft's edits to work with the updated version. The update can take a few minutes, and Lovable may add a follow-up message to the draft's chat.

In a draft that has its own backend, an update also brings in changes to the database's structure, such as a new table or column:

* **If only your project changed the structure**, Lovable makes the same changes in the draft's database. The draft keeps its own rows and accounts, and none of your live app's data is copied in.
* **If the draft changed the structure too**, Lovable rebuilds the draft's database from your project's structure and example data file, then applies the draft's own changes again. The draft keeps its code and chat, but its data and accounts are reset. See [Test with example data or your own data](#test-with-example-data-or-your-own-data).

You can update a draft while Lovable is working in the main version of your project. Lovable brings in the changes your project has finished so far. Messages you send in the draft while it's updating wait until the update finishes.

You don't need to update a draft before accepting it. If your project has newer changes, Lovable updates the draft as part of accepting it.

## Accept a draft

Accepting adds a draft's changes to the main version of your project. If the draft includes backend changes, they can take effect in your live app immediately, so review the draft's changes before you accept. When a draft changes your database's structure, ask Lovable in the draft's chat to explain what will change, especially anything it renames or removes.

> [!WARNING]
>
> Lovable doesn't take a backup of your database when it accepts a draft. Restoring an earlier version from [version history](https://docs.lovable.dev/features/projects/history.md) afterwards restores your code and backend functions, but not your database. To protect your database:
>
> * **Before you accept**, [export your database](https://docs.lovable.dev/features/database-backups.md#export-your-database) to keep a copy of its current state.
> * **After you accept**, if you need to undo a change to your database's structure, [restore a daily backup](https://docs.lovable.dev/features/database-backups.md#restore-a-daily-backup). Restoring also removes data added since that backup.

You can accept a draft in several ways while you're in it:

* Select **Accept** in the top right of the editor, where **Publish** usually is.
* Select **Accept** in the draft's **⋮** menu.
* Ask Lovable to accept it in the draft's chat.

You can accept even when your project has newer changes that the draft doesn't have yet. Lovable updates the draft first, then accepts it. See [Update a draft](#update-a-draft).

The table shows what changes when you accept a draft, and what waits until you publish:

| | When you accept | When you publish |
| :- | :- | :- |
| **Your app's pages and screens** | Added to your project's unpublished changes. Visitors still see the previous version. | Visitors see them. |
| **Database structure**, such as new tables and columns | Changes in your live database immediately. | No further change. |
| **Backend functions** the draft changed | Deployed to your live app immediately. | No further change. |
| **File storage settings**, such as whether a storage bucket is public | In a draft that has its own backend, change in your live app immediately. A draft that shares your live backend can't change them. | No further change. |
| **The draft's rows, test accounts, and files**, in a draft that has its own backend | Deleted with the draft. They never reach your live app. | No change. |

Until you publish, the previous version of your app already uses the new database structure and backend functions.

Most changes, such as a new table or column, work fine during that gap. A change that renames or removes something the previous version uses can break it, so [publish your project](https://docs.lovable.dev/features/publish.md) from the main version right after you accept. You can't publish a draft.

When you accept a draft that has its own backend, Lovable first checks that the draft's changes to the database's structure still fit your live database's current structure. If any structure change fails, Lovable makes none of those changes and doesn't add the draft's code. See [Couldn't accept this draft because your project's database structure changed first](#couldnt-accept-this-draft-because-your-projects-database-structure-changed-first-ask-lovable-in-this-draft-to-redo-its-database-structure-changes-then-accept-again).

When several drafts are accepted around the same time, Lovable puts them in a queue and accepts them one at a time. See [Work with drafts as a team](#work-with-drafts-as-a-team).

After you accept, the draft is finished and can't be edited again. It appears in [version history](https://docs.lovable.dev/features/projects/history.md), where you can reopen it to read its chat and review its changes. Lovable keeps the one-line summary it showed you, labeled **Draft summary**, on the accepted change in your project's chat and in version history.

## Work with drafts as a team

Everyone with edit access to the project sees the same drafts. Each draft's row shows the avatar of the person who created it. Hover over the avatar to see their name and the draft's status. When other people are working in a draft, their avatars appear at the end of its row.

When someone else is working with Lovable in the main version, Lovable may suggest creating your own draft so you can work separately.

When someone else has created a draft in the project, **Show mine** appears next to the switcher's **Drafts** heading. Select **Show mine** to narrow the list to the drafts you created, and **Show all** to see every draft again. The switcher shows every draft each time you open it. **Show mine** also appears in the drafts list on your phone, and it doesn't appear when you're the only person who has created a draft.

Anyone with edit access can accept any draft in the project, and accepting doesn't require anyone's approval. To review a teammate's or client's work before it reaches your project, agree on who accepts drafts.

When someone accepts a draft, its changes are added to the main version for everyone. Other open drafts don't include those changes until they're updated, and each one shows **Updates available** in the switcher.

If several drafts are accepted around the same time, Lovable puts them in a queue and accepts them one at a time. A project's queue has room for 10 drafts, including the one Lovable is accepting.

While a draft is in the queue, a card above the project chat shows its progress. When the queue has more than one draft, the **Accepting drafts** card shows their order. From there you can remove a draft from the queue or drag drafts to change the order.

## Manage drafts

Manage your drafts from the draft switcher, or ask Lovable in the project chat or [Chats](https://docs.lovable.dev/features/chats.md). An AI client connected to the [Lovable MCP server](https://docs.lovable.dev/integrations/lovable-mcp-server.md#drafts) can also create, rename, accept, and delete drafts, and build in them.

![The draft switcher opened on a project with six drafts, showing the number of drafts next to the project's name, Show mine next to the Drafts heading, each draft with its creator's avatar and a status indicator, and New draft and Settings below the list](https://mintcdn.com/lovable-f9060f1e/HohMn0OJbVUFg8B6/images/draft-switcher.png?fit=max\&auto=format\&n=HohMn0OJbVUFg8B6\&q=85\&s=3dd94061ecc1f4db13b9fb9af52aa0c4)

### Check the status of your drafts

The draft switcher shows the status of each draft as an indicator on the corner of its creator's avatar. Hover over the avatar to see the indicator's label:

| Indicator | Label | What it means |
| :- | :- | :- |
| Spinner | An operation in progress, such as **Updating draft** or **Accepting draft** | Lovable is working in that draft. |
| Orange dot | **Lovable needs your input** | Lovable asked a question in that draft and is waiting for your answer. |
| Hollow gray ring | **Updates available** | Your project has newer changes that this draft doesn't have yet. |
| Red dot | **Operation failed**, **Update failed**, or **Failed to create draft** | The last action in that draft didn't finish. Hover over it to see the reason, then try again. |
| Blue dot | **New changes** | The draft has changes you haven't looked at yet. |

A draft with no indicator has no changes yet, or has changes you've already looked at.

### Rename a draft

To rename a draft, hover over it in the switcher, open its **⋮** menu, and select **Rename**. A name can be up to 80 characters.

### Change the order of your drafts

The switcher lists your drafts with the most recent activity first. Drafts waiting to be accepted stay at the top, in the order Lovable accepts them, and you can't drag them. To set your own order for the other drafts, press and hold a draft for a moment, then drag it where you want it. Lovable remembers that order for the project in the browser you're using.

You can't reorder drafts while the switcher shows only your drafts, because the list is missing the project's other drafts. Select **Show all** first.

### Delete a draft

To delete a draft, open its **⋮** menu, select **Delete**, and confirm. Deleting removes the draft and all of its changes, and the deleted draft can't be restored. If the draft has its own backend, deleting also removes that backend and all of its data.

Deleting a draft never deletes your live backend, and it doesn't undo changes that already reached your live app:

* Data you changed in a draft that shares your live backend.
* Changes in your project's [Files tab](https://docs.lovable.dev/features/generate-files.md#manage-generated-files).
* Requests your app already sent to connected services.

If nobody chats in, renames, edits, or updates a new draft within 24 hours, Lovable removes it.

### Ask Lovable to manage drafts

You can ask Lovable to work with drafts from the project chat or from [Chats](https://docs.lovable.dev/features/chats.md):

* **Create a draft** from the main version's project chat or from Chats.
* **Update or accept a draft** from that draft's chat, the main version's project chat, or Chats. Outside the draft's chat, say which draft you mean.
* **Delete a draft** from Chats only. In the project chat, delete a draft from its **⋮** menu in the switcher instead.

If you ask for one of these in [Chat mode](https://docs.lovable.dev/features/chat-mode.md), Lovable offers to switch to [Build mode](https://docs.lovable.dev/features/agent-mode.md) first.

For example, ask Lovable in Chats to try two ideas side by side, then compare them in the switcher:

```text wrap theme={null}
In my bakery project, build two versions of a new order page, each in its own draft.
```

Before Lovable accepts a draft from that draft's chat, it asks you to approve, unless you've chosen to always allow accepting. Accepting starts after Lovable finishes its reply. Lovable also asks you to approve before it deletes a draft from Chats.

## Work with drafts on your phone

You can create, switch between, and manage drafts from your phone. To open the drafts list, tap your project's name at the top of the screen and select **Drafts**.

The list works like the switcher on a computer:

* Tap a draft to switch to it.
* Tap **New draft** to create one.
* Open a draft's **⋮** menu to rename, accept, update, or delete it. When an action isn't available, the menu shows the reason next to it.

While you're in a draft, tap the name at the top of the screen to see the draft's card. The card shows whether the draft is ready to accept or has updates available, and it has an **Accept** button. When your project has newer changes, the card also has an **Update** button. Tap **Switch** on the card to open the drafts list, or **Back to project chat** to return to the main version.

## Limitations

These limits apply while you work in a draft.

* Drafts can't use separate test values for secrets or connected services. They use your live values. See [Which backend a draft uses](#which-backend-a-draft-uses).
* A checkout you test in a draft never completes there, because the payment provider sends its confirmation to your live app. With your own Stripe account and a live key, the payment is real. See [Which backend a draft uses](#which-backend-a-draft-uses).
* Emails your app sends through Lovable's built-in email sending aren't sent from a draft, except sign-in emails. See [My app's emails don't arrive when I test in a draft](#my-apps-emails-dont-arrive-when-i-test-in-a-draft).
* Single sign-on through SAML doesn't work in a draft. See [Sign in to your app in a draft](#sign-in-to-your-app-in-a-draft).
* **Database**, **Users**, and **Storage** in the **More** menu don't show a draft's data. See [View draft data](#view-draft-data).
* Some backend work has to happen in the main version of your project, including payments, email setup, and enabling AI features for your app. See [Changes you make in the main version](#changes-you-make-in-the-main-version).
* Files in your project's [Files tab](https://docs.lovable.dev/features/generate-files.md#manage-generated-files) are shared with the main version and every draft. Changes there save immediately, and deleting the draft doesn't undo them.
* A draft doesn't appear as a branch in a repository connected through [Git sync](https://docs.lovable.dev/integrations/git-sync-overview). Its code reaches the repository only after you accept the draft.

## Troubleshooting

If drafts aren't working as expected, these are the most common causes.

> [accordion] Accept or Update is grayed out
>
> Hover over the button to see why it's unavailable. The two actions become unavailable for different reasons.
>
> **Accept** is unavailable when:
>
> * The draft has no edits yet.
> * The draft is already waiting to be accepted.
> * The draft is being created or deleted.
> * An update is running.
> * The draft's last update failed. Update the draft, then accept.
>
> **Update** is unavailable when:
>
> * The draft is already up to date with your project.
> * An update is already running.
> * Lovable is working in the draft.
> * The draft is being accepted or deleted.
>
> Wait for the current work to finish, then try again.

> [accordion] Can't create more than 500 open drafts in a project. Accept or delete a draft first.
>
> A project can have up to 500 open drafts at a time. Drafts you've accepted or deleted don't count.
>
> Accept or delete drafts you no longer need, then create the new draft.

> [accordion] Couldn't set up this draft
>
> Lovable couldn't start the backend it set up for this new draft, so the draft can't open. Your live app isn't affected.
>
> Delete the draft and create a new one.

> [accordion] Your preview isn't ready yet
>
> This is usually temporary. The draft's app is taking longer than usual to start, and this message appears after about a minute and a half.
>
> Keep waiting, or select **Reload** to check again.

> [accordion] Update failed
>
> Lovable couldn't bring your project's newer changes into the draft.
>
> Select **Update** to try again. If it fails again, wait until Lovable finishes the work it's doing in the draft, then retry.

> [accordion] Can't update this draft while your project's database is paused. Resume the database from the main version, then update again.
>
> This is expected while the database in the main version of your project is paused. Lovable sets up and rebuilds a draft's database from your project's database, so it can't do either until that database runs again.
>
> Resume the database from the main version of your project, then update the draft again. See [Resume a paused project](https://docs.lovable.dev/features/database-pause-remove.md#resume-a-paused-project).

> [accordion] Couldn't rebuild this draft's database because your project no longer uses Lovable Cloud. Create a new draft and make your changes there again.
>
> Your project stopped using the built-in backend (Cloud) after you created this draft, so Lovable can't rebuild the draft's database when it updates the draft.
>
> Create a new draft and ask Lovable in it to make the same changes. A draft gets its own database only while your project uses the built-in backend (Cloud).

> [accordion] Couldn't restore this draft's database. Update the draft to rebuild it from your example data, keeping its code and chat.
>
> This is a problem with the draft's own database. Your live database isn't affected. The update dialog shows this message when Lovable can't restore the draft's database.
>
> Update the draft. Lovable rebuilds the draft's database from your project's database structure and your [example data file](#test-with-example-data-or-your-own-data), and keeps the draft's code and chat. Data you added while testing in the draft isn't recovered.

> [accordion] Couldn't accept this draft because Lovable was still working in it. Accept the draft again when Lovable finishes.
>
> Lovable was still working in the draft when you accepted it. Lovable waited up to 20 minutes for that work to finish, then stopped accepting the draft. Nothing from the draft reached your project.
>
> Wait until Lovable finishes its reply in the draft, then accept the draft again.

> [accordion] Couldn't accept this draft because it took too long. Accept the draft again.
>
> Lovable stopped accepting this draft because it took more than 20 minutes. Nothing from the draft reached your project, so you can safely accept it again.
>
> Accept the draft again.

> [accordion] Couldn't update this draft before accepting it. Update the draft, then accept it again.
>
> When a draft is missing newer changes from your project, Lovable updates the draft before accepting it. That update failed, so Lovable didn't accept the draft.
>
> Update the draft from the switcher, then accept it again. If the update fails too, see [Update failed](#update-failed).

> [accordion] Draft accepted, but setup didn't finish
>
> The draft's changes are in your project, but the steps Lovable runs on the main version after adding them didn't finish within 20 minutes. Lovable retries those steps on its own. Until setup finishes, Lovable doesn't accept other drafts.
>
> If setup still doesn't finish, select **Retry setup** on the notice above the project chat.

> [accordion] Lovable is finishing accepting a draft…
>
> Lovable was interrupted while accepting a draft and is now completing it. Until Lovable finishes, you can't accept other drafts or edit the main version of your project. You can keep working in other drafts.
>
> Wait for the notice above the project chat to clear. If Lovable can't finish, see [Couldn't finish accepting a draft](#couldnt-finish-accepting-a-draft).

> [accordion] Couldn't finish accepting a draft
>
> Lovable was interrupted while accepting a draft and couldn't complete it. Until Lovable completes it, you can't accept other drafts or edit the main version of your project. You can keep working in other drafts.
>
> Select **Retry** on the notice above the project chat.

> [accordion] Some changes made while this draft was being accepted weren't included. Make them again in a new draft.
>
> This is expected when someone changes a draft while Lovable is accepting it. Lovable adds the draft's changes as they were when you accepted it, so changes made after that don't reach your project. Lovable reports this in the project chat after it accepts the draft.
>
> Create a new draft and make those changes again. To keep a change, finish it before you accept the draft.

> [accordion] Couldn't accept this draft because your project's database structure changed first. Ask Lovable in this draft to redo its database structure changes, then accept again.
>
> This is expected when your project's database structure changes after this draft changed its own, for example because another draft was accepted first. Lovable stopped before changing anything, so your live database is unchanged.
>
> Ask Lovable in this draft to redo its database structure changes, then accept the draft again.

> [accordion] Can't accept this draft while 10 other drafts are being accepted or waiting to be accepted. Try again when one of them finishes.
>
> A project can have 10 drafts being accepted or waiting to be accepted at a time. This project already had 10 when you accepted this draft. See [Work with drafts as a team](#work-with-drafts-as-a-team).
>
> Wait until Lovable finishes accepting one of those drafts, then accept this draft again.

> [accordion] This draft was already accepted, so you can't make more changes here.
>
> You're viewing a draft that was already accepted, usually after opening it from version history. You can read its chat and review its changes, but you can't keep building in it.
>
> Select **Go to project** to return to the main version of your project, where the draft's changes now are.

> [accordion] This draft was accepted or deleted
>
> You opened a link to a draft that was accepted or deleted, so the draft is no longer available.
>
> Select **Go to project** to continue in the main version of your project. To read an accepted draft's chat and review its changes, reopen it from [version history](https://docs.lovable.dev/features/projects/history.md).

> [accordion] I can't sign in to my app in a draft's preview
>
> This is expected in a draft that has its own backend when you use an account from your live app. That draft has its own accounts, and your live app's accounts aren't copied into it.
>
> Sign up inside the draft's preview, or ask Lovable to add test accounts to your example data file and tell you their email addresses and passwords. See [Sign in to your app in a draft](#sign-in-to-your-app-in-a-draft).

> [accordion] You're signed out of your app in a draft's preview
>
> Each draft preview has its own web address, so your sign-in doesn't always carry over when you switch drafts. If your app has user accounts, sign in again inside the draft's preview.
>
> In a draft that has its own backend, sign in with a test account from your example data file or an account you sign up with in the draft, not an account from your live app. See [Sign in to your app in a draft](#sign-in-to-your-app-in-a-draft).

> [accordion] My app's emails don't arrive when I test in a draft
>
> This is expected for emails your app sends through Lovable's [built-in email sending](https://docs.lovable.dev/features/custom-emails.md), such as a booking confirmation. Lovable doesn't send them from a draft, so those emails don't reach anyone.
>
> Sign-in emails are the exception. See [Sign in to your app in a draft](#sign-in-to-your-app-in-a-draft).

> [accordion] My draft has no example data
>
> The draft's database has your app's structure but no rows. The most common causes:
>
> * **Your project's example data file has an error or is larger than 2 MB**, so Lovable couldn't apply it. Ask Lovable in the draft's chat to fix or shorten the example data file.
> * **Your app's database structure is too large** for Lovable to write example rows for every table. Ask Lovable to add the rows you need to the example data file.
> * **An update rebuilt the draft's database.** Lovable restores the rows from your example data file, but not the example rows it wrote when it created the draft.

> [accordion] You’re viewing live app data, not draft data
>
> You opened **Database**, **Users**, or **Storage** from a direct link while in a draft that has its own backend. Those views always show your live app's data, not the draft's.
>
> To see the draft's data, ask Lovable in the draft's chat. For example:
>
> ```text wrap theme={null}
> List the rows in the customers table.
> ```

## FAQ

Common questions about working with drafts.

> [accordion] Can I test changes on a separate copy of my app before my users see them?
>
> Yes, with drafts. On the built-in backend, a draft is usually a copy of your app with its own database, accounts, and files, filled with example data. You can test most changes there before your users see them, such as new pages, new tables, and sign-in flows. Secrets and connected services still use their live values in a draft, and some backend setup, such as payments, happens only in the main version. See [Limitations](#limitations).
>
> A draft is temporary. When a draft has its own backend, Lovable deletes its data when you accept or delete it, so create a new draft for each change you want to test. See [When draft data is deleted or reset](#when-draft-data-is-deleted-or-reset).

> [accordion] Can I use drafts in a project with a database?
>
> Yes. On the built-in backend, a draft usually gets its own database with your app's structure and example data. Data you add, edit, or delete while testing stays in the draft. When you accept the draft, Lovable applies the draft's changes to your live database's structure. See [Which backend a draft uses](#which-backend-a-draft-uses). If your project uses your own Supabase project, drafts use your live database. See [When a draft shares your live backend](#when-a-draft-shares-your-live-backend).

> [accordion] Does building in a draft affect my published app?
>
> Not always. Edits to your app's pages and code stay in the draft until you accept it. Two things reach your live app immediately:
>
> * Data you add, change, or delete in a draft that shares your live backend.
> * Requests your app sends through a connected service, from any draft.
>
> When you accept, the draft's changes to the database's structure, file storage settings, and backend functions take effect in your live app immediately. The rest of the draft's code reaches visitors when you publish. See [Accept a draft](#accept-a-draft).

> [accordion] Is a draft the same as a branch?
>
> Yes. A draft works like a branch forked from your project's history. If you've used version control, each term maps to a familiar concept:
>
> * A **draft** is a branch with its own project chat. When a draft has its own backend, it also has its own database, copied from your project's structure and filled with example rows.
> * **Update** rebases the draft onto the latest version of your project. If changes overlap, Lovable resolves the conflicts by reworking the draft's edits.
> * **Accept** fast-forwards your project's history and applies the draft's database migrations to your live database. The draft's edits are added as a named group.
> * **Delete** discards the branch and its own database, if it has one. A shared live database stays in place.
>
> You don't need any version-control experience to use drafts, and these terms don't appear in the product.

> [accordion] Can I use drafts with a connected Git repository?
>
> Yes. You can work in drafts in a project connected through [Git sync](https://docs.lovable.dev/integrations/git-sync-overview). A draft doesn't appear as a branch in your repository, and the changes you accept reach the synced branch like any other project change.

> [accordion] Do drafts use extra credits?
>
> No. Messages you send in a draft cost the same as messages in the main version of your project, and a draft you aren't working in doesn't use credits.
>
> Creating, updating, accepting, and deleting a draft don't use credits, including an update where Lovable adjusts the draft's edits to work with newer project changes, and accepting a draft that Lovable updates first.

> [accordion] Is there a limit on the number of drafts?
>
> Yes. A project can have up to 500 open drafts at a time. Drafts you've accepted or deleted don't count toward the limit.

> [accordion] Who can work with drafts?
>
> Anyone with edit access to the project can create, build in, update, accept, and delete drafts. People with view-only access can switch between drafts, but draft actions are disabled for them. A [preview link](https://docs.lovable.dev/features/share-project.md#share-preview-links), the link you share with someone who has no Lovable account, shows the main version of your project, never a draft.

> [accordion] Can I share a draft with a client?
>
> Yes, by inviting them to the project. To build in a draft, they need edit access, which also lets them accept drafts. A [preview link](https://docs.lovable.dev/features/share-project.md#share-preview-links) can't replace the invitation, because it shows only the main version of your project, never a draft. See [Collaborate on a project](https://docs.lovable.dev/features/collaboration.md).

> [accordion] Will accepting my draft remove my teammate's work in the main version?
>
> No. When your project has newer changes, the draft gets them through an update before it's accepted, and Lovable reworks the draft's edits where they overlap. Your teammate's work stays in the project. See [Update a draft](#update-a-draft).

> [accordion] Can I reopen a draft after accepting it?
>
> You can reopen an accepted draft from version history to read its chat and review its changes, but you can't continue building in it.
>
> To continue the idea, create a new draft from the latest version of your project. To undo the code an accepted draft added, restore an earlier version from [version history](https://docs.lovable.dev/features/projects/history.md). Restoring doesn't undo changes the draft made to your database's structure. You can't revert individual edits from an accepted draft one by one.

> [accordion] Why did my draft disappear?
>
> Lovable removes a new draft after 24 hours if nobody chatted in it, renamed it, edited it, or updated it, so no work was lost. If you accepted the draft instead, you'll find it in version history.
