CosmoFlow
A runtime for writing reliable, asynchronous, and scalable workflow applications with the Rust programming language. It is:
-
Fast: CosmoFlow's zero-cost abstractions give you bare-metal performance for workflow orchestration.
-
Reliable: CosmoFlow leverages Rust's ownership, type system, and concurrency model to reduce bugs and ensure thread safety.
-
Scalable: CosmoFlow has a minimal footprint, and handles backpressure and cancellation naturally.
Overview
CosmoFlow is a next-generation workflow engine that brings the elegant design philosophy of PocketFlow to the Rust ecosystem. Built from the ground up for LLM applications, high-performance scenarios, and production reliability. it provides a few major components:
- A multithreaded, async-based workflow scheduler.
- A pluggable storage system backed by memory, files, or custom backends.
- Asynchronous node execution with retry logic and error handling.
These components provide the runtime infrastructure necessary for building complex workflow applications.
Example
A basic workflow with CosmoFlow.
Make sure you activated the full features of the cosmoflow crate on Cargo.toml:
[]
= { = "0.2.0", = ["full"] }
Then, on your main.rs:
use *;
use Duration;
async
To see a list of the available features flags that can be enabled, check our docs.
Getting Help
First, see if the answer to your question can be found in the Guides or the API documentation. If the answer is not there, there is an active community in the CosmoFlow Discord server. We would be happy to try to answer your question. You can also ask your question on the discussions page.
Module Ecosystem
CosmoFlow is built with a modular architecture. Each component is a module within the main
cosmoflow crate, allowing you to use only what you need through feature flags while
maintaining full composability:
-
cosmoflow: Main integration and API crate for CosmoFlow workflows. -
cosmoflow::flow: Workflow orchestration engine for managing complex multi-node workflows. -
cosmoflow::node: Execution nodes system with async support and retry logic. -
cosmoflow::action: Control flow logic and condition evaluation. -
cosmoflow::shared_store: Thread-safe data communication layer between workflow components. -
cosmoflow::storage: Pluggable storage backends (memory, file, and custom implementations). -
cosmoflow::builtin: Pre-built node components for common workflow operations.
License
This project is licensed under the MIT license.
Contribution
Unless you explicitly state otherwise, any contribution intentionally submitted for inclusion in CosmoFlow by you, shall be licensed as MIT, without any additional terms or conditions.