Skip to main content

ExecutionMetadata

Struct ExecutionMetadata 

Source
pub struct ExecutionMetadata {
    pub status: Option<String>,
    pub output: Option<String>,
    pub orchestration_name: Option<String>,
    pub orchestration_version: Option<String>,
    pub parent_instance_id: Option<String>,
    pub pinned_duroxide_version: Option<Version>,
}
Expand description

Execution metadata computed by the runtime to be persisted by the provider.

The runtime inspects the history_delta and orchestrator_items to compute this metadata. Providers must NOT inspect event contents themselves - they should blindly store this metadata.

This design ensures the provider remains a pure storage abstraction without orchestration knowledge.

§Fields

  • status - New execution status: Some("Completed"), Some("Failed"), Some("ContinuedAsNew"), or None

    • None means the execution is still running (no status update needed)
    • Provider should update the stored execution status when Some(...)
  • output - The terminal value to store (depends on status):

    • Completed: The orchestration’s successful result
    • Failed: The error message
    • ContinuedAsNew: The input that was passed to continue_as_new()
    • None: No output (execution still running)

§Example Usage in Provider

async fn ack_orchestration_item(..., metadata: ExecutionMetadata) {
    // Store metadata without understanding what it means
    if let Some(status) = &metadata.status {
        UPDATE executions SET status = ?, output = ? WHERE instance_id = ? AND execution_id = ?
    }
}

§ContinueAsNew Handling

ContinueAsNew is handled entirely by the runtime. Providers must NOT try to synthesize new executions in fetch_orchestration_item.

Runtime behavior:

  • When an orchestration calls continue_as_new(input), the runtime stamps OrchestrationContinuedAsNew into the current execution’s history and enqueues a WorkItem::ContinueAsNew.
  • When processing that work item, the runtime starts a fresh execution with execution_id = current + 1, passes an empty existing_history, and stamps an OrchestrationStarted { event_id: 1, .. } event for the new execution.
  • The runtime then calls ack_orchestration_item(lock_token, execution_id, ...) with the explicit execution id to persist history and queue operations.

Provider responsibilities:

  • Use the explicit execution_id given to ack_orchestration_item.
  • Idempotently create the execution record/entry if it doesn’t already exist.
  • Update the instance’s “current execution” pointer to be at least execution_id.
  • Append all history_delta events to the specified execution_id.
  • Update executions.status, executions.output from ExecutionMetadata when provided.

Fields§

§status: Option<String>

New status for the execution (‘Completed’, ‘Failed’, ‘ContinuedAsNew’, or None to keep current)

§output: Option<String>

Output/error/input to store (for Completed/Failed/ContinuedAsNew)

§orchestration_name: Option<String>

Orchestration name (for new instances or updates)

§orchestration_version: Option<String>

Orchestration version (for new instances or updates)

§parent_instance_id: Option<String>

Parent instance ID (for sub-orchestrations, used for cascading delete)

§pinned_duroxide_version: Option<Version>

Pinned duroxide version for this execution (set from OrchestrationStarted event).

The provider stores this alongside the execution record for efficient capability filtering.

  • Some(v): Store v as the execution’s pinned version. The provider should update the stored version unconditionally when provided.
  • None: No version update requested. The provider should not modify the existing stored value.

The runtime guarantees this is only set on the first turn of a new execution (when OrchestrationStarted is in the history delta), enforced by a debug_assert in the orchestration dispatcher. The provider does not need to enforce write-once semantics — it simply stores what it’s told.

Trait Implementations§

Source§

impl Clone for ExecutionMetadata

Source§

fn clone(&self) -> ExecutionMetadata

Returns a duplicate of the value. Read more
1.0.0 · Source§

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

Performs copy-assignment from source. Read more
Source§

impl Debug for ExecutionMetadata

Source§

fn fmt(&self, f: &mut Formatter<'_>) -> Result

Formats the value using the given formatter. Read more
Source§

impl Default for ExecutionMetadata

Source§

fn default() -> ExecutionMetadata

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