PHPackages                             letots/workflow-extension-bundle - PHPackages - PHPackages  [Skip to content](#main-content)[PHPackages](/)[Directory](/)[Categories](/categories)[Trending](/trending)[Leaderboard](/leaderboard)[Changelog](/changelog)[Analyze](/analyze)[Collections](/collections)[Log in](/login)[Sign up](/register)

1. [Directory](/)
2. /
3. [Utility &amp; Helpers](/categories/utility)
4. /
5. letots/workflow-extension-bundle

ActiveLibrary[Utility &amp; Helpers](/categories/utility)

letots/workflow-extension-bundle
================================

Configurations to allow defining Symfony Workflows as PHP classes easily and little helpers functions to work with them.

0.1.3(1mo ago)0661[1 PRs](https://github.com/letots/workflow-extension-bundle/pulls)MITPHPPHP &gt;=8.3

Since Nov 22Pushed 2w agoCompare

[ Source](https://github.com/letots/workflow-extension-bundle)[ Packagist](https://packagist.org/packages/letots/workflow-extension-bundle)[ RSS](/packages/letots-workflow-extension-bundle/feed)WikiDiscussions main Synced yesterday

READMEChangelog (1)Dependencies (29)Versions (5)Used By (0)

workflow-extension-bundle
=========================

[](#workflow-extension-bundle)

Define Symfony Workflows as PHP classes using attributes, with helpers to work with them.

Workflow class
--------------

[](#workflow-class)

```
#[AsWorkflow(name: 'order', type: AsWorkflow::TYPE_STATE_MACHINE)]
class OrderWorkflow extends AbstractWorkflow
{
    public const PLACE_NEW = 'new';

    #[Place(initial: true)]
    public const PLACE_DRAFT = 'draft';

    #[Transition(from: self::PLACE_DRAFT, to: self::PLACE_NEW)]
    public const TRANSITION_PUBLISH = 'publish';
}
```

Inject the workflow by name:

```
public function __construct(
    private WorkflowInterface $order,
) {}
```

Or use the alias `workflow.order`.

Transitions
-----------

[](#transitions)

- `#[Transition]` must be placed on a **class constant**. The constant value is the transition name.
- In `TYPE_STATE_MACHINE`, each constant declares a single arc: one `from` place and one `to` place.
- To reach the same destination from several places, declare several constants with the **same transition name** (same constant value), each with its own `from` place.

```
#[Transition(from: self::PLACE_DRAFT, to: self::PLACE_NEW)]
public const TRANSITION_PUBLISH = 'publish';

#[Transition(from: self::PLACE_REVIEW, to: self::PLACE_NEW)]
public const TRANSITION_PUBLISH_FROM_REVIEW = 'publish';
```

In `TYPE_WORKFLOW`, `from` and `to` may be arrays for multi-place transitions.

Metadata
--------

[](#metadata)

Metadata can be attached to the workflow, places, and transitions. Retrieve it via `$workflow->getMetadataStore()` (same API as Symfony YAML workflows).

```
#[AsWorkflow(name: 'order', metadata: ['title' => 'Order workflow'])]
class OrderWorkflow extends AbstractWorkflow
{
    #[Place(initial: true, metadata: ['title' => 'Draft'])]
    public const PLACE_DRAFT = 'draft';

    #[Transition(from: self::PLACE_DRAFT, to: self::PLACE_NEW, metadata: ['title' => 'Publish'])]
    public const TRANSITION_PUBLISH = 'publish';
}
```

Audit trail
-----------

[](#audit-trail)

Enable workflow activity logging (requires the `logger` service, channel `workflow`):

```
#[AsWorkflow(name: 'order', auditTrail: true)]
class OrderWorkflow extends AbstractWorkflow
{
}
```

Guards
------

[](#guards)

Guards are standard Symfony workflow guard listeners. The bundle injects the application `event_dispatcher` into each workflow service so guard events are dispatched.

```
#[AsEventListener(event: 'workflow.order.guard')]
public function onGuard(GuardEvent $event): void
{
    if ($event->getTransitionName() === 'publish' && !$this->authorizationChecker->isGranted('ROLE_ADMIN')) {
        $event->setBlocked(true, 'Not allowed.');
    }
}
```

Replace `order` with the workflow name from `#[AsWorkflow(name: '...')]`.

Registry
--------

[](#registry)

When using `supportStrategy` with a class name string, the bundle registers an `InstanceOfSupportStrategy` automatically:

```
#[AsWorkflow(name: 'order', supportStrategy: Order::class)]
class OrderWorkflow extends AbstractWorkflow
{
}
```

###  Health Score

43

—

FairBetter than 89% of packages

Maintenance95

Actively maintained with recent releases

Popularity12

Limited adoption so far

Community9

Small or concentrated contributor base

Maturity47

Maturing project, gaining track record

 Bus Factor1

Top contributor holds 64.3% of commits — single point of failure

How is this calculated?**Maintenance (25%)** — Last commit recency, latest release date, and issue-to-star ratio. Uses a 2-year decay window.

**Popularity (30%)** — Total and monthly downloads, GitHub stars, and forks. Logarithmic scaling prevents top-heavy scores.

**Community (15%)** — Contributors, dependents, forks, watchers, and maintainers. Measures real ecosystem engagement.

**Maturity (30%)** — Project age, version count, PHP version support, and release stability.

###  Release Activity

Cadence

Every ~184 days

Total

4

Last Release

34d ago

### Community

Maintainers

![](https://avatars.githubusercontent.com/u/181415176?v=4)[letots](/maintainers/letots)[@letots](https://github.com/letots)

---

Top Contributors

[![akyoscommunication](https://avatars.githubusercontent.com/u/50996280?v=4)](https://github.com/akyoscommunication "akyoscommunication (9 commits)")[![thomassebert](https://avatars.githubusercontent.com/u/30130691?v=4)](https://github.com/thomassebert "thomassebert (5 commits)")

---

Tags

phpsymfonyworkflowattribute

### Embed Badge

![Health badge](/badges/letots-workflow-extension-bundle/health.svg)

```
[![Health](https://phpackages.com/badges/letots-workflow-extension-bundle/health.svg)](https://phpackages.com/packages/letots-workflow-extension-bundle)
```

###  Alternatives

[sulu/sulu

Core framework that implements the functionality of the Sulu content management system

1.3k1.4M203](/packages/sulu-sulu)[zerodahero/laravel-workflow

Integerate Symfony Workflow component into Laravel.

204890.5k8](/packages/zerodahero-laravel-workflow)[brexis/laravel-workflow

Integerate Symfony Workflow component into Laravel.

287127.4k](/packages/brexis-laravel-workflow)[fab2s/yaetl

Widely Extended Nodal Extract-Transform-Load ETL Workflow AKA NEJQTL or Nodal-Extract-Join-Qualify-Tranform-Load

66191.9k](/packages/fab2s-yaetl)[2lenet/crudit-bundle

The easy like Crud'it Bundle.

1616.4k14](/packages/2lenet-crudit-bundle)

PHPackages © 2026

[Directory](/)[Categories](/categories)[Trending](/trending)[Changelog](/changelog)[Analyze](/analyze)
