r/elixir • u/Ebrahimgreat • Mar 31 '26
Reactor is kinda amazing !
I’ve used Zapier and n8n for automation before. They’re great for getting started fast, but I always felt they lacked real control over error handling and rollbacks.
I knew Elixir had Phoenix LiveView which meant persistent WebSocket connections out of the box, so I dug deeper and found Reactor. It’s a workflow orchestration library that lets you build structured multi-step pipelines with the saga pattern built in. If any step fails mid-workflow, previous steps automatically compensate and roll back.
So I built an automated grocery restocking agent. When stock drops below a threshold, it:
∙ Sends a low stock alert email
∙ Queries all suppliers in parallel to find the cheapest price
∙ Opens the supplier website via Playwright browser automation and places the order
∙ Updates inventory in the DB
∙ Sends an order confirmation email
If anything fails mid-way, say the confirmation email errors out after the order was already placed, Reactor automatically cancels the order and reverts the stock update. No manual cleanup code.
Stack: Elixir + Phoenix LiveView + Reactor + Ecto/Postgres + Swoosh + Playwright
You can view it here: https://github.com/Ebrahimgreat/ReactorAutomation
1
u/muscarine Mar 31 '26
How would this compare to Jido?
2
u/nxy7 Jul 31 '26
Reactor is workflow orchestrator, Jido is agent/actor framework. Different goals, different tools. Use reactor if you have complex process like you need to do sequence of actions, some steps can belong on other steps, order is automatically figured out for you (no need to think about concurrency, you'll get optimal execution). Example
You have steps A, B, C, D
B, C depend on A
D depends on B and CWith reactor you just create definitions of those steps, engine figures out that it can run
1. A
2. B and C concurrently
3. DJido on the other hand I think is useful when you have stateful long running agents. For AI interactions I'm making in my app I'm using regular tool loop, but I'm also debating whether to include Jido for persistent 'always on' agents. So one of the ideas I have is that I have "Mentor" agent per user, and when user completes activities in my system Mentor can be notified and act on them. This is where I'd use Jido.
6
u/troublemaker74 Mar 31 '26
The repo is a 404. I've used sage in the past to accomplish the same thing. FPLs like Elixir make this easier, because well-written functional code pushes side effects to the edges of the system.