pub struct TaskEvent<'a> {
pub workflow_id: &'a str,
pub task_id: &'a str,
pub function: &'a str,
pub status: Option<u16>,
pub duration: Duration,
}Expand description
One finished task.
Borrowed for the duration of the callback; an observer must copy out anything it needs to keep.
Fields§
§workflow_id: &'a strWorkflow::id of the workflow the task belongs to.
task_id: &'a strTask::id.
function: &'a strThe function name — one of the built-in names, or a Custom handler’s
registered name.
Note this reports "validate" for both validation and validate
configs: they share a single FunctionConfig::Validation variant, and
this is that variant’s canonical name.
status: Option<u16>TaskOutcome::audit_status() for a successful dispatch, Some(500) when
the task returned Err.
None means the handler returned TaskOutcome::Skip — the body ran, but
no audit entry was recorded for it.
duration: DurationWall-clock duration of the task body only: the dispatch call, not the
condition evaluation, the audit-trail push, or the metadata.progress
write.
Derived from two Utc::now() reads rather than a monotonic clock, because
std::time::Instant::now() panics on wasm32-unknown-unknown and the
wasm bindings route through these instrumentation points. A backward clock
step clamps to zero rather than wrapping.