nubitio/workflow-bundle

Opt-in state-machine kit for Nubit Symfony apps: Workflow attribute, transition API, and x-workflow OpenAPI hints.

Maintainers

Package info

github.com/nubitio/workflow-bundle

Homepage

Issues

Type:symfony-bundle

pkg:composer/nubitio/workflow-bundle

Statistics

Installs: 1

Dependents: 0

Suggesters: 0

Stars: 0

v0.10.3 2026-06-19 11:33 UTC

This package is auto-updated.

Last update: 2026-06-19 12:15:02 UTC


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.