Skip to main content

TaskKind

Trait TaskKind 

Source
pub trait TaskKind:
    Send
    + Sync
    + 'static {
    // Required method
    fn kind_name(&self) -> &'static str;

    // Provided methods
    fn verbose_name(&self) -> &'static str { ... }
    fn on_assign(&self, _ctx: &AssignedTask<'_>) -> AssignOutcome { ... }
}
Expand description

One pluggable workflow task behavior. Defaults make the trait minimal to implement — only Self::kind_name is required; the rest opt in.

Required Methods§

Source

fn kind_name(&self) -> &'static str

Discriminator stored in WorkflowTask.kind. Globally unique across the process.

Provided Methods§

Source

fn verbose_name(&self) -> &'static str

Human-readable label for the workflow task editor’s “Kind” dropdown. Defaults to Self::kind_name.

Source

fn on_assign(&self, _ctx: &AssignedTask<'_>) -> AssignOutcome

Called when this task becomes the workflow’s current step. Side-effects (firing webhooks, recording metrics) belong here.

The default implementation returns WaitForHuman — i.e. the task behaves like the canonical group_approval kind.

Dyn Compatibility§

This trait is dyn compatible.

In older versions of Rust, dyn compatibility was called "object safety".

Implementors§