Small Runtime Surface
The client depends on PSR interfaces only. Choose the PSR-18 HTTP client and PSR-17 factories already used by your application.
Trigger n8n webhooks and track workflow executions with PSR-7, PSR-17, and PSR-18.

php-n8n/client is a lightweight PHP library for applications that need to trigger n8n workflows through webhooks and optionally track executions through the n8n API.
It is designed around standards rather than framework integrations. The runtime dependencies are PSR interfaces:
| Dependency | Purpose |
|---|---|
psr/http-client | Sends PSR-7 requests through a PSR-18 client. |
psr/http-factory | Creates PSR-7 requests and streams. |
psr/http-message | Represents requests, responses, streams, and URIs. |
You install concrete implementations yourself, for example Guzzle for PSR-18 and Nyholm PSR-7 for PSR-17/PSR-7.
composer require php-n8n/client guzzlehttp/guzzle nyholm/psr7<?php
declare(strict_types=1);
use GuzzleHttp\Client as GuzzleClient;
use Nyholm\Psr7\Factory\Psr17Factory;
use PhpN8n\Client\N8nClient;
use PhpN8n\Client\Webhooks\Webhook;
use PhpN8n\Client\Webhooks\WebhookRequest;
$psr17 = new Psr17Factory();
$client = new N8nClient(
httpClient: new GuzzleClient(),
requestFactory: $psr17,
streamFactory: $psr17,
);
$response = $client->webhooks()->trigger(
Webhook::fromUri($psr17->createUri('https://n8n.example.com/webhook/order-created')),
WebhookRequest::json([
'orderId' => 'ORD-1001',
'total' => 129.50,
]),
);
$body = $response->body();