---
title: "Flow"
description: "For the Flow concept, read Flow."
canonical_url: "https://docs.superdurable.io/zh-Hans/reference/go/flow/"
source: "docs/reference/go/flow.mdx"
locale: "zh-Hans"
---

# Flow

For the Flow concept, read [Flow](https://docs.superdurable.io/zh-Hans/concepts/flow.md).

<a id="flow-definition"></a>

## Flow definition

A Flow registers its Steps, its persistence schema, and its RPC handlers.

- **GetSteps** registers one start Step and every other Step type the Flow
  can move to through a Step decision. The start Step input type is also the
  Flow start input type. An empty Step list, or one without a start Step, is
  valid when only RPCs drive the Flow. Those RPCs can later move it into Steps.
- The persistence schema lists every Attribute and Channel used from Steps or
  RPCs. Dex rejects reads and writes to names that are not declared.
- Return direct bound methods from **GetRPCs** with **DefineRPC**. The durable
  RPC name is the Go method name. **RPCOptions.Name** can override it.

The Flow type defaults to the Go type name of the Flow without its package, and
the Step type to the Go type name of the Step. Implement **GetFlowType** or
**GetStepType** to set another name. A Step whose Step type contains "-"
cannot start SubFlows. See [Step types that start SubFlows](https://docs.superdurable.io/zh-Hans/reference/go/subflow.md#step-type-rule).

<a id="flow-config"></a>

## FlowConfig

**FlowConfig** holds Flow settings that you can change after the Flow starts.
**StartFlowOptions** cannot change after start.

To change the initial configuration of one Flow, set **ConfigOverride** in
**StartFlowOptions**. Dex applies only the fields you set, over the Dex Server
defaults. Omitted fields keep their default values.

| Field                    | Behavior                                                                                                                                                                                                                                                          |
| ------------------------ | ----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- |
| **ActiveStepSearchMode** | Which active Steps Dex indexes for search: every active Step, only Steps that ran **WaitFor**, or none. The built-in server default indexes none. Set a mode to opt in.                                                                                           |
| **StepDurability**       | Default durability for methods without a Step override. Dex resolves a method override first, then this value, then **SYNC**. Dex fixes the durability of a method call when the call becomes pending, so a change affects only method calls scheduled afterward. |
| **AttributeStoreNames**  | Dex Server Attribute Stores for Attributes that opt in to Attribute sync.                                                                                                                                                                                         |

<a id="update-flow-config-with-a-client"></a>

### Update FlowConfig with a Client

Call **UpdateFlowConfig** while the Flow is active. Send only the fields
you want to change. Dex merges them into the existing configuration. This call
does not change which Workers serve the Flow.
