pub struct WorkflowTemplate {Show 14 fields
pub id: TemplateId,
pub name: String,
pub description: Option<String>,
pub category: Option<String>,
pub tags: Vec<String>,
pub version: String,
pub parameters: Vec<TemplateParameter>,
pub workflow_json: String,
pub author: Option<String>,
pub created_at: DateTime<Utc>,
pub updated_at: DateTime<Utc>,
pub usage_count: u64,
pub is_public: bool,
pub owner_id: Option<Uuid>,
}Expand description
A workflow template with parameterized values
Fields§
§id: TemplateIdUnique template identifier
name: StringTemplate name
description: Option<String>Template description
category: Option<String>Template category (e.g., “RAG”, “Agent”, “Data Processing”)
Tags for discovery
version: StringTemplate version
parameters: Vec<TemplateParameter>Template parameters (configurable values)
workflow_json: StringBase workflow JSON (with parameter placeholders) Placeholders use format: {{param_name}}
Template author
created_at: DateTime<Utc>Creation timestamp
updated_at: DateTime<Utc>Last updated timestamp
usage_count: u64Number of times this template has been instantiated
is_public: boolIs this template public
owner_id: Option<Uuid>Owner user ID
Implementations§
Source§impl WorkflowTemplate
impl WorkflowTemplate
Sourcepub fn add_parameter(&mut self, param: TemplateParameter)
pub fn add_parameter(&mut self, param: TemplateParameter)
Add a parameter to the template
Sourcepub fn validate_parameters(
&self,
values: &HashMap<String, Value>,
) -> Result<(), Vec<String>>
pub fn validate_parameters( &self, values: &HashMap<String, Value>, ) -> Result<(), Vec<String>>
Validate parameter values against the template
Sourcepub fn instantiate(
&self,
values: &HashMap<String, Value>,
) -> Result<Workflow, String>
pub fn instantiate( &self, values: &HashMap<String, Value>, ) -> Result<Workflow, String>
Instantiate the template with parameter values
Sourcepub fn from_workflow(workflow: &Workflow, name: String) -> Result<Self, String>
pub fn from_workflow(workflow: &Workflow, name: String) -> Result<Self, String>
Create a template from an existing workflow
Sourcepub fn extract_placeholders(&self) -> Vec<String>
pub fn extract_placeholders(&self) -> Vec<String>
Extract parameter placeholders from the workflow JSON
Trait Implementations§
Source§impl Clone for WorkflowTemplate
impl Clone for WorkflowTemplate
Source§fn clone(&self) -> WorkflowTemplate
fn clone(&self) -> WorkflowTemplate
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 moreSource§impl Debug for WorkflowTemplate
impl Debug for WorkflowTemplate
Source§impl<'de> Deserialize<'de> for WorkflowTemplate
impl<'de> Deserialize<'de> for WorkflowTemplate
Source§fn deserialize<__D>(__deserializer: __D) -> Result<Self, __D::Error>where
__D: Deserializer<'de>,
fn deserialize<__D>(__deserializer: __D) -> Result<Self, __D::Error>where
__D: Deserializer<'de>,
Deserialize this value from the given Serde deserializer. Read more
Source§impl From<&WorkflowTemplate> for TemplateListItem
impl From<&WorkflowTemplate> for TemplateListItem
Source§fn from(template: &WorkflowTemplate) -> Self
fn from(template: &WorkflowTemplate) -> Self
Converts to this type from the input type.
Auto Trait Implementations§
impl Freeze for WorkflowTemplate
impl RefUnwindSafe for WorkflowTemplate
impl Send for WorkflowTemplate
impl Sync for WorkflowTemplate
impl Unpin for WorkflowTemplate
impl UnwindSafe for WorkflowTemplate
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