Triggers
A trigger is what starts a workflow. When an execution is requested, the engine fires the trigger against the incoming payload; the trigger returns either "proceed" (optionally with an output) or "ignore" (no execution is created).
Four triggers are built in. Reference them by class constant
(ManualTrigger::type()) in code.
| Trigger | Type string | Starts a workflow when… |
|---|---|---|
| Manual | @wf::trigger.manual | Your code calls Workflow::run() / dispatch(), or workflow:run. |
| Webhook | @wf::trigger.webhook | A POST arrives at the workflow's generated URL. |
| Schedule | @wf::trigger.schedule | A cron expression matches. |
| Model event | @wf::trigger.model | An Eloquent model fires a lifecycle event. |
In every case the payload becomes {{ trigger.* }} in the node graph.
Manual
The default. No wiring — you start it explicitly.
Workflow::run('send-welcome-email', ['email' => 'ada@example.com']);
Config
| Field | Type | Notes |
|---|---|---|
payload | builder | The shape of the payload this workflow expects. The interactive builder lets you design it; workflow:run then prompts for real values against that shape. Optional. |
Webhook
Registers a POST route per workflow at boot, under the webhooks/ prefix, at
an unguessable generated path. The request body becomes the trigger payload.
The response is JSON: { "execution_id": "...", "status": "..." }.
Config
| Field | Type | Notes |
|---|---|---|
path | text (read-only) | Auto-generated, unguessable. Set for you on save. |
secret | text (sensitive) | Optional shared secret. When set, the caller must send it in the X-Webhook-Secret header or the request is rejected with 401. Stored encrypted. |
Setup notes
- The route middleware group is
webhook_middlewarein config (default['api']). - A newly saved webhook workflow only registers its route on the next app boot — restart your app and workers.
- Runs the workflow synchronously by default (the HTTP request waits for it).
Schedule
Registers an entry on Laravel's scheduler at boot. Requires Laravel's scheduler
to be running (schedule:work or a system cron calling schedule:run).
Payload on each fire: { "scheduled_at": "<ISO 8601>", "cron": "<expression>" }.
Config
| Field | Type | Notes |
|---|---|---|
cron | text | Required. A standard 5-field cron expression, e.g. */5 * * * *. |
timezone | text | Optional. Defaults to config('app.timezone'). |
Runs synchronously in the scheduler process. Restart after saving.
Model event
Listens for Eloquent lifecycle events on a model class and starts the workflow
when one fires. The payload is the model's attributes plus an event key
({{ trigger.event }}, {{ trigger.id }}, …).
Config
| Field | Type | Notes |
|---|---|---|
model | text | Required. Fully-qualified Eloquent model class. |
events | checkbox | Which events to listen for: created, updated, deleted, restored, forceDeleted. |
call_mode | select | async (default) queues the workflow so the model save isn't held up; sync runs it inline in the same process as the event. |
Listeners are attached at boot — restart your app and workers after saving, and
note that sync mode runs your whole workflow inside the database transaction /
request that saved the model.