AgentFlow4J — governed multi-agent workflows for Spring Boot (open source)
I’ve been building multi-agent systems on top of Spring AI and kept hitting the same wall: the framework gives you primitives, but you still write the orchestration, retries, state management — and more importantly, governance.
The real issue for me was trust.
One of my agents retried a paid API 23 times overnight because of a transient error. The retry logic worked technically, but it had no notion of cost, risk or approval boundaries.
So I built AgentFlow4J: a graph-based runtime for stateful multi-agent workflows in Java, focused on governed execution.
Agents are not trusted by default.
Current governance primitives:
ToolPolicy → allow/deny tool access per agent
StatePolicy → restrict writes to sensitive state keys
BudgetPolicy → cap spend per run/node/call (tokens, dollars, call counts)
ApprovalGate → pause for human approval and resume from checkpoint
Each policy is opt-in and defaults to a no-op.
The framework builds on Spring AI, ships with a Spring Boot starter, and can run fully offline via a deterministic sample (no API key required).
This is still early-stage (v0.6, solo project, not affiliated with Spring), and I’d genuinely appreciate feedback on:
API design
governance model
developer ergonomics
failure handling
No MCP integration yet.
No benchmark theatre either — the bottleneck is usually the LLM, not the orchestration layer.
Happy to answer questions or discuss design trade-offs.
GitHub repository in the comments