Laravel package for integrating with n8n API using clean architecture patterns
mrkindy/n8n-laravel is a Laravel package for laravel package for integrating with n8n api using clean architecture patterns.
It currently has 4 GitHub stars and 6 downloads on Packagist (latest version v1.0.0).
Install it with composer require mrkindy/n8n-laravel.
Discover more Laravel packages by mrkindy
or browse all Laravel packages to compare alternatives.
Last updated
A comprehensive Laravel package for integrating with the n8n API using clean architecture patterns. This package provides a facade-based interface with support for multiple execution strategies, request builders, and event observability.
N8N::workflows())composer require mrkindy/n8n-laravel
php artisan vendor:publish --provider="MrKindy\N8NLaravel\N8NServiceProvider" --tag="n8n-config"
Add these variables to your .env file:
N8N_BASE_URL=http://localhost:5678
N8N_API_KEY=your-api-key-here
N8N_DEFAULT_STRATEGY=sync
N8N_HTTP_TIMEOUT=30
N8N_HTTP_RETRY_TIMES=3
N8N_HTTP_RETRY_SLEEP=1000
N8N_HTTP_VERIFY_SSL=true
N8N_EVENTS_ENABLED=true
N8N_LOGGING_ENABLED=true
N8N_LOGGING_LEVEL=info
N8N_LOGGING_CHANNEL=default
N8N_QUEUE_CONNECTION=default
N8N_QUEUE_NAME=n8n
For detailed usage instructions, please refer to DOCUMENTATION.md.
The package uses the Pest testing framework. Run tests with:
vendor/bin/pest
tests/
├── Pest.php # Pest configuration
├── TestCase.php # Base test case
├── Feature/
│ ├── FacadeTest.php # Facade functionality tests
│ ├── BuilderTest.php # Builder tests
│ ├── ObserverTest.php # Observer tests
│ └── StrategyTest.php # Strategy tests
└── Unit/
├── AdapterTest.php # Adapter unit tests
└── ServiceTest.php # Individual service tests
use MrKindy\N8NLaravel\Facades\N8N;
it('can create a workflow', function () {
Http::fake([
'localhost:5678/api/v1/workflows' => Http::response([
'id' => 'workflow-123',
'name' => 'Test Workflow'
])
]);
$result = N8N::workflows()->create([
'name' => 'Test Workflow',
'nodes' => []
]);
expect($result)->toHaveKey('id', 'workflow-123');
});
'http' => [
'timeout' => 30, // Request timeout in seconds
'retry' => [
'times' => 3, // Number of retry attempts
'sleep' => 1000, // Sleep between retries (ms)
],
'verify' => true, // SSL certificate verification
],
'queue' => [
'connection' => 'redis', // Queue connection
'queue' => 'n8n-operations', // Queue name
],
'logging' => [
'enabled' => true, // Enable request logging
'level' => 'info', // Log level
'channel' => 'n8n', // Log channel
],
This package provides full coverage of the n8n Public API v1.1.1:
vendor/bin/pestgit clone https://github.com/mrkindy/n8n-laravel.git
cd n8n-laravel
composer install
cp .env.example .env
# Configure your n8n instance details in .env
vendor/bin/pest
This package is open-sourced software licensed under the MIT license.
Please see CHANGELOG for more information on what has changed recently.
Built with ❤️ for the Laravel and n8n communities.