Download the PHP package pstoute/laravel-workflow-conductor without Composer
On this page you can find all versions of the php package pstoute/laravel-workflow-conductor. It is possible to download/install these versions without Composer. Possible dependencies are resolved automatically.
Download pstoute/laravel-workflow-conductor
More information about pstoute/laravel-workflow-conductor
Files in pstoute/laravel-workflow-conductor
Package laravel-workflow-conductor
Short Description A powerful, Laravel-native workflow conductor that lets users build automation with triggers, conditions, and actions
License MIT
Homepage https://github.com/pstoute/laravel-workflow-conductor
Informations about the package laravel-workflow-conductor
Laravel Workflow Conductor
A powerful, Laravel-native workflow conductor that lets users build automation with triggers, conditions, and actions. Think Zapier/Make/n8n but self-hosted and deeply integrated with Laravel.
Features
- Triggers: Model events, webhooks, scheduled (cron), manual
- Conditions: Field comparisons, date conditions, relation checks, custom callbacks
- Actions: Send emails, notifications, webhooks, Slack messages, create/update/delete models
- Variable Interpolation: Use
{{ model.field }}syntax with filters - Condition Logic: AND/OR grouping for complex conditions
- Async Execution: Queue-based execution with retry support
- Execution Logging: Track every workflow execution and action result
- Extensible: Easily add custom triggers, conditions, and actions
Requirements
- PHP 8.2+
- Laravel 10.x, 11.x, or 12.x
Installation
Publish the configuration file:
Run the migrations:
Using with an Existing Schema
If your application already has workflow/automation tables, you can skip the package migrations and map your models:
Your models should extend the package models and override getTable():
If you are using dont-discover to prevent auto-registration, create a wrapper provider:
Quick Start
Creating a Workflow Programmatically
Using the HasWorkflows Trait
Add the trait to your models to automatically trigger workflows on model events:
Manual Workflow Execution
Configuration
The configuration file is located at config/workflow-conductor.php. Key options include:
Triggers
Model Events
Available model triggers:
model.created- When a model is createdmodel.updated- When a model is updated (optionally watch specific fields)model.deleted- When a model is deleted
Scheduled (Cron)
Webhook
Manual
Conditions
Field Conditions
Available operators:
equals,not_equalscontains,not_containsstarts_with,ends_withgreater_than,less_than,greater_or_equal,less_or_equalis_null,is_not_nullis_empty,is_not_emptyin,not_inmatches_regexbetween
Date Conditions
Relation Conditions
Actions
Send Email
Send Notification
Webhook
Slack Message
Create/Update/Delete Model
Delay
HTTP Request
Variable Interpolation
Use {{ variable.path }} syntax in action configurations:
Available Filters
| Filter | Description | Example |
|---|---|---|
uppercase |
Convert to uppercase | {{ name \| uppercase }} |
lowercase |
Convert to lowercase | {{ name \| lowercase }} |
number_format:N |
Format number with N decimals | {{ price \| number_format:2 }} |
date:format |
Format date | {{ created_at \| date:Y-m-d }} |
default:value |
Default if null | {{ name \| default:Guest }} |
json |
Convert to JSON | {{ data \| json }} |
slug |
Convert to slug | {{ title \| slug }} |
money |
Format as currency | {{ price \| money }} |
count |
Count array items | {{ items \| count }} |
join:separator |
Join array | {{ tags \| join:, }} |
Events
The package dispatches events during workflow execution:
WorkflowStarted- When a workflow begins executionWorkflowCompleted- When a workflow completes successfullyWorkflowFailed- When a workflow failsActionExecuted- When an action completes successfullyActionFailed- When an action fails
Contributing Custom Extensions
Creating a Custom Trigger
To create a custom trigger, implement TriggerInterface:
Register your trigger in a service provider:
Then trigger it from your code:
Creating a Custom Action
To create a custom action, implement ActionInterface:
Register your action in a service provider:
Now you can use it in workflows:
Creating a Custom Condition
To create a custom condition, implement ConditionInterface:
Register and use:
Using Custom Handlers
For quick custom logic without creating full classes, use the custom action/condition:
Building an Extension Provider
For applications with multiple custom triggers and actions, organize them in a dedicated service provider:
Disable built-in actions that your app replaces to avoid duplicates:
Action Output and Chaining
Each action's output is merged into the WorkflowContext under the previous_actions key, making it available to subsequent actions:
Querying the Registry
Use the WorkflowManager to list all registered extensions programmatically. This is useful for building UI dashboards where users configure workflows:
Using the VariableInterpolator
The VariableInterpolator resolves {{ path }} placeholders against a WorkflowContext. Use it to process action configs before execution:
All Available Filters
| Filter | Description | Example |
|---|---|---|
uppercase / upper |
Uppercase | {{ name \| uppercase }} |
lowercase / lower |
Lowercase | {{ name \| lowercase }} |
ucfirst / capitalize |
Capitalize first letter | {{ name \| ucfirst }} |
ucwords / title |
Title case | {{ name \| title }} |
trim |
Trim whitespace | {{ input \| trim }} |
slug |
URL slug | {{ title \| slug }} |
snake |
snake_case | {{ name \| snake }} |
camel |
camelCase | {{ name \| camel }} |
studly / pascal |
StudlyCase | {{ name \| studly }} |
number_format:decimals |
Format number | {{ price \| number_format:2 }} |
date:format |
Format date | {{ created_at \| date:M d, Y }} |
default:value |
Fallback if null | {{ name \| default:Guest }} |
json |
JSON encode | {{ data \| json }} |
count |
Count items | {{ items \| count }} |
first |
First element | {{ items \| first }} |
last |
Last element | {{ items \| last }} |
join:sep / implode |
Join array | {{ tags \| join:, }} |
split:sep / explode |
Split string | {{ csv \| split:, }} |
length / strlen |
String/array length | {{ name \| length }} |
substr:start:len |
Substring | {{ text \| substr:0:100 }} |
replace:old:new |
Replace string | {{ text \| replace:foo:bar }} |
money:symbol:decimals |
Currency format | {{ price \| money:$:2 }} |
bool / int / float / string |
Type casting | {{ value \| int }} |
abs / round:n / floor / ceil |
Math operations | {{ value \| round:2 }} |
Special Variable Prefixes
| Prefix | Description | Example |
|---|---|---|
config. |
Laravel config values | {{ config.app.name }} |
env. |
Environment variables | {{ env.API_TOKEN }} |
now |
Current timestamp | {{ now \| date:Y-m-d }} |
Scheduled Workflows
To process scheduled workflows, add this to your app/Console/Kernel.php:
Testing
License
The MIT License (MIT). Please see License File for more information.
All versions of laravel-workflow-conductor with dependencies
illuminate/contracts Version ^10.0|^11.0|^12.0
illuminate/database Version ^10.0|^11.0|^12.0
illuminate/events Version ^10.0|^11.0|^12.0
illuminate/queue Version ^10.0|^11.0|^12.0
illuminate/support Version ^10.0|^11.0|^12.0
guzzlehttp/guzzle Version ^7.0