> This is a page from the ElevenLabs documentation. For an index of the documentation, fetch https://elevenlabs.io/docs/llms.txt.

# Test and publish

Test a routine's draft with live or mocked steps, then publish it as a version that its trigger runs.

> **Info**
>
> Routines are in beta and not yet available in every workspace. To request access, contact your
> account manager.

## Drafts and versions

The routine you edit is its **draft**. Publishing checks the draft for problems and saves it as the next numbered version. Triggers and **Run now** always use the published version, so editing the draft never changes what runs live. Each run records the version it ran, and editing or republishing never changes a run in progress.

Steps always use the current agents, tools, phone numbers, and secrets they point to, so changing an agent changes every routine that uses it, including runs in progress.

## Test a draft

#### Open the test panel

Open the routine and select **Test**.

#### Set the input

Fill in the **Test input**.

#### Choose live or mocked steps

Set each step to **Live** to run it for real, or **Mock** to test without calling, sending, or
waiting. A mocked step can return a result you choose or fail. A tool step can also use one of
the tool's saved mocks, and an HTTP request can act as if it can't connect.

![Test panel with the HTTP request mocked with a 200 response and the Agent step set to Live](/docs/_fern-files/_img/253e6f7136e337525b69696a52ef2a7e676d68e85ec9b562ce754bb9658d16e4.webp)

#### Run the test

Select **Run test**. The canvas highlights each step as it runs.

![A finished test run on the canvas, with the steps it ran marked as mocked and succeeded](/docs/_fern-files/_img/dcb11bd50241f5d09fe5af6d41bf0dd96acbf8998c705380a34d1e3efd9031b2.webp)

A mocked step doesn't send, call, or wait for anything, but it still checks its inputs, so mistakes show up in the test. Mocking a failure lets you test what happens when a step fails. For an HTTP request, **Capture a real response** sends the request once with sample values and uses the reply as the mock.

Test runs appear in run history marked as tests, and are left out of run statistics.

> **Warning**
>
> Steps set to **Live** run for real in a test. They call APIs, send messages, and place calls.

## Publish and activate

#### Publish

Select **Publish**, optionally note **What changed?**, and check **Activate after publishing**
to turn the routine on at the same time.

![Publish routine dialog with What changed? filled in and Activate after publishing checked](/docs/_fern-files/_img/e31f5e1388755ee836c9d7e3776484cb7edc7948f7bf7c39874e03e50bd16072.webp)

#### Activate or deactivate later

Use the **Enabled** switch in the editor header to turn a published routine on or off.

Turning a routine on starts its trigger, such as its schedule. Turning it off stops new runs, and lets runs in progress finish.

## Who a run acts as

Runs started by a trigger use the permissions of the person who last published the routine, so publish with an account that can use every agent, tool, and secret in it. Test runs and **Run now** use your own permissions.

If the publisher loses access, the next triggered run is refused and the routine is turned off. To resume it, publish again as a member with access, with **Activate after publishing** checked, or turn **Enabled** back on afterwards.

## Restore a version

Open **Recent versions** and select **Restore to draft** to edit an older version, or **Restore and publish** to publish it as the next version number. Restoring never removes later versions.