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

# roark customer-flow graph replace

> Replace a scripted flow's steps

Replaces a scripted flow's conversation graph with the tree you send. This is a full replace, not a merge: a step you omit is removed. Include `nodeId` on a step to update the existing one, omit it to create a new step. Where two branches rejoin, keep the `mergeIntoNodeIds` references a read gave you. Dropping them un-merges those branches and is refused unless `allowUnmerge` is set. A change to the set of paths re-seeds how the flow runs, which the response reports as `variantsReshaped` along with the resulting happy path and edge cases.

```bash Synopsis theme={"theme":{"light":"everforest-light","dark":"everforest-dark"}}
roark customer-flow graph replace <flow-id> [options]
```

> [!NOTE]
>
> Calls `PUT /v1/customer-flow/{flowId}/graph`

## Arguments

**flow-id** `string` *required*

The flow-id.

## Options

**--graph** `array` *required*

The complete graph. This replaces the flow's existing steps rather than merging into them.

**--allow-unmerge** `switch`

Confirms a write that drops branches which currently rejoin. Only needed when the request omits mergeIntoNodeIds references the flow already had; a faithful round trip never needs it.

## Example

```bash theme={"theme":{"light":"everforest-light","dark":"everforest-dark"}}
roark customer-flow graph replace <flow-id> --graph <value>
```

Every command also takes the [global options](/cli-reference/overview.md#global-options) and sets one
of the [exit codes](/cli-reference/overview.md#exit-codes).


This documentation is built and hosted on [Mintlify](https://mintlify.com), a developer documentation platform.