Skip to main content

WorkflowNode

Trait WorkflowNode 

Source
pub trait WorkflowNode: Send + Sync {
    // Required methods
    fn id(&self) -> &str;
    fn node_type(&self) -> &str;
    fn execute<'life0, 'async_trait>(
        &'life0 self,
        ctx: NodeContext,
    ) -> Pin<Box<dyn Future<Output = Result<NodeOutput, WorkflowError>> + Send + 'async_trait>>
       where Self: 'async_trait,
             'life0: 'async_trait;

    // Provided methods
    fn input_schema(&self) -> Option<&Value> { ... }
    fn output_schema(&self) -> Option<&Value> { ... }
}
Expand description

Workflow node trait.

Required Methods§

Source

fn id(&self) -> &str

Node identifier.

Source

fn node_type(&self) -> &str

Node type name.

Source

fn execute<'life0, 'async_trait>( &'life0 self, ctx: NodeContext, ) -> Pin<Box<dyn Future<Output = Result<NodeOutput, WorkflowError>> + Send + 'async_trait>>
where Self: 'async_trait, 'life0: 'async_trait,

Execute the node.

Provided Methods§

Source

fn input_schema(&self) -> Option<&Value>

Input schema (optional).

Source

fn output_schema(&self) -> Option<&Value>

Output schema (optional).

Implementors§