pub struct WorkflowOptions {Show 14 fields
pub workflow_id: Option<String>,
pub dedup_id: Option<String>,
pub dedup_policy: DeduplicationPolicy,
pub app_version: Option<String>,
pub queue: Option<String>,
pub priority: i32,
pub partition_key: Option<String>,
pub timeout: Option<Duration>,
pub delay: Option<Duration>,
pub authenticated_user: Option<String>,
pub assumed_role: Option<String>,
pub authenticated_roles: Vec<String>,
pub config_name: Option<String>,
pub class_name: Option<String>,
}Expand description
Per-invocation options for starting or enqueuing a workflow — its
idempotency key, queue and priority, deduplication, timeout, app version, and
authenticated identity. Build with the chained setters (e.g.
WorkflowOptions::with_id then queue); all
fields default to unset.
Fields§
§workflow_id: Option<String>Explicit idempotency key. If None, a uuid is generated.
dedup_id: Option<String>Queue-scoped deduplication key.
dedup_policy: DeduplicationPolicyHow a deduplication-id collision is handled (queued runs only); requires
dedup_id when not Reject.
app_version: Option<String>Application version to stamp on this run, overriding the engine/client
default. None uses the default (an empty default lets any executor
claim the work).
queue: Option<String>Route through this queue instead of running inline.
priority: i32Dispatch priority within a queue; lower runs first.
partition_key: Option<String>Partition key for a partitioned queue (see
WorkflowQueue::partitioned). Each
partition gets its own concurrency / rate-limit budget. Ignored by
non-partitioned queues and direct runs.
timeout: Option<Duration>Wall-clock deadline for the whole workflow.
delay: Option<Duration>Delay before the workflow becomes eligible to run (queued workflows
only): it sits in DELAYED until the dispatcher transitions it.
authenticated_user: Option<String>User on whose behalf the workflow runs; persisted and readable from the
workflow via DurableContext::authenticated_user.
assumed_role: Option<String>Role assumed for this run.
authenticated_roles: Vec<String>Roles available to the authenticated user.
config_name: Option<String>Config / instance name: routes this run to the handler registered for that
instance under the same workflow name (see
DurableEngine::register_configured), and is recorded so recovery
re-dispatches to the same instance.
class_name: Option<String>Class / namespace name recorded on the row (cross-SDK metadata). Not used for routing on its own.
Implementations§
Source§impl WorkflowOptions
impl WorkflowOptions
Sourcepub fn with_id(id: impl Into<String>) -> Self
pub fn with_id(id: impl Into<String>) -> Self
Convenience: options that only pin the workflow id.
Sourcepub fn queue(self, name: impl Into<String>) -> Self
pub fn queue(self, name: impl Into<String>) -> Self
Enqueue onto the named queue instead of running in-process: the row is
persisted ENQUEUED and a dispatcher on any executor claims it. Pair with
start/start_with.
Sourcepub fn authenticated_user(self, user: impl Into<String>) -> Self
pub fn authenticated_user(self, user: impl Into<String>) -> Self
Set the user the workflow runs on behalf of.
Sourcepub fn assumed_role(self, role: impl Into<String>) -> Self
pub fn assumed_role(self, role: impl Into<String>) -> Self
Set the role assumed for this run.
Sourcepub fn partition_key(self, key: impl Into<String>) -> Self
pub fn partition_key(self, key: impl Into<String>) -> Self
Set the partition key for a partitioned queue.
Sourcepub fn dedup_policy(self, policy: DeduplicationPolicy) -> Self
pub fn dedup_policy(self, policy: DeduplicationPolicy) -> Self
Set how a deduplication-id collision is handled (see
DeduplicationPolicy).
Sourcepub fn config_name(self, name: impl Into<String>) -> Self
pub fn config_name(self, name: impl Into<String>) -> Self
Route this run to the handler registered for a configured instance under
the same workflow name (see DurableEngine::register_configured).
Sourcepub fn class_name(self, name: impl Into<String>) -> Self
pub fn class_name(self, name: impl Into<String>) -> Self
Set the class / namespace name recorded on the row (cross-SDK metadata).
Sourcepub fn app_version(self, version: impl Into<String>) -> Self
pub fn app_version(self, version: impl Into<String>) -> Self
Stamp a specific application version on this run, overriding the default.
Sourcepub fn authenticated_roles<I, S>(self, roles: I) -> Self
pub fn authenticated_roles<I, S>(self, roles: I) -> Self
Set the roles available to the authenticated user.
Trait Implementations§
Source§impl Clone for WorkflowOptions
impl Clone for WorkflowOptions
Source§fn clone(&self) -> WorkflowOptions
fn clone(&self) -> WorkflowOptions
1.0.0 (const: unstable) · Source§fn clone_from(&mut self, source: &Self)
fn clone_from(&mut self, source: &Self)
source. Read moreSource§impl Default for WorkflowOptions
impl Default for WorkflowOptions
Source§fn default() -> WorkflowOptions
fn default() -> WorkflowOptions
Auto Trait Implementations§
impl Freeze for WorkflowOptions
impl RefUnwindSafe for WorkflowOptions
impl Send for WorkflowOptions
impl Sync for WorkflowOptions
impl Unpin for WorkflowOptions
impl UnsafeUnpin for WorkflowOptions
impl UnwindSafe for WorkflowOptions
Blanket Implementations§
Source§impl<T> BorrowMut<T> for Twhere
T: ?Sized,
impl<T> BorrowMut<T> for Twhere
T: ?Sized,
Source§fn borrow_mut(&mut self) -> &mut T
fn borrow_mut(&mut self) -> &mut T
impl<ST, DT> CastableFrom<ST, Initialized, Initialized> for DT
impl<ST, DT> CastableFrom<ST, Uninit, Uninit> for DT
Source§impl<T> CloneToUninit for Twhere
T: Clone,
impl<T> CloneToUninit for Twhere
T: Clone,
impl<A, B, T> HttpServerConnExec<A, B> for Twhere
B: Body,
Source§impl<T> Instrument for T
impl<T> Instrument for T
Source§fn instrument(self, span: Span) -> Instrumented<Self>
fn instrument(self, span: Span) -> Instrumented<Self>
Source§fn in_current_span(self) -> Instrumented<Self>
fn in_current_span(self) -> Instrumented<Self>
Source§impl<T> IntoEither for T
impl<T> IntoEither for T
Source§fn into_either(self, into_left: bool) -> Either<Self, Self>
fn into_either(self, into_left: bool) -> Either<Self, Self>
self into a Left variant of Either<Self, Self>
if into_left is true.
Converts self into a Right variant of Either<Self, Self>
otherwise. Read moreSource§fn into_either_with<F>(self, into_left: F) -> Either<Self, Self>
fn into_either_with<F>(self, into_left: F) -> Either<Self, Self>
self into a Left variant of Either<Self, Self>
if into_left(&self) returns true.
Converts self into a Right variant of Either<Self, Self>
otherwise. Read more