Workflows Setup
Add powerful drag & drop automation workflows to your Laravel Mail platform. Create automated email sequences triggered by events like user registration, purchase completion, or custom actions.
Installation
1. Install via Composer
2. Register Routes
Add the following to your web.php routes file. Make sure to secure these routes with your authentication middleware:
3. Publish Assets
Optional: You can also publish config, language files, and views using the respective tags: --tag=config, --tag=lang, --tag=views
How Workflows Work
A workflow consists of Triggers and Tasks. The trigger starts the workflow, and tasks are individual nodes that execute code in sequence. Information is passed between tasks using the DataBus system.
Triggers
Starting points that initiate workflows based on events
Tasks
Individual code execution nodes that perform actions
DataBus
System for passing data between workflow components
Available Triggers
Observer Trigger
Listens to Eloquent Model events (created, updated, deleted) and automatically starts workflows when these events occur.
Setup: Add the trait to your Eloquent models:
use WorkflowObservable; Use case: Send welcome emails when users register, or notify admins when orders are placed.
Button Trigger
Renders clickable buttons in your frontend that execute workflows when clicked. Perfect for manual actions.
Render by Name:
Render by Workflow ID:
Render by Category:
Use case: "Send Invoice" buttons on order pages, or "Archive User" buttons in admin panels.
Email-Related Tasks
Key tasks for building email automation workflows:
SendMail
Send emails with dynamic content and attachments. Works perfectly with HtmlInput and DomPDF tasks.
Core Email TaskHtmlInput
Rich text editor with Blade template support. Create email templates with dynamic placeholders.
Template BuilderDomPDF
Generate PDF attachments from HTML content. Perfect for invoices, receipts, and reports.
PDF GenerationLoadModel
Load additional data from your database to use in email templates and conditions.
Data LoadingGetting Started
Ready to build workflows? After installation, visit /workflows in your Laravel application to access the drag & drop workflow builder.
Example: Welcome Email Workflow
- Set up an Observer Trigger on your User model for the "created" event
- Add an HtmlInput Task to create a welcome email template with user placeholders
- Add a SendMail Task to send the welcome email
- Connect the tasks in the visual workflow builder
- Save and activate your workflow
Now every new user registration will automatically trigger a personalized welcome email!