Skip to main content

WorkflowOptions

Struct WorkflowOptions 

Source
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: DeduplicationPolicy

How 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: i32

Dispatch 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

Source

pub fn with_id(id: impl Into<String>) -> Self

Convenience: options that only pin the workflow id.

Source

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.

Source

pub fn authenticated_user(self, user: impl Into<String>) -> Self

Set the user the workflow runs on behalf of.

Source

pub fn assumed_role(self, role: impl Into<String>) -> Self

Set the role assumed for this run.

Source

pub fn partition_key(self, key: impl Into<String>) -> Self

Set the partition key for a partitioned queue.

Source

pub fn dedup_id(self, id: impl Into<String>) -> Self

Set the queue-scoped deduplication id.

Source

pub fn dedup_policy(self, policy: DeduplicationPolicy) -> Self

Set how a deduplication-id collision is handled (see DeduplicationPolicy).

Source

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).

Source

pub fn class_name(self, name: impl Into<String>) -> Self

Set the class / namespace name recorded on the row (cross-SDK metadata).

Source

pub fn app_version(self, version: impl Into<String>) -> Self

Stamp a specific application version on this run, overriding the default.

Source

pub fn authenticated_roles<I, S>(self, roles: I) -> Self
where I: IntoIterator<Item = S>, S: Into<String>,

Set the roles available to the authenticated user.

Trait Implementations§

Source§

impl Clone for WorkflowOptions

Source§

fn clone(&self) -> WorkflowOptions

Returns a duplicate of the value. Read more
1.0.0 (const: unstable) · Source§

fn clone_from(&mut self, source: &Self)

Performs copy-assignment from source. Read more
Source§

impl Default for WorkflowOptions

Source§

fn default() -> WorkflowOptions

Returns the “default value” for a type. Read more

Auto Trait Implementations§

Blanket Implementations§

Source§

impl<T> Any for T
where T: 'static + ?Sized,

Source§

fn type_id(&self) -> TypeId

Gets the TypeId of self. Read more
Source§

impl<T> Borrow<T> for T
where T: ?Sized,

Source§

fn borrow(&self) -> &T

Immutably borrows from an owned value. Read more
Source§

impl<T> BorrowMut<T> for T
where T: ?Sized,

Source§

fn borrow_mut(&mut self) -> &mut T

Mutably borrows from an owned value. Read more
Source§

impl<ST, DT> CastableFrom<ST, Initialized, Initialized> for DT
where ST: ?Sized, DT: ?Sized,

Source§

impl<ST, DT> CastableFrom<ST, Uninit, Uninit> for DT
where ST: ?Sized, DT: ?Sized,

Source§

impl<T> CloneToUninit for T
where T: Clone,

Source§

unsafe fn clone_to_uninit(&self, dest: *mut u8)

🔬This is a nightly-only experimental API. (clone_to_uninit)
Performs copy-assignment from self to dest. Read more
Source§

impl<T> From<T> for T

Source§

fn from(t: T) -> T

Returns the argument unchanged.

Source§

impl<T> FromRef<T> for T
where T: Clone,

Source§

fn from_ref(input: &T) -> T

Converts to this type from a reference to the input type.
Source§

impl<A, B, T> HttpServerConnExec<A, B> for T
where B: Body,

Source§

impl<T> Instrument for T

Source§

fn instrument(self, span: Span) -> Instrumented<Self>

Instruments this type with the provided Span, returning an Instrumented wrapper. Read more
Source§

fn in_current_span(self) -> Instrumented<Self>

Instruments this type with the current Span, returning an Instrumented wrapper. Read more
Source§

impl<T, U> Into<U> for T
where U: From<T>,

Source§

fn into(self) -> U

Calls U::from(self).

That is, this conversion is whatever the implementation of From<T> for U chooses to do.

Source§

impl<T> IntoEither for T

Source§

fn into_either(self, into_left: bool) -> Either<Self, Self>

Converts 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 more
Source§

fn into_either_with<F>(self, into_left: F) -> Either<Self, Self>
where F: FnOnce(&Self) -> bool,

Converts 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
Source§

impl<T> Read<Exclusive, BecauseExclusive> for T
where T: ?Sized,

Source§

impl<T> Same for T

Source§

type Output = T

Should always be Self
Source§

impl<T> ToOwned for T
where T: Clone,

Source§

type Owned = T

The resulting type after obtaining ownership.
Source§

fn to_owned(&self) -> T

Creates owned data from borrowed data, usually by cloning. Read more
Source§

fn clone_into(&self, target: &mut T)

Uses borrowed data to replace owned data, usually by cloning. Read more
Source§

impl<T, U> TryFrom<U> for T
where U: Into<T>,

Source§

type Error = Infallible

The type returned in the event of a conversion error.
Source§

fn try_from(value: U) -> Result<T, <T as TryFrom<U>>::Error>

Performs the conversion.
Source§

impl<T, U> TryInto<U> for T
where U: TryFrom<T>,

Source§

type Error = <U as TryFrom<T>>::Error

The type returned in the event of a conversion error.
Source§

fn try_into(self) -> Result<U, <U as TryFrom<T>>::Error>

Performs the conversion.
Source§

impl<V, T> VZip<V> for T
where V: MultiLane<T>,

Source§

fn vzip(self) -> V

Source§

impl<T> WithSubscriber for T

Source§

fn with_subscriber<S>(self, subscriber: S) -> WithDispatch<Self>
where S: Into<Dispatch>,

Attaches the provided Subscriber to this type, returning a WithDispatch wrapper. Read more
Source§

fn with_current_subscriber(self) -> WithDispatch<Self>

Attaches the current default Subscriber to this type, returning a WithDispatch wrapper. Read more