Project

solidflow

0.0
The project is in a healthy, maintained state
SolidFlow provides deterministic workflow orchestration for Ruby on Rails using ActiveJob and ActiveRecord. It features event-sourced history, replay, timers, signals, tasks, and SAGA compensations designed for production-grade systems.
2005
2006
2007
2008
2009
2010
2011
2012
2013
2014
2015
2016
2017
2018
2019
2020
2021
2022
2023
2024
2025
 Dependencies

Development

~> 3.13
~> 1.65

Runtime

>= 7.1, < 8.0
>= 7.1, < 8.0
>= 7.1, < 8.0
~> 3.16
~> 1.3
~> 2.6
 Project Readme

SolidFlow

SolidFlow — Durable workflows for Ruby and Rails. Deterministic workflows, event‑sourced history, timers, signals, tasks, and SAGA compensations. Backed by ActiveJob and ActiveRecord. Production‑ready, scalable, and extensible.

Installation

Add this line to your application's Gemfile:

gem "solidflow"

Then run bundle install and install the migrations:

bin/rails solidflow:install:migrations
bin/rails db:migrate

Quick Start

Define a workflow and a task:

class ReserveInventoryTask < SolidFlow::Task
  def perform(order_id:)
    Inventory.reserve(order_id: order_id)
  end
end

class OrderFulfillmentWorkflow < SolidFlow::Workflow
  signal :payment_captured

  step :reserve_inventory, task: :reserve_inventory_task

  step :await_payment do
    wait.for(seconds: 30)
    wait.for_signal(:payment_captured) unless ctx[:payment_received]
  end

  on_signal :payment_captured do |payload|
    ctx[:payment_received] = true
    ctx[:txn_id] = payload.fetch("txn_id")
  end
end

Kick off an execution:

execution = OrderFulfillmentWorkflow.start(order_id: "ORD-1")
OrderFulfillmentWorkflow.signal(execution.id, :payment_captured, txn_id: "txn-123")

CLI

bin/solidflow start OrderFulfillmentWorkflow --args '{"order_id":"ORD-1"}'
bin/solidflow signal <execution_id> payment_captured --payload '{"txn_id":"txn-123"}'
bin/solidflow query <execution_id> status

Testing

execution = SolidFlow::Testing.start_and_drain(OrderFulfillmentWorkflow, order_id: "ORD-1")
expect(execution.state).to eq("completed")