| Crates.io | node-flow |
| lib.rs | node-flow |
| version | 0.2.0 |
| created_at | 2025-03-03 23:58:57.945435+00 |
| updated_at | 2025-11-05 20:47:21.477714+00 |
| description | Runtime-agnostic, asynchronous node-based framework for building composable flows |
| homepage | |
| repository | https://github.com/HANDZCZ/node-flow |
| max_upload_size | |
| id | 1576543 |
| size | 219,387 |
Node Flow is runtime-agnostic, composable, asynchronous node-based framework for building structured and reusable data processing pipelines, workflows, or control flows.
The core idea is that each node represents a self-contained asynchronous operation, and flows define how multiple nodes are composed and executed.
use node_flow::node::{Node, NodeOutput};
use node_flow::flows::SequentialFlow;
// Example node
#[derive(Clone)]
struct AddOne;
struct ExampleCtx;
impl<Ctx: Send> Node<u8, NodeOutput<u8>, (), Ctx> for AddOne {
async fn run(&mut self, input: u8, _: &mut Ctx) -> Result<NodeOutput<u8>, ()> {
Ok(NodeOutput::Ok(input + 1))
}
}
async fn main() {
let mut flow = SequentialFlow::<u8, u8, (), _>::builder()
.add_node(AddOne)
.add_node(AddOne)
.add_node(AddOne)
.build();
let mut ctx = ExampleCtx;
let result = flow.run(5u8, &mut ctx).await;
assert_eq!(result, Ok(NodeOutput::Ok(8)));
}
Use this crate when you need: