What is DBFlow?
DBFlow is a model-first approval workflow engine for Laravel and Filament. It attaches approval workflows, tasks, audit logs, and reject paths to your Eloquent models.
Alpha notice: Pin exact alpha tags in production.
dbflowlabs/filament-prois Early Access / Preview.
The core idea
Approval logic often ends up scattered across controllers and ad hoc status columns. DBFlow offers a cleaner model: publish a JSON workflow definition, attach HasWorkflow, and let the runtime handle tasks, transitions, concurrency, and history.
use DbflowLabs\Core\DBFlow;
use DbflowLabs\Core\Enums\RejectStrategy;
use DbflowLabs\Core\Enums\WorkflowTaskStatus;
DBFlow::start('refund_dispute_approval', $dispute, $user);
$task = $dispute->runningWorkflowInstance('refund_dispute_approval')
?->tasks()
->where('status', WorkflowTaskStatus::Pending)
->first();
DBFlow::approve($task, $user, 'Approved.');
DBFlow::reject($task, $user, 'Missing receipt.', RejectStrategy::Starter);
Workflow state lives in DBFlow tables (dbflow_workflow_instances, dbflow_workflow_tasks, dbflow_workflow_logs). Your domain model stays focused on business data.
What DBFlow handles
- Approvals — multi-step, multi-actor approval chains (
ApprovalMode::Any,All,Sequential) - Tasks — assignable action items that block progression
- Conditions — branch via
transitions[].conditionand workflow variables - Rollback — reject back via
RejectStrategy(Starter,PreviousNode,SpecificNode,End) - Audit logs —
dbflow_workflow_logswith actor, event type, and comment - Filament visibility — optional via
dbflowlabs/filament, or host-built inbox pages
What DBFlow is not
Not a BPM platform, Zapier clone, or no-code process suite. DBFlow is a developer tool — JSON definitions versioned in your database, authored from PHP providers or admin tools.
Also not:
- A form builder or AI workflow generator
- A replacement for Laravel queues or event listeners
- A fluent PHP node DSL
DBFlow Pro adds a LogicFlow canvas (ProCanvasField) in Early Access / Preview. JSON remains the runtime source of truth.
Good use cases
| Use case | Why it fits |
|---|---|
| Refund dispute approvals | Tiered review, amount branching, audit trail |
| Purchase / procurement requests | Multi-level sign-off with budget conditions |
| Expense claims | Submitter → manager → finance chain |
| Vendor onboarding | Document review + compliance steps |
| High-value orders | Threshold-based manual review |
| Leave requests | Manager + HR approval chain |
Not ideal for
- Generic event pipelines (use Laravel Events and Listeners)
- Simple one-step form submissions
- Complex BPMN suites with diagram interchange
- AI-generated or natural-language-defined workflows
Product layers
| Layer | Package | Role |
|---|---|---|
| DBFlow Core | dbflowlabs/core |
Runtime engine, JSON execution, hooks, logs (no admin UI) |
| DBFlow Filament Standard | dbflowlabs/filament |
Optional: My Tasks, instances, timelines, workflow resource |
| DBFlow Pro | dbflowlabs/filament-pro |
Visual canvas editor (Early Access / Preview); commercial entitlement is planned through Customer Portal |
License note: Core and Filament Standard ship with MIT license files. Pro features and production domain entitlement are commercial — see Pricing.