pub struct Run {Show 23 fields
pub run_id: String,
pub job_id: Option<String>,
pub script_name: String,
pub parent_run_id: Option<String>,
pub root_run_id: Option<String>,
pub child_index: Option<i32>,
pub scheduled_for: DateTime<Utc>,
pub started_at: Option<DateTime<Utc>>,
pub finished_at: Option<DateTime<Utc>>,
pub duration_ms: Option<i64>,
pub status: RunStatus,
pub attempt: i32,
pub instance_id: Option<String>,
pub placement_json: Option<Value>,
pub pool_id: Option<String>,
pub actor_json: Value,
pub params_json: Value,
pub stdout_text: Option<String>,
pub stderr_text: Option<String>,
pub error_json: Option<Value>,
pub stats_json: Option<Value>,
pub claimed_by: Option<String>,
pub claim_lease_until: Option<DateTime<Utc>>,
}Expand description
An execution instance of a scheduled job.
Fields§
§run_id: StringUnique identifier (UUID).
job_id: Option<String>Job that spawned this run (None for ad-hoc child runs).
script_name: StringScript being executed.
parent_run_id: Option<String>Parent run that spawned this run (for child runs).
root_run_id: Option<String>Root run in the lineage tree.
child_index: Option<i32>Index among siblings (for child runs).
scheduled_for: DateTime<Utc>When the run was scheduled to execute.
started_at: Option<DateTime<Utc>>When execution actually started.
finished_at: Option<DateTime<Utc>>When execution finished.
duration_ms: Option<i64>Execution duration in milliseconds.
status: RunStatusCurrent status of the run.
attempt: i32Retry attempt number (1 for first attempt).
instance_id: Option<String>Instance ID that executed this run.
placement_json: Option<Value>Placement information.
pool_id: Option<String>Target execution pool (distributed mode). None in DB means the "default" pool.
actor_json: ValueSerialized Actor for identity reconstruction.
params_json: ValueParameters passed to the script.
stdout_text: Option<String>Captured stdout from the script.
stderr_text: Option<String>Captured stderr from the script.
error_json: Option<Value>Error details if the run failed.
stats_json: Option<Value>Execution statistics.
claimed_by: Option<String>Worker instance id while status is claimed / renewed during execution.
claim_lease_until: Option<DateTime<Utc>>Worker lease expiry for reclaim / failover.
Implementations§
Source§impl Run
impl Run
Sourcepub fn new(script_name: impl Into<String>, scheduled_for: DateTime<Utc>) -> Self
pub fn new(script_name: impl Into<String>, scheduled_for: DateTime<Utc>) -> Self
Create a queued run with generated IDs and empty runtime fields.
The run starts in RunStatus::Queued. Timestamps, duration, and error
details are populated later by start, complete, or fail.