How I Made AI Agents Work Together Without Breaking Everything

Imagine running five AI agents at the same time. On the same machine. Working on the same project.

It breaks. Fast.

One agent overwrites what another just wrote. Long workflows crash halfway through and you start over. There is no way to say "this agent handles writing, that one handles review." Everything runs in one big blob.

I built Rein to fix this. A workflow orchestrator for AI agents. You describe what needs to happen in a simple YAML file, and Rein makes sure each step runs in the right order, by the right agent, with crash recovery built in.

Today I am releasing v3.3.0 with three features I have been waiting to ship.


1. Step Mode

Before: you launch a workflow and it runs for 20 minutes straight. If something fails at minute 18, you start from zero.

Now: workflows run one step at a time. Each step saves its progress. If it crashes, it picks up exactly where it left off.

rein --flow content-pipeline --step 1

This runs one block. Next time you call it, it runs the next one. Simple.

The real win: you can now run workflows from a cron job. One step every 5 minutes. Predictable. No timeouts. No surprise bills from a runaway agent.

2. Agent Routing

Not every task should be done by the same AI. A research agent should not generate images. An image generator should not check your inbox.

Now you can assign specific agents to specific blocks:

blocks:
  - name: write-draft
    agent: writer
    prompt: Write a blog post about...

  - name: review
    agent: editor
    depends_on: [write-draft]
    prompt: Review this draft...

  - name: publish
    agent: publisher
    depends_on: [review]
    prompt: Format and schedule...

Three agents, one workflow, no more guessing who does what.

Each agent can have its own model (use a cheaper model for simple tasks), its own Linux user for security isolation, and its own set of rules about what it can and cannot do.

3. Error Handlers

Agents fail. Models hallucinate. APIs time out. When it happens, and it will, you want to know immediately.

Rein now supports error handlers at two levels:

  • Per block: if this specific step fails, run this script
  • Per workflow: if anything fails, notify me on Telegram

The handler gets full context: which block failed, what the error was, where the task directory is. So you can auto-retry, roll back, or just ping yourself.


Who Is This For?

If you are building anything with multiple AI agents (content pipelines, code review bots, research workflows, data processing) Rein gives you a way to orchestrate them without writing a custom framework.

Open source, runs anywhere Python runs, works with Claude, GPT, or any LLM.

GitHub: Rein


Six months ago I was restarting crashed workflows at 2am. Now they recover on their own.

enjoyed this?

Follow me for more on AI agents, dev tools, and building with LLMs.

X / Twitter LinkedIn GitHub
← Back to blog