Event Trigger
Type key: trigger
Group: Triggers
Category: trigger
Tier: CORE
The Event Trigger node starts a workflow when a Laravel event is dispatched anywhere in your application. It enables event-driven automation without coupling application code to workflow code.
Handles
| Handle | Direction | Description |
|---|---|---|
| (none) | Input | Trigger nodes have no input |
output |
Output | Passes the event payload to the first downstream node |
Configuration
| Field | Type | Default | Description |
|---|---|---|---|
label |
string | Event Trigger |
Display label on the canvas |
eventClass |
string | null |
The event to listen for (see sources below) |
Event Sources
There are two types of events that can be selected in eventClass:
1. Eloquent Events (from Model Integrations)
By default, your Eloquent models do not expose CRUD events to Voodflow. To make them available in the Event Trigger you need to create a Model Integration:
- Go to Voodflow → Model Integrations in the sidebar
- Click Create and select your model class (e.g.
App\Models\Order) - In the Eloquent Events section, tick the events you want to listen to:
created,updated,deleted - Configure which fields and relations should be included in the event payload
- Save the integration
Once saved, the enabled events immediately appear in the Event Trigger selector dropdown. The internal format is:
eloquent.created: App\Models\Order
eloquent.updated: App\Models\User
eloquent.deleted: App\Models\Product
The payload is the Eloquent model serialized via ->toArray(), filtered to the fields and relations you configured in the Model Integration.
::: info No code required Model Integrations are configured entirely from the UI — no service providers, no event classes, no observers. Just select the model, tick the events, and they are ready to use in any workflow. :::
2. Custom Laravel Events
Any Laravel event class can be used if it is registered by your application (or a plugin) via:
// In a service provider's boot() method
use Voodflow\Voodflow\Voodflow;
Voodflow::registerEvent(
eventClass: \App\Events\OrderCreated::class,
name: 'Order Created',
description: 'Fired when a new order is placed',
group: 'Orders',
);
The event class must have its payload as public properties. They are serialized automatically and injected as $context->input.
::: tip Custom Events Registration
Custom events are registered via code (or plugin bootstrapping) using Voodflow::registerEvent(). After registration, they automatically appear in the Event Trigger selector.
:::
How It Works
- You configure the
eventClassfield with a registered event - When your application dispatches that event, Voodflow's global listener intercepts it
- The event payload is serialized and injected as
$context->inputfor the first downstream node - A workflow execution is queued (or runs synchronously, depending on
VOODFLOW_EXECUTE_SYNC)
Payload Example
Given a custom event:
class OrderCreated
{
public function __construct(
public Order $order,
public User $customer
) {}
}
The execution context input will be:
{
"order": {
"id": 42,
"total": 199.99,
"status": "pending"
},
"customer": {
"id": 7,
"name": "Alice",
"email": "alice@example.com"
}
}
Eloquent model instances are automatically converted via ->toArray().
Validation
| Condition | Behavior |
|---|---|
eventClass is empty |
Validation error: Event Class is required |
Workflow is draft |
Trigger will not fire — must be set to active |
Notes
- One workflow listens to one event class. To react to the same event with multiple workflows, create multiple workflows each with an Event Trigger pointing to the same class.
- Events are discovered at boot time from: the
voodflow.registered_eventsconfig array, events registered viaVoodflow::registerEvent(), and trigger nodes of active workflows. - Companion plugin nodes are included when they store
eventClassin config, even if their nodetypeis not the coretrigger. - If
VOODFLOW_EXECUTE_SYNC=false, the event is handled asynchronously by a queue worker.