1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
// Copyright (c) 2026 Super Durable, Inc.
//
// Licensed under the Super Durable Source License 1.0.
// You may not use this file except in compliance with the License.
// See the LICENSE file in the repository root.
//
// SPDX-License-Identifier: LicenseRef-Super-Durable-1.0
use crate::{StepDurability, WorkerTarget};
#[derive(Clone, Debug, Default)]
/// Overrides runtime behavior for one Flow.
///
/// Omitted fields use Dex server defaults. Pass a value to [`crate::StartFlowOptions::config_override`]
/// for one execution or to [`crate::Client::update_flow_config`] for an active Flow.
pub struct FlowConfig {
pub(crate) active_step_search_mode: Option<ActiveStepSearchMode>,
pub(crate) attribute_store_name: Option<String>,
pub(crate) continue_as_new_threshold: Option<u32>,
pub(crate) continue_as_new_page_size_bytes: Option<u32>,
pub(crate) step_durability: Option<StepDurability>,
pub(crate) worker_target: Option<WorkerTarget>,
}
impl FlowConfig {
/// Creates a config with every field delegated to server defaults.
pub fn new() -> Self {
Self::default()
}
/// Controls which active Step types Dex places in the search index.
pub fn active_step_search_mode(mut self, value: ActiveStepSearchMode) -> Self {
self.active_step_search_mode = Some(value);
self
}
/// Selects the server-configured Attribute Store for opted-in Attribute writes.
///
/// Omitting this builder preserves the existing Flow setting. Passing an empty string retains
/// protocol presence and disables later synchronization. Projection is asynchronous, and an
/// external store failure does not roll back the Flow Attribute write.
#[must_use]
pub fn attribute_store_name(mut self, value: impl Into<String>) -> Self {
self.attribute_store_name = Some(value.into());
self
}
/// Sets the event-count threshold that triggers Continue-As-New.
pub fn continue_as_new_threshold(mut self, value: u32) -> Self {
self.continue_as_new_threshold = Some(value);
self
}
/// Sets the maximum history page size, in bytes, carried into Continue-As-New.
pub fn continue_as_new_page_size_bytes(mut self, value: u32) -> Self {
self.continue_as_new_page_size_bytes = Some(value);
self
}
/// Sets the default persistence durability for Step handler writes.
pub fn step_durability(mut self, value: StepDurability) -> Self {
self.step_durability = Some(value);
self
}
/// Routes future Step and RPC invocations to this WorkerService target.
pub fn worker_target(mut self, value: WorkerTarget) -> Self {
self.worker_target = Some(value);
self
}
}
#[derive(Clone, Copy, Debug, Eq, PartialEq)]
/// Controls which active Step types Dex indexes for Flow search.
pub enum ActiveStepSearchMode {
/// Indexes every active Step type, including execute-only Steps.
All,
/// Indexes a Step type only after its `wait_for` handler runs.
WithWaitFor,
/// Disables active-Step indexing for the Flow.
Disabled,
}