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

# Wizard Editor

> Configure wizard template steps, validation, and visibility conditions using the Wizard Builder.

The Wizard Editor at `/fw/wizards/:id/edit` provides the full `WizardBuilder` interface for configuring wizard template steps, step conditions, and overall template settings. Editing is protected by a distributed lock to prevent concurrent modifications.

## Overview

The Wizard Editor loads the template identified by `:id` via `useWizardTemplateDetail`. Before rendering the builder, it acquires an edit lock via `useWizardLock`. If a lock conflict is detected (another user is editing), a `LockConflictDialog` is shown with options to retry, start fresh, or cancel. The `WizardBuilder` is only rendered when the lock is held (`hasLock === true`).

A `QuickTip` in the header guides users to add steps first, then configure each step's details, and use preview to test.

## Who it's for

Requires `pf.wizards.edit` permission (`PERMISSIONS.PF.WIZARDS_EDIT`), enforced by `RequirePermission` wrapping the page content.

## Before you start

* You must have the `pf.wizards.edit` permission.
* The wizard template must exist. If not found or an error occurs, a destructive alert is shown.
* If another user is currently editing the wizard, the lock conflict dialog will appear.

## Steps

1. Navigate to `/fw/wizards/:id/edit` or select the edit action for a wizard from the Wizard Templates page.
2. Wait for the lock to be acquired. If a conflict is detected:
   * Select **Retry** to attempt to acquire the lock again.
   * Select **Start Fresh** or **Cancel** to return to the Wizard Templates page.
3. Once the lock is held, the `WizardBuilder` is rendered.
4. Add steps and configure each step's details in the builder.
5. Use the preview capability to test the wizard flow.
6. Save changes within the builder.
7. Select **Back to Wizards** to return to the Wizard Templates list.

## Key concepts

* **Edit lock** — A distributed lock (via `useWizardLock`) that prevents concurrent editing. The lock is associated with the template's `executionId`.
* **Lock conflict** — Occurs when another user holds the lock. Surfaced via `LockConflictDialog` showing who holds the lock.
* **WizardBuilder** — The primary editing component; SME should confirm step types, field types, and visibility condition configuration.
* **`is_active`** — Controls whether the wizard template is available for execution. Activation is managed within the builder or templates list.

## Related

<Columns cols={2}>
  <Card title="Forms & Workflow" icon="diagram-project" href="/fw/overview">
    Forms & Workflow core overview.
  </Card>

  <Card title="Governance & parity" icon="scale-balanced" href="/governance/index" />
</Columns>

<Note>
  This page documents shipped product behavior. It is not medical, legal, or
  billing advice. Verify against your organization's policies and applicable
  regulations before using it for clinical, compliance, or billing decisions.
  Protected health information (PHI) shown in the product is governed by your
  tenant's access controls and is never exposed in this documentation.
</Note>

<Accordion title="Documentation sources">
  * src/routes/fw\.tsx
  * src/platform/wizards/pages/WizardBuilderPage.tsx
  * src/platform/wizards/hooks/useWizardLock.ts
  * src/platform/wizards/hooks/useWizardTemplateDetail.ts
  * src/platform/wizards/components/WizardBuilder.tsx
  * src/platform/permissions/constants.ts
</Accordion>
