Concept

Draft and live

How Willo keeps a private draft of your site and backend apart from the live site, and what that means for changes your agent makes.

Last updated Open in ClaudeOpen in ChatGPT
On this page

A Willo business can have two copies of itself: the live site that visitors see, and a private draft where changes collect until someone publishes them. Whether the draft exists depends on one per-business setting, drafting. Your agent works under the same setting as Willo's chat and the dashboard.

Drafting on

While drafting is on, changes collect on the draft and nothing reaches visitors until someone publishes.

  • Site code changes land on the draft branch of the business's code repository. The draft preview on the Site page rebuilds on every saved change.
  • Backend changes land on a separate draft backend: database writes, schema changes, SQL and edge function deploys. Rows written there are scratch data for testing.
  • Reads default to the draft too: file reads come from the draft branch, and backend reads come from the draft backend once it exists.

Every backend result carries a line such as [Backend: draft] or [Backend: live] naming the copy that answered. Backend reads also take target: "live" to read what is published right now, even mid-draft.

What stays live while drafting

Some things have no draft copy. A change to them takes effect on the live business at once, drafting or not:

  • Member accounts and login email. Accounts created on the draft backend are throwaway test users.
  • Scheduled backend jobs and storage buckets.
  • Redirects. Setting or removing one changes the live site straight away.
  • CMS publishing. willo_content_write writes a draft content item, but willo_content_publish changes what the live site shows. Only that item goes live; the rest of the draft stays staged. When it can't go out on its own (for example, the draft holds its own change to the item's file), it is staged on the draft instead and waits for the next publish.

Most of these stop for a person's approval, and the card says the change is live. Each tool's reference page says when.

Publishing

Publishing ships everything on the draft together: every site change and every backend change, whoever made it. SQL that a person approved on the draft runs again on the live backend, including any rows it inserts, updates or deletes. The publish card lists each approved SQL batch in the order it runs, with its SQL and its security findings. Other rows written on the draft stay there.

There are two ways to publish:

  • Someone clicks Publish on the Site page.
  • The agent calls willo_publish, which always raises an approval card. After the person approves, the agent calls it again to start the publish.

A publish takes a few minutes, and willo_status shows when it is live. It has no one-click undo. An edge function a publish replaced can be put back by your agent: it reads the old version with willo_get_function and version: "before_last_publish", deploys it to the draft, and you publish again. See Deploy an edge function. Discard on the Site page throws the draft away instead.

Drafting off

With drafting off there is no draft and no Publish step. Every file change lands on the main branch and the live site rebuilds at once, usually within a few minutes. Backend changes apply to the live backend. The agent can tell which mode it is in from willo_status, and every write result says where it landed.

Turning drafting on needs a paid plan. Turning it off needs a clean slate: publish or discard the open draft first. Changing the setting is the owner's call, made on the dashboard or in Willo's chat.

Which copy am I looking at?

You wantAsk the agent to
Whether a draft is opencall willo_status
What the draft changes versus livecall willo_diff
A table as visitors see it nowpass target: "live" to willo_db_query
The edge function code live runspass target: "live" to willo_get_function
The code it ran before the last publishpass version: "before_last_publish" to willo_get_function
To see the change in a browseropen the draft preview on the Site page

Related: Approvals, Your first change.