Skip to content

offbit-ai/reflow

Folders and files

NameName
Last commit message
Last commit date

Latest commit

Β 

History

28 Commits
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 

Reflow

A powerful, actor-based workflow execution engine built in Rust

Build Status License: MIT Rust Version WebAssembly

πŸ“– Documentation | πŸš€ Quick Start | πŸ’‘ Examples | πŸ”§ API Reference

What is Reflow?

Reflow is a modular, high-performance workflow execution engine that uses the actor model for concurrent, message-passing computation. It enables you to build complex data processing pipelines, real-time systems, and distributed workflows with multi-language scripting support and cross-platform deployment.

Key Features

🎭 Actor-Based Architecture - Isolated, concurrent actors communicate via message passing
🌍 Multi-Language Support - JavaScript (Deno), Python, and WebAssembly runtimes
πŸ“Š Visual Workflows - Graph-based workflow representation with history and undo
⚑ High Performance - Rust-powered execution with zero-copy optimizations
🌐 Cross-Platform - Native execution + WebAssembly for browsers
πŸ”„ Real-Time Processing - Built-in networking, WebSockets, and live data streams
πŸ“¦ Extensible - Rich component library + custom component creation
πŸ› οΈ Developer Friendly - Hot reloading, debugging tools, and comprehensive APIs

Quick Start

Installation

# Install Rust (if not already installed)
curl --proto '=https' --tlsv1.2 -sSf https://sh.rustup.rs | sh

# Clone and build Reflow
git clone https://github.com/reflow-project/reflow.git
cd reflow
cargo build --release

Your First Workflow

use reflow_network::{Graph, Network};
use reflow_components::prelude::*;

#[tokio::main]
async fn main() -> Result<(), Box<dyn std::error::Error>> {
    // Create a new graph
    let mut graph = Graph::new("MyWorkflow", true, HashMap::new());
    
    // Add actors to the graph
    graph.add_node("source", "DataSource", json!({
        "data": [1, 2, 3, 4, 5]
    }));
    
    graph.add_node("processor", "MapActor", json!({
        "function": "x => x * 2"
    }));
    
    graph.add_node("sink", "Logger", json!({}));
    
    // Connect the actors
    graph.add_connection("source", "output", "processor", "input", json!({}));
    graph.add_connection("processor", "output", "sink", "input", json!({}));
    
    // Execute the workflow
    let network = Network::from_graph(graph).await?;
    network.execute().await?;
    
    Ok(())
}

Output:

[INFO] sink: 2
[INFO] sink: 4
[INFO] sink: 6
[INFO] sink: 8
[INFO] sink: 10

Architecture Overview

Reflow's architecture is built around three core concepts:

β”Œβ”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”    Messages    β”Œβ”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”    Messages    β”Œβ”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”
β”‚     Actor A     │────────────────▢│     Actor B     │────────────────▢│     Actor C     β”‚
β”‚  (JavaScript)   β”‚                 β”‚    (Python)     β”‚                 β”‚     (Rust)      β”‚
β”‚                 β”‚                 β”‚                 β”‚                 β”‚                 β”‚
β”‚ β”Œβ”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β” β”‚                 β”‚ β”Œβ”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β” β”‚                 β”‚ β”Œβ”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β” β”‚
β”‚ β”‚Input Ports  β”‚ β”‚                 β”‚ β”‚Input Ports  β”‚ β”‚                 β”‚ β”‚Input Ports  β”‚ β”‚
β”‚ β”‚Output Ports β”‚ β”‚                 β”‚ β”‚Output Ports β”‚ β”‚                 β”‚ β”‚Output Ports β”‚ β”‚
β”‚ β””β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”˜ β”‚                 β”‚ β””β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”˜ β”‚                 β”‚ β””β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”˜ β”‚
β””β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”˜                 β””β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”˜                 β””β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”˜
  • Actors: Isolated units of computation that process messages
  • Messages: Strongly-typed data passed between actors
  • Graphs: Visual representation of actor connections and data flow

Project Structure

This workspace contains multiple crates that work together:

Core Engine

  • reflow_network - Core actor runtime and message routing
  • reflow_components - Standard library of reusable actors
  • actor_macro - Procedural macros for actor creation

Language Runtimes

  • reflow_js - JavaScript/Deno runtime integration
  • reflow_py - Python runtime integration
  • reflow_wasm - WebAssembly runtime and browser support

Execution & Deployment

  • reflow_script - Multi-language script execution
  • reflow_server - HTTP server and API endpoints

Examples & Tools

  • examples/ - Working examples and tutorials
  • docs/ - Comprehensive documentation

Use Cases

Data Processing Pipelines

// ETL pipeline with error handling
source β†’ validate β†’ transform β†’ load β†’ audit

Real-Time Analytics

// Live data processing
websocket β†’ parse β†’ aggregate β†’ alert β†’ dashboard

IoT Data Processing

// Sensor data workflow  
mqtt β†’ decode β†’ filter β†’ analyze β†’ store β†’ notify

Media Processing

// Audio/video pipeline
upload β†’ decode β†’ process β†’ encode β†’ publish

Documentation

πŸ“– Complete Documentation

Getting Started

Architecture & Design

API Documentation

Advanced Topics

Reference

Examples

Explore working examples in the examples/ directory:

WebAssembly Actor

Demonstrates how to create and deploy actors as WebAssembly modules.

Development

Building from Source

# Clone the repository
git clone https://github.com/reflow-project/reflow.git
cd reflow

# Build all crates
cargo build

# Run tests
cargo test

# Build with optimizations
cargo build --release

WebAssembly Support

# Install wasm-pack
curl https://rustwasm.github.io/wasm-pack/installer/init.sh -sSf | sh

# Build WebAssembly package
cd crates/reflow_network
wasm-pack build --target web

Development Tools

# Install development dependencies
cargo install cargo-watch
cargo install flamegraph

# Run with hot reloading
cargo watch -x run

# Performance profiling
cargo flamegraph --bin reflow-example

Performance

Reflow is designed for high-performance execution:

  • Zero-copy message passing where possible
  • Parallel actor execution with work-stealing schedulers
  • Memory pooling for frequently allocated objects
  • SIMD optimizations for numeric processing
  • Async I/O throughout the system

Benchmark results on modern hardware:

  • 1M+ messages/second processing throughput
  • Sub-millisecond actor-to-actor latency
  • Linear scaling with CPU core count

Contributing

We welcome contributions! Please see our Contributing Guide for details.

Areas We Need Help With

  • πŸ› Bug Reports - Found an issue? Let us know!
  • πŸ“ Documentation - Help improve our guides and examples
  • πŸ”Œ Components - Build reusable actors for the community
  • 🌐 Language Bindings - Add support for more runtimes
  • ⚑ Performance - Optimization opportunities
  • πŸ§ͺ Testing - Expand our test coverage

Development Process

  1. Fork the repository
  2. Create a feature branch (git checkout -b feature/amazing-feature)
  3. Make your changes and add tests
  4. Ensure all tests pass (cargo test)
  5. Commit your changes (git commit -m 'Add amazing feature')
  6. Push to the branch (git push origin feature/amazing-feature)
  7. Open a Pull Request

Community

  • GitHub Discussions - Ask questions and share ideas

License

This project is licensed under the MIT License - see the LICENSE file for details.

Acknowledgments

Built with ❀️ using:

  • Rust - Systems programming language
  • Tokio - Asynchronous runtime
  • Deno - JavaScript/TypeScript runtime
  • WebAssembly - Portable binary format

⭐ Star us on GitHub if you find Reflow useful! ⭐

About

Actor-based DAG workflow execution engine for low-code applications

Topics

Resources

License

Unknown and 2 other licenses found

Licenses found

Unknown
LICENSE
Apache-2.0
LICENSE-APACHE
MIT
LICENSE-MIT

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published