Progressive Execution
The magic of Contexts is that decisions run automatically when their inputs are ready.
You don't schedule rule execution or poll for completeness. Simply submit facts as they arrive, and the rules that can run will run.
How It Works
When you bind a rule to a context, Rulebricks knows what inputs that rule needs. When you submit a fact:
- All derived facts that depend on it recalculate
- The system checks if any bound rules now have all their required inputs
- Rules that are ready execute automatically
- Their outputs write back to the context as new facts
This happens in a single API response—you submit employment_verified: true, and you get back the approval decision your rule computed.
Cascading Execution
Rules can write facts that other rules depend on. This creates automatic chains:
Submit: credit_score = 720
↓
[Risk Assessment Rule] executes
↓
Writes: risk_tier = "low"
↓
[Pricing Rule] executes (was waiting for risk_tier)
↓
Writes: rate = 4.5, max_amount = 500000The response tells you what ran:
{
"status": "complete",
"cascaded": [
{ "rule": "risk-assessment", "result": { "risk_tier": "low" } },
{ "rule": "pricing", "result": { "rate": 4.5, "max_amount": 500000 } }
]
}Execution Modes
There are very specific situations where automatic decision evaluation on Contexts may be undesirable. While we make Automatic Execution a default, you can also turn it off, preferring to register pending rules/flows manually.
| Mode | When it runs |
|---|---|
| Enabled | Automatically when all inputs are present |
| Manual | Only when you explicitly call /solve |
Manual mode is useful when you want to control timing precisely—for example, waiting for human approval before running a disbursement rule.
Deterministic Order
When multiple rules can execute, they run in dependency order—a rule that writes risk_tier always runs before a rule that reads it. If rules have no dependencies, execution order is stable but arbitrary.
If a rule fails, the cascade stops and the error is returned. Other facts already written in that request remain—partial progress is preserved.