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.

  • 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.
  • Return an RpcList from rpcs to bind RPC definitions to handlers. Rpc::new declares the durable RPC name explicitly.

The Flow type defaults to the Rust type name of the Flow, and the Step type to the Rust type name of the Step. Implement flow_type or step_type to set another name.

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.