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"), orNoneNonemeans 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 resultFailed: The error messageContinuedAsNew: 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 stampsOrchestrationContinuedAsNewinto the current execution’s history and enqueues aWorkItem::ContinueAsNew. - When processing that work item, the runtime starts a fresh execution with
execution_id = current + 1, passes an emptyexisting_history, and stamps anOrchestrationStarted { 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_idgiven toack_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_deltaevents to the specifiedexecution_id. - Update
executions.status, executions.outputfromExecutionMetadatawhen 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): Storevas 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
impl Clone for ExecutionMetadata
Source§fn clone(&self) -> ExecutionMetadata
fn clone(&self) -> ExecutionMetadata
1.0.0 · Source§fn clone_from(&mut self, source: &Self)
fn clone_from(&mut self, source: &Self)
source. Read more