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.
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.
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"))
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?;
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.
No comments yet.
Sign in to be the first to comment.