PitchHut logo
Sayiir
A lightweight workflow engine in Rust with seamless Python bindings.
Pitch

Sayiir offers a durable, fast workflow engine designed for developers seeking simplicity and performance. Built in Rust and featuring Python and Node.js bindings, it ensures high-performance execution without the need for complex configurations. Experience seamless integration with a focus on developer-friendly idioms and natural code workflows.

Description

Sayiir is a lightweight, durable workflow engine that emphasizes simplicity, performance, and developer-friendliness. Built with a Rust core, it offers Python and Node.js bindings, enabling seamless integration into existing applications without the need for complex domain-specific languages (DSLs) or tedious replay mechanisms.

Key Features

  • Zero Orchestration: Operates without a separate server or infrastructure. An enterprise server for more extensive deployments is in the development pipeline.
  • High Performance: With a Rust core at its foundation, Sayiir provides a fast, memory-safe workflow engine.
  • Durability: Automatic checkpointing and crash recovery capabilities are incorporated, with options for customizable persistence.
  • Multi-Language Support: Sayiir supports type-safe bindings for Python, TypeScript, and Rust, making it accessible to developers across various platforms.
  • Developer-Centric Design: No steep learning curve; workflows can be defined in a familiar coding style, using asynchronous code as needed.
  • Enhanced Workflow Control: Users can cancel, pause, or resume active workflow instances.

Why Choose Sayiir?

  • Efficient Process Resumption: Unlike traditional workflow engines that require replay from the beginning, Sayiir allows resuming from the last checkpoint, thus reducing overhead and improving performance.
  • Flexibility with Execution: The continuation-driven execution model eliminates constraints related to determinism, allowing for broader API and library usage without adhering to strict purity rules.
  • Easy to Learn: Familiar language constructs and sensible defaults ensure that developers can quickly adapt to Sayiir without needing additional YAML or DSL configuration.

Usage Examples

Python Example

from sayiir import task, Flow, run_workflow

@task
def fetch_user(user_id: int) -> dict:
    return {"id": user_id, "name": "Alice"}

@task
def send_email(user: dict) -> str:
    return f"Sent welcome to {user['name']}"

workflow = Flow("welcome").then(fetch_user).then(send_email).build()

# Quick run — no persistence
result = run_workflow(workflow, 42)

# Durable backend for crash recovery
from sayiir import run_durable_workflow, PostgresBackend
instance_id = f"welcome-{user_id}"
status = run_durable_workflow(workflow, instance_id, 42, backend=PostgresBackend("postgresql://localhost/sayiir"))

Rust Example

use sayiir_runtime::prelude::*;

#[task(timeout = "30s", retries = 3)]
asyn fn fetch_user(id: UserId) -> Result<User, BoxError> {
    db.get_user(id).await
}

#[task]
asyn fn send_email(user: User) -> Result<(), BoxError> {
    email_service.send_welcome(&user).await
}

// Compose — workflow! auto-registers all tasks
let workflow = workflow! {
    name: "welcome",
    steps: [fetch_user, send_email]
}.unwrap();

// Quick run — no persistence
workflow.run_once(user_id).await?;

// Durable backend for crash recovery
let runner = CheckpointingRunner::new(PostgresBackend::connect("postgres://...").await?);
let instance_id = format!("welcome-{user_id}");
runner.run(&workflow, &instance_id, user_id).await?;

Documentation and Community Support

Explore the full documentation, including guides, tutorials, and API references at docs.sayiir.dev. Engage with the community through Discord and contribute to discussions regarding bugs, feature requests, and enhancements.

0 comments

No comments yet.

Sign in to be the first to comment.