---
title: "Flow"
description: "For the Flow concept, read Flow."
canonical_url: "https://docs.superdurable.io/zh-Hans/reference/python/flow/"
source: "docs/reference/python/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.

- **get_steps** 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.
- Mark RPC methods with **@rpc**. The durable RPC name is the method name
  unless the decorator supplies **name**.

The Flow type defaults to the Flow class name, and the Step type to the Step
class name. Override **get_flow_type** or **get_step_type** to set another name.
A Step type set with **get_step_type** must not contain "-" if the Step
starts SubFlows. The server fails such an attempt without retry. See
[Step types that start SubFlows](https://docs.superdurable.io/zh-Hans/reference/python/subflow.md#step-types-that-start-subflows).

<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 **update_flow_config** 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.
