Class StartFlowOptions
java.lang.Object
io.superdurable.dex.StartFlowOptions
Configures one
Client.startFlow(Flow, String, I) request.
Use the builder for optional timeout, scheduling, retry, initial Attribute, routing, and idempotency settings. Durations sent by the current client must be nonnegative whole seconds within a signed 32-bit range. Unset values use server defaults, and an unset request ID is generated by the SDK.
StartFlowOptions options = StartFlowOptions.newBuilder()
.timeout(Duration.ofHours(1))
.idReusePolicy(IdReusePolicy.ALLOW_IF_PREVIOUS_FAILED)
.addAttribute(priority, 10)
.requestId("start-order-123")
.build();
client.startFlow(orderFlow, "order-123", input, options);
To retry one logical start safely, for example after a lost response, set a stable request
ID and enable StartFlowOptions.Builder.ignoreAlreadyStarted(boolean) together. Reuse the same values on
every retry. A retry returns the existing run only when both are set and the request ID
matches the request that started that run.
StartFlowOptions retrySafeOptions = StartFlowOptions.newBuilder()
.ignoreAlreadyStarted(true)
.requestId("start-order-" + orderId)
.build();
client.startFlow(orderFlow, "order-" + orderId, input, retrySafeOptions);
-
Nested Class Summary
Nested Classes -
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionstatic StartFlowOptions.BuilderCreates a builder initialized with start defaults.
-
Constructor Details
-
StartFlowOptions
public StartFlowOptions()Creates options that use all SDK and server defaults.
-
-
Method Details
-
newBuilder
Creates a builder initialized with start defaults.- Returns:
- a new mutable builder
-