PHPackages                             yuriteixeira/workflow-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. [Framework](/categories/framework)
4. /
5. yuriteixeira/workflow-bundle

AbandonedArchivedWorkflow-bundle[Framework](/categories/framework)

yuriteixeira/workflow-bundle
============================

Integrates Sebastian Bergaman's workflow component into Symfony 2

194.0k1[1 issues](https://github.com/yuriteixeira/WorkflowBundle/issues)PHP

Since May 13Pushed 12y ago1 watchersCompare

[ Source](https://github.com/yuriteixeira/WorkflowBundle)[ Packagist](https://packagist.org/packages/yuriteixeira/workflow-bundle)[ RSS](/packages/yuriteixeira-workflow-bundle/feed)WikiDiscussions master Synced 1mo ago

READMEChangelogDependenciesVersions (1)Used By (0)

About Workflow Bundle
=====================

[](#about-workflow-bundle)

If you ever needed to implement certain parts of your symfony2 application in a workflow fashion (like a payment state machine or a cms publishing flow), you came to the right place.

This bundle was built upon Sebastian Bergman's [ezcWorkflow component](http://zetacomponents.org/documentation/trunk/Workflow/tutorial.html). Before start, we **strongly recommend** you to understand the concepts behind it (otherwise, your are gonna fell a little bit lost to define your own workflow).

Installation
============

[](#installation)

1. Add the requirement `yuriteixeira/workflow-bundle` in your composer.json and run `composer update`:
2. Register the bundle on your AppKernel.php, by adding `new Yuriteixeira\WorkflowBundle\WorkflowBundle()` on `$bundles` array.
3. Run `php app/console`. You should see a section called `yuriteixeira` there with workflow related commands.
4. Run `php app/console doctrine:schema:update` to add the tables needed by our workflow in your database.

All right! Let's get our hands dirty.

Usage
=====

[](#usage)

Generating your own workflow
----------------------------

[](#generating-your-own-workflow)

This bundle intended to make your life easy. So, instead of give you complex instructions of how to create your workflow manually, we took this boring and error-prone job from your hands!

All you have to do is run `yuriteixeira:workflow:generate`. This code generator will generate all the needed file structure, update your AppKernel and boom, your just need to customize the code to your needs.

Understanding the generated files structure
-------------------------------------------

[](#understanding-the-generated-files-structure)

```
├── MyWorkflow
│   ├── Action
│   │   ├── CheckResultAction.php
│   │   ├── DoSomethingAction.php
│   │   ├── WorkflowBeginAction.php
│   │   └── WorkflowEndAction.php
│   ├── Command
│   │   └── GetWorkflowImageCommand.php
│   ├── DependencyInjection
│   │   ├── Configuration.php
│   │   └── MyWorkflowExtension.php
│   ├── MyWorkflow.php
│   ├── Resources
│   │   └── config
│   │       └── services.yml
│   ├── Service
│   │   └── MyWorkflowService.php
│   ├── Tests
│   │   └── Integration
│   │       └── Service
│   │           └── MyWorkflowServiceTest.php
│   ├── WorkflowDefinition.php
│   ├── WorkflowExecution.php
│   └── WorkflowExecutionFactory.php

```

Important namespaces and classes:

- **WorkflowDefinition.php** - Here you define your workflow in the ezcWorkflow way (Define a workflow through php code instead of a simple YAML or XML way is a little bit odd, but I promise to make it up soon).
- **Service\\MyWorkflowService.php** - Here you define your core functionality, that will be accessible by your **Action** classes. This class will be managed by Symfony's Dependency Injection Container, and it's id can be found on `Resources/config/services.yml`
- **GetWorkflowImageCommand.php** - This CLI Command exposes, in this case, `workflow-my-workflow:generate-workflow-image`, that generates a graphical representation of your workflow definition, like this:

[![image](https://camo.githubusercontent.com/244f3cd7801a8b5e6db90d60bdcb6710df511421e78cfc41006846ca1a22d66d/687474703a2f2f662e636c2e6c792f6974656d732f3348334a3254304c33363031305931623435304d2f6d792d776f726b666c6f775f776f726b666c6f775f32303133303432315f3231303934362e706e67)](https://camo.githubusercontent.com/244f3cd7801a8b5e6db90d60bdcb6710df511421e78cfc41006846ca1a22d66d/687474703a2f2f662e636c2e6c792f6974656d732f3348334a3254304c33363031305931623435304d2f6d792d776f726b666c6f775f776f726b666c6f775f32303133303432315f3231303934362e706e67)

Customizing the workflow definition
-----------------------------------

[](#customizing-the-workflow-definition)

Out of the box, after you generated your workflow, there is a workflow definition to exemplify how to do it in `WorkflowDefinition.php`.

Your workflow business should reside on `MyWorkflow\Action` namespace. Just follow the examples and you will be good.

Change the `WorkflowDefinition` class according to your needs (check this [tutorial](http://zetacomponents.org/documentation/trunk/Workflow/tutorial.html) to know how to link your workflow nodes).

Starting
--------

[](#starting)

Each workflow you generate has a service exposed on Symfony's Dependency Injection Container. Check it's name on your workflow's `services.yml` file. Supposing that it's name is `workflow.my_workflow`, to start it inside a Controller:

```
$this->get('workflow.my_workflow')->startNewWorkflowExecution();

```

Resuming paused workflows
-------------------------

[](#resuming-paused-workflows)

Workflows can be paused and resumed arbitrary.

To pause it, inside your `Action` class `run` method, return `false` instead of `true`.

To resume it, run `yuriteixeira:workflow:resume`.

Techinal Debits (you may help here!)
====================================

[](#techinal-debits-you-may-help-here)

- Tests
- Build tasks (phpcs, phpmd, code coverage, etc)
- Add repo to Travis CI
- Resume workflows through `resumeWorkflowExecution($executionId)` method of service
- CLI argument to resume only one workflow

Future features
===============

[](#future-features)

- Define workflow through a YAML config
- Be independent of workflow-database-tiein, that limits the options of database drivers (should use PDO/DBAL)
- Be independent of Sebastian Bergman's ezcWorkflow (it is awesome, but I would like to modernize and simplify it a lil bit)

###  Health Score

26

—

LowBetter than 43% of packages

Maintenance19

Infrequent updates — may be unmaintained

Popularity27

Limited adoption so far

Community8

Small or concentrated contributor base

Maturity41

Maturing project, gaining track record

 Bus Factor1

Top contributor holds 100% 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.

### Community

Maintainers

![](https://www.gravatar.com/avatar/a988bc3fa1f3dfddda7038c7e3382e17c8095ba1c9ff35c7c18092d0cd5550cd?d=identicon)[yuriteixeira](/maintainers/yuriteixeira)

---

Top Contributors

[![yuriteixeira](https://avatars.githubusercontent.com/u/461055?v=4)](https://github.com/yuriteixeira "yuriteixeira (9 commits)")

### Embed Badge

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

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

###  Alternatives

[laravel/telescope

An elegant debug assistant for the Laravel framework.

5.2k67.8M190](/packages/laravel-telescope)[spiral/roadrunner

RoadRunner: High-performance PHP application server and process manager written in Go and powered with plugins

8.4k12.2M84](/packages/spiral-roadrunner)[nolimits4web/swiper

Most modern mobile touch slider and framework with hardware accelerated transitions

41.8k177.2k1](/packages/nolimits4web-swiper)[laravel/dusk

Laravel Dusk provides simple end-to-end testing and browser automation.

1.9k36.7M255](/packages/laravel-dusk)[laravel/prompts

Add beautiful and user-friendly forms to your command-line applications.

708181.8M591](/packages/laravel-prompts)[cakephp/chronos

A simple API extension for DateTime.

1.4k47.7M119](/packages/cakephp-chronos)

PHPackages © 2026

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