pub struct WorkflowRecord {
pub id: Uuid,
pub workflow_name: String,
pub version: u32,
pub input: Value,
pub output: Option<Value>,
pub status: WorkflowStatus,
pub current_step: Option<String>,
pub step_results: Value,
pub started_at: DateTime<Utc>,
pub completed_at: Option<DateTime<Utc>>,
pub error: Option<String>,
pub trace_id: Option<String>,
}Expand description
A workflow run record in the database.
Fields§
§id: UuidUnique workflow run ID.
workflow_name: StringWorkflow name.
version: u32Workflow version.
input: ValueInput data as JSON.
output: Option<Value>Output data as JSON (if completed).
status: WorkflowStatusCurrent status.
current_step: Option<String>Current step name.
step_results: ValueStep results as JSON map.
started_at: DateTime<Utc>When the workflow started.
completed_at: Option<DateTime<Utc>>When the workflow completed.
error: Option<String>Error message if failed.
trace_id: Option<String>Trace ID for distributed tracing.
Implementations§
Source§impl WorkflowRecord
impl WorkflowRecord
Sourcepub fn new(workflow_name: impl Into<String>, version: u32, input: Value) -> Self
pub fn new(workflow_name: impl Into<String>, version: u32, input: Value) -> Self
Create a new workflow record.
Sourcepub fn with_trace_id(self, trace_id: impl Into<String>) -> Self
pub fn with_trace_id(self, trace_id: impl Into<String>) -> Self
Set trace ID.
Sourcepub fn compensating(&mut self)
pub fn compensating(&mut self)
Mark as compensating.
Sourcepub fn compensated(&mut self)
pub fn compensated(&mut self)
Mark as compensated.
Sourcepub fn set_current_step(&mut self, step: impl Into<String>)
pub fn set_current_step(&mut self, step: impl Into<String>)
Update current step.
Sourcepub fn add_step_result(&mut self, step_name: &str, result: Value)
pub fn add_step_result(&mut self, step_name: &str, result: Value)
Add step result.
Trait Implementations§
Source§impl Clone for WorkflowRecord
impl Clone for WorkflowRecord
Source§fn clone(&self) -> WorkflowRecord
fn clone(&self) -> WorkflowRecord
Returns a duplicate of the value. Read more
1.0.0 · Source§fn clone_from(&mut self, source: &Self)
fn clone_from(&mut self, source: &Self)
Performs copy-assignment from
source. Read moreAuto Trait Implementations§
impl Freeze for WorkflowRecord
impl RefUnwindSafe for WorkflowRecord
impl Send for WorkflowRecord
impl Sync for WorkflowRecord
impl Unpin for WorkflowRecord
impl UnwindSafe for WorkflowRecord
Blanket Implementations§
Source§impl<T> BorrowMut<T> for Twhere
T: ?Sized,
impl<T> BorrowMut<T> for Twhere
T: ?Sized,
Source§fn borrow_mut(&mut self) -> &mut T
fn borrow_mut(&mut self) -> &mut T
Mutably borrows from an owned value. Read more
Source§impl<T> CloneToUninit for Twhere
T: Clone,
impl<T> CloneToUninit for Twhere
T: Clone,
Source§impl<T> Instrument for T
impl<T> Instrument for T
Source§fn instrument(self, span: Span) -> Instrumented<Self>
fn instrument(self, span: Span) -> Instrumented<Self>
Source§fn in_current_span(self) -> Instrumented<Self>
fn in_current_span(self) -> Instrumented<Self>
Source§impl<T> IntoEither for T
impl<T> IntoEither for T
Source§fn into_either(self, into_left: bool) -> Either<Self, Self>
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 moreSource§fn into_either_with<F>(self, into_left: F) -> Either<Self, Self>
fn into_either_with<F>(self, into_left: F) -> Either<Self, Self>
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