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