nubitio / workflow-bundle
Opt-in state-machine kit for Nubit Symfony apps: Workflow attribute, transition API, and x-workflow OpenAPI hints.
Package info
github.com/nubitio/workflow-bundle
Type:symfony-bundle
pkg:composer/nubitio/workflow-bundle
v0.10.3
2026-06-19 11:33 UTC
Requires
- php: >=8.5
- api-platform/core: ^4.1
- doctrine/orm: ^3.0
- nubitio/api-platform: 0.*
- symfony/config: ^7.4 || ^8.0
- symfony/dependency-injection: ^7.4 || ^8.0
- symfony/framework-bundle: ^7.4 || ^8.0
- symfony/http-foundation: ^7.4 || ^8.0
- symfony/http-kernel: ^7.4 || ^8.0
- symfony/routing: ^7.4 || ^8.0
- symfony/security-core: ^7.4 || ^8.0
- symfony/serializer: ^7.4 || ^8.0
Requires (Dev)
- phpunit/phpunit: ^12.0
README
Opt-in state-machine kit for Nubit Symfony apps.
Install
composer require nubitio/workflow-bundle
Register routes (e.g. config/routes/nubit_workflow.yaml):
nubit_workflow: resource: '@NubitWorkflowBundle/config/workflow_routes.yaml'
Enable in config/packages/nubit_workflow.yaml:
nubit_workflow: enabled: true
Usage
use Nubit\WorkflowBundle\Attribute\Workflow; #[Workflow( field: 'status', transitions: [ 'send_to_kitchen' => [ 'from' => ['open'], 'to' => 'preparing', 'label' => 'Enviar a cocina', 'roles' => ['ROLE_WAITER'], ], 'pay' => [ 'from' => ['served', 'open'], 'to' => 'paid', 'label' => 'Cobrar', 'set' => ['paymentMethod' => 'cash'], ], ], )] class Order { ... }
Transitions are exposed as:
POST /api/orders/{id}/transition/{name}
The Hydra API doc publishes x-workflow so @nubitio/react-admin can render row actions automatically.