pub struct NodeModel {
pub id: String,
pub title: String,
pub desc: String,
pub uses: String,
pub error_strategy: Option<String>,
pub retry: Option<Value>,
pub timeout: Option<u64>,
pub action: Value,
}Expand description
Represents a node in a workflow definition.
Nodes are the building blocks of a workflow, each performing a specific action such as HTTP requests, code execution, conditional branching, or agent calls.
§Example
use actflow::NodeModel;
use serde_json::json;
let node = NodeModel {
id: "http_node".to_string(),
title: "Fetch Data".to_string(),
desc: "Fetch data from API".to_string(),
uses: "http_request".to_string(),
action: json!({
"url": "https://api.example.com/data",
"method": "GET"
}),
..Default::default()
};Fields§
§id: StringUnique identifier for this node within the workflow.
title: StringHuman-readable title for display purposes.
desc: StringDescription of what this node does.
uses: StringAction type to use (e.g., “start”, “http_request”, “code”, “if_else”, “agent”, “end”).
error_strategy: Option<String>Error handling strategy: “fail_branch” or “continue”.
retry: Option<Value>Retry configuration for failed executions.
timeout: Option<u64>Execution timeout in milliseconds.
action: ValueAction-specific configuration parameters.
Trait Implementations§
Source§impl<'de> Deserialize<'de> for NodeModel
impl<'de> Deserialize<'de> for NodeModel
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
Auto Trait Implementations§
impl Freeze for NodeModel
impl RefUnwindSafe for NodeModel
impl Send for NodeModel
impl Sync for NodeModel
impl Unpin for NodeModel
impl UnwindSafe for NodeModel
Blanket Implementations§
§impl<T> BorrowMut<T> for Twhere
T: ?Sized,
impl<T> BorrowMut<T> for Twhere
T: ?Sized,
§fn borrow_mut(&mut self) -> &mut T
fn borrow_mut(&mut self) -> &mut T
Mutably borrows from an owned value. Read more
§impl<T> CloneToUninit for Twhere
T: Clone,
impl<T> CloneToUninit for Twhere
T: Clone,
§unsafe fn clone_to_uninit(&self, dest: *mut u8)
unsafe fn clone_to_uninit(&self, dest: *mut u8)
🔬This is a nightly-only experimental API. (
clone_to_uninit)Source§impl<T> Instrument for T
impl<T> Instrument for T
Source§fn instrument(self, span: Span) -> Instrumented<Self>
fn instrument(self, span: Span) -> Instrumented<Self>
Source§fn in_current_span(self) -> Instrumented<Self>
fn in_current_span(self) -> Instrumented<Self>
Source§impl<T> IntoEither for T
impl<T> IntoEither for T
Source§fn into_either(self, into_left: bool) -> Either<Self, Self>
fn into_either(self, into_left: bool) -> Either<Self, Self>
Converts
self into a Left variant of Either<Self, Self>
if into_left is true.
Converts self into a Right variant of Either<Self, Self>
otherwise. Read moreSource§fn into_either_with<F>(self, into_left: F) -> Either<Self, Self>
fn into_either_with<F>(self, into_left: F) -> Either<Self, Self>
Converts
self into a Left variant of Either<Self, Self>
if into_left(&self) returns true.
Converts self into a Right variant of Either<Self, Self>
otherwise. Read moreSource§impl<T> IntoRequest<T> for T
impl<T> IntoRequest<T> for T
Source§fn into_request(self) -> Request<T>
fn into_request(self) -> Request<T>
Wrap the input message
T in a tonic::Request