pub struct Execution {
pub id: ExecutionId,
pub tenant_id: Option<TenantId>,
pub state: ExecutionState,
pub parent: Option<ParentLink>,
pub steps: HashMap<StepId, Step>,
pub step_order: Vec<StepId>,
pub schema_version: Option<String>,
pub started_at: Option<Instant>,
pub ended_at: Option<Instant>,
pub output: Option<String>,
pub error: Option<ExecutionError>,
}Expand description
Execution - one run of a blueprint
Fields§
§id: ExecutionIdUnique execution ID
tenant_id: Option<TenantId>Tenant ID (REQUIRED for audit trail and multi-tenant isolation) This is set from TenantContext when the kernel is created.
state: ExecutionStateCurrent state in the lifecycle
parent: Option<ParentLink>Parent execution (if this is a sub-execution)
steps: HashMap<StepId, Step>All steps in this execution
step_order: Vec<StepId>Ordered list of step IDs (for replay)
schema_version: Option<String>Schema version hash (for replay validation)
started_at: Option<Instant>Start time
ended_at: Option<Instant>End time
output: Option<String>Final output (if completed)
error: Option<ExecutionError>Structured error (if failed) - see feat-02 Error Taxonomy
Implementations§
Source§impl Execution
impl Execution
Sourcepub fn with_id(id: ExecutionId) -> Self
pub fn with_id(id: ExecutionId) -> Self
Create a new execution with a specific ID
Sourcepub fn with_tenant(tenant_id: TenantId) -> Self
pub fn with_tenant(tenant_id: TenantId) -> Self
Create a new execution with tenant ID
Sourcepub fn child(&self) -> Self
pub fn child(&self) -> Self
Create a child execution Inherits tenant_id from parent for multi-tenant isolation
Sourcepub fn with_schema_version(self, version: impl Into<String>) -> Self
pub fn with_schema_version(self, version: impl Into<String>) -> Self
Set schema version for replay validation
Sourcepub fn get_step_mut(&mut self, id: &StepId) -> Option<&mut Step>
pub fn get_step_mut(&mut self, id: &StepId) -> Option<&mut Step>
Get a mutable step by ID
Sourcepub fn duration_ms(&self) -> Option<u64>
pub fn duration_ms(&self) -> Option<u64>
Get execution duration in milliseconds
Sourcepub fn is_terminal(&self) -> bool
pub fn is_terminal(&self) -> bool
Check if execution is in a terminal state