Skip to main content

Flow

View as Markdown

For the Flow concept, read Flow.

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.

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.

FieldBehavior
ActiveStepSearchModeWhich 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.
StepDurabilityDefault 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.
AttributeStoreNamesDex Server Attribute Stores for Attributes that opt in to Attribute sync.

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.