pub enum WorkflowContinuation {
Task {
id: String,
func: Option<UntypedCoreTask>,
timeout: Option<Duration>,
retry_policy: Option<RetryPolicy>,
next: Option<Box<WorkflowContinuation>>,
},
Fork {
id: String,
branches: Box<[Arc<WorkflowContinuation>]>,
join: Option<Box<WorkflowContinuation>>,
},
Delay {
id: String,
duration: Duration,
next: Option<Box<WorkflowContinuation>>,
},
AwaitSignal {
id: String,
signal_name: String,
timeout: Option<Duration>,
next: Option<Box<WorkflowContinuation>>,
},
}Expand description
A workflow structure representing the tasks to execute.
Variants§
Task
Fields
func: Option<UntypedCoreTask>Task implementation. None for registry-based execution
where tasks are looked up by id at runtime.
retry_policy: Option<RetryPolicy>Retry policy for failed task executions.
next: Option<Box<WorkflowContinuation>>Fork
Delay
A durable delay node. Input passes through unchanged.
AwaitSignal
Wait for an external signal (event). Input passes through unchanged when no signal payload is provided; otherwise the signal payload becomes the input to the next step.
Implementations§
Source§impl WorkflowContinuation
impl WorkflowContinuation
Sourcepub fn derive_fork_id(branch_ids: &[&str]) -> String
pub fn derive_fork_id(branch_ids: &[&str]) -> String
Derive a fork ID from a list of branch IDs.
The fork ID is a concatenation of branch IDs separated by ||.
Sourcepub fn first_task_id(&self) -> &str
pub fn first_task_id(&self) -> &str
Get the first task ID from this continuation.
For a Task, returns its ID. For a Fork, returns the first task ID
from the first branch.
Sourcepub fn set_task_timeout(&mut self, target_id: &str, timeout: Option<Duration>)
pub fn set_task_timeout(&mut self, target_id: &str, timeout: Option<Duration>)
Set the timeout on a specific task node found by ID.
Walks the continuation chain looking for the task with target_id
and updates its timeout. Fork branches are Arc and cannot be mutated;
join continuations are traversed.
Sourcepub fn set_task_retry_policy(
&mut self,
target_id: &str,
policy: Option<RetryPolicy>,
)
pub fn set_task_retry_policy( &mut self, target_id: &str, policy: Option<RetryPolicy>, )
Set the retry policy on a specific task node found by ID.
Same traversal pattern as set_task_timeout.
Sourcepub fn get_task_retry_policy(&self, task_id: &str) -> Option<&RetryPolicy>
pub fn get_task_retry_policy(&self, task_id: &str) -> Option<&RetryPolicy>
Look up the retry policy configured on a specific task by ID.
Sourcepub fn get_task_timeout(&self, task_id: &str) -> Option<Duration>
pub fn get_task_timeout(&self, task_id: &str) -> Option<Duration>
Look up the timeout configured on a specific task by ID.
Recursively traverses the continuation tree (Task → Delay → Fork branches/join) to find the task and return its timeout. Used by the worker to look up a timeout from the continuation when setting a deadline.
Sourcepub fn to_serializable(&self) -> SerializableContinuation
pub fn to_serializable(&self) -> SerializableContinuation
Convert to a serializable representation (strips out task implementations).
Trait Implementations§
Source§impl ContinuationState for WorkflowContinuation
impl ContinuationState for WorkflowContinuation
Source§fn append(self, new_task: WorkflowContinuation) -> WorkflowContinuation
fn append(self, new_task: WorkflowContinuation) -> WorkflowContinuation
WorkflowContinuation.