Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
Webhooks
Laravel Workflow provides webhooks that allow external systems to start workflows and send signals dynamically. This feature enables seamless integration with external services, APIs, and automation tools.
Enabling Webhooks
To enable webhooks in Laravel Workflow, register the webhook routes in your application’s routes file (
routes/web.php
orroutes/api.php
):By default, webhooks will:
app/Workflows
folder.#[Webhook]
at the class level.#[Webhook]
.Starting a Workflow via Webhook
To expose a workflow as a webhook, add the
#[Webhook]
attribute on the class itself.Webhook URL
Example Request
Sending a Signal via Webhook
To allow external systems to send signals to a workflow, add the
#[Webhook]
attribute on the method.Webhook URL
Example Request
Webhook URL Helper
The
$this->webhookUrl()
helper generates webhook URLs for starting workflows or sending signals.Parameters
If empty, returns the URL for starting the workflow.
If provided, returns the URL for sending a signal to an active workflow instance.
Webhook Authentication
By default, webhooks don't require authentication but this can be configured in
config/workflows.php
.Authentication Methods
Laravel Workflow supports:
Token Authentication
For token authentication, webhooks require a valid API token in the request headers. The default header is
Authorization
but you can change this in the configuration settings.Example Request
HMAC Signature Authentication
For HMAC authentication, Laravel Workflow verifies requests using a secret key. The default header is
X-Signature
but this can also be changed.Example Request
Configuring Webhook Routes
By default, webhooks are accessible under
/webhooks
. You can customize the route path inconfig/workflows.php
: