What is DBFlow?
DBFlow is a model-first workflow engine for Laravel and Filament. It attaches approval workflows, tasks, audit logs, and reject paths directly to your Eloquent models — without rebuilding your domain logic around a separate process engine.
Alpha notice:
dbflowlabs/coreanddbflowlabs/filamentare available through Composer / Packagist; pin exact alpha tags in production.dbflowlabs/filament-proremains Early Access / Preview.
The core idea
In most Laravel applications, approval logic ends up scattered across controllers, observers, and service classes. You track state in ad hoc columns, hand-roll transitions, and accumulate edge cases around concurrent approvals and audit requirements.
DBFlow offers a cleaner model: publish a JSON workflow definition, attach HasWorkflow to your model, 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
DBFlow is not a generic BPM platform, a Zapier clone, or a no-code process suite for non-technical users. It is a developer tool. Definitions are JSON schemas versioned in your database, typically authored from PHP providers or Standard/Pro admin tools.
It is also not:
- A form builder
- An AI-generated workflow tool
- A replacement for Laravel queues or event listeners
- A fluent PHP node DSL (no
ApprovalNode::make()chain)
DBFlow Pro adds a Filament-native LogicFlow canvas (ProCanvasField) in Early Access / Preview. The JSON definition 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.