abderrahimghazali / sylius-workflow-plugin
Visual marketing automation with node-based canvas for Sylius 2.x
Package info
github.com/abderrahimghazali/sylius-workflow-plugin
Type:sylius-plugin
pkg:composer/abderrahimghazali/sylius-workflow-plugin
Requires
- php: ^8.2
- doctrine/orm: ^2.17 || ^3.0
- sylius/sylius: ^2.1
- symfony/framework-bundle: ^7.0
- symfony/http-client: ^7.0
- symfony/messenger: ^7.0
Requires (Dev)
- phpstan/phpstan: ^1.10
- phpunit/phpunit: ^10.0
This package is auto-updated.
Last update: 2026-04-06 19:15:36 UTC
README
Sylius Workflow Plugin
Visual marketing automation engine with a node-based canvas editor for Sylius 2.x stores.
Screenshots
Canvas Editor — Visual Node-Based Workflow Builder
Workflow List — Admin Grid
Run Detail — Execution Timeline
Features
- Visual workflow builder — design automation flows on a drag-and-drop canvas, no code required
- Branching logic — condition nodes split into "Then" and "Otherwise" paths for different customer journeys
- Automated emails — send personalized emails triggered by order events, registrations, or cart abandonment
- Coupon generation — automatically create unique discount codes and deliver them to customers
- Delayed actions — schedule follow-ups hours or days after an event (e.g. review request 7 days after purchase)
- Customer tagging — segment customers automatically based on their behavior and order history
- Webhook integration — push data to external CRMs, analytics tools, or any API endpoint
- 8 ready-to-use templates — install pre-built workflows in one click: abandoned cart recovery, welcome series, birthday coupon, win-back campaigns, and more
- Test run mode — preview the execution path against a real order or customer without sending anything
- Execution log — see exactly what happened in every workflow run, node by node, with timestamps
- Multiple workflows per event — run several workflows on the same trigger (e.g. 3 different flows on order completion)
- Deduplication — prevents the same workflow from firing twice for the same customer on the same day
- Works with existing plugins — integrates with sylius-loyalty-plugin for loyalty points, degrades gracefully if not installed
Requirements
| Requirement | Version |
|---|---|
| PHP | ^8.2 |
| Sylius | ^2.1 |
| Symfony | ^7.0 |
| Node.js | ^20 (for building canvas assets) |
Installation
- Require the plugin:
composer require abderrahimghazali/sylius-workflow-plugin
- Register the bundle in
config/bundles.php(if not auto-discovered):
return [ // ... Abderrahim\SyliusWorkflowPlugin\SyliusWorkflowPlugin::class => ['all' => true], ];
- Import routes — create
config/routes/sylius_workflow.yaml:
sylius_workflow: resource: '@SyliusWorkflowPlugin/config/routes.yaml'
- Generate and run the migration:
bin/console doctrine:migrations:diff bin/console doctrine:migrations:migrate
- Build the React canvas assets:
cd vendor/abderrahimghazali/sylius-workflow-plugin
npm install --prefix assets
npx webpack --mode production
Then symlink the built file to your public directory:
bin/console assets:install public
Usage
Creating a Workflow
- Navigate to Marketing > Automation Workflows in the admin sidebar
- Click New workflow — enter a name and description
- You'll be redirected to the canvas editor with a default trigger node
- Add nodes from the + Add Node dropdown (Condition, Action, Delay)
- Connect nodes by dragging from the Then handle to the entry handle
- Configure each node by clicking it — the right panel shows type-specific fields
- Click Save to validate and persist the graph
- Toggle Activate when ready
Installing a Template
- Go to Marketing > Automation Workflows
- Click Browse Templates (or navigate to
/admin/workflows/templates) - Browse the 8 pre-built workflows by category
- Click Install Template — creates a draft workflow you can customize before activating
Test Run
- Open any workflow in the canvas editor
- Click Test Run in the toolbar
- Select a subject type (Order or Customer) and enter an ID
- The dry-run evaluates conditions for real but skips all actions
- The canvas highlights the execution path: green = passed, amber = skipped
Run Log
- From the workflow list, click View Runs on any workflow
- See all execution history with status badges (completed/failed/skipped/running)
- Click View Details to see the node-by-node execution timeline
Node Reference
Trigger Events
| Event | Description |
|---|---|
order.completed |
Fires when an order is completed |
order.cancelled |
Fires when an order is cancelled |
order.shipped |
Fires when an order is shipped |
cart.abandoned |
Fires when a cart is abandoned |
customer.registered |
Fires when a new customer registers |
customer.birthday |
Fires on a customer's birthday |
loyalty.tier_upgraded |
Fires when a loyalty tier is upgraded |
payment.failed |
Fires when a payment fails |
Condition Rules
| Rule | Operators | Description |
|---|---|---|
order_total |
is, is_not, gt, lt, gte, lte | Compare order total (in cents) |
customer_first_order |
is, is_not | Check if this is the customer's first order |
customer_tag |
is, is_not, contains | Check customer tags |
customer_country |
is, is_not | Check customer address country code |
loyalty_tier |
is, is_not | Check loyalty tier name |
workflow_run_count |
is, is_not, gt, lt, gte, lte | How many times this workflow ran for this customer |
Action Types
| Action | Config Fields | Description |
|---|---|---|
send_email |
template, subject | Send an email via Symfony Mailer |
generate_coupon |
promotion, discount, expires_in_days | Create a Sylius promotion coupon |
add_customer_tag |
tag | Add a tag to the customer |
remove_customer_tag |
tag | Remove a tag from the customer |
add_loyalty_points |
amount, reason | Award loyalty points (requires loyalty plugin) |
send_webhook |
url, method | Send an HTTP POST/PUT to an external URL |
add_order_note |
note | Append a note to the order |
Built-in Templates
| Template | Trigger | Flow |
|---|---|---|
| Abandoned Cart Recovery | cart.abandoned | Wait 1h > Send email |
| Post-Purchase Review | order.completed | Wait 7d > First order? > Send email |
| Win Back Inactive | cart.abandoned | Generate coupon > Send email |
| Birthday Coupon | customer.birthday | Generate coupon > Send email |
| Loyalty Tier Upgrade | loyalty.tier_upgraded | Send email > Add 50 points |
| New Customer Welcome | customer.registered | Wait 1h > Send email |
| Post-Purchase Upsell | order.completed | Wait 3d > First order? > Send email |
| Payment Failed Recovery | payment.failed | Wait 2h > Send email |
Integration
Loyalty Plugin
If abderrahimghazali/sylius-loyalty-plugin is installed, the Add Loyalty Points action dispatches events to it. If not installed, the action logs a warning and skips gracefully.
Upsell Plugin
The Post-Purchase Upsell template works independently but can be enhanced with abderrahimghazali/sylius-upsell-plugin for product recommendation data.
Testing
# PHP tests vendor/bin/phpunit # Static analysis vendor/bin/phpstan analyse # Build JS assets cd assets && npm install && cd .. && npx webpack --mode production
License
MIT. See LICENSE.


