# kayedspace/laravel-n8n architecture

> Architecture diagram of the GitHub repository kayedspace/laravel-n8n, generated by GitDiagram from its file tree, README and a sample of source files (last updated 2026-11-17). It is an AI-made overview: check details against the source.

- Interactive diagram: https://gitdiagram.com/kayedspace/laravel-n8n
- Repository: https://github.com/kayedspace/laravel-n8n

## Overview

Laravel N8N is a Laravel client for managing n8n resources and triggering workflow webhooks. A typical workflow starts in a Laravel application through the facade, which exposes API resource clients for operations against n8n; webhook calls can run synchronously or be queued. The package also offers a workflow-building DSL, incoming-webhook signature verification, health checks, and CLI commands. The shared request layer provides configuration, response handling, caching, logging, metrics, and events. Some capabilities are documented but their implementation files are absent from the supplied tree; those links are omitted or marked uncertain.

Main entry points: [`src/Client/N8nClient.php`](https://github.com/kayedspace/laravel-n8n/blob/main/src/Client/N8nClient.php) (Client factory), [`src/Facades/N8nClient.php`](https://github.com/kayedspace/laravel-n8n/blob/main/src/Facades/N8nClient.php) (Client facade), [`src/Client/Webhook/Webhooks.php`](https://github.com/kayedspace/laravel-n8n/blob/main/src/Client/Webhook/Webhooks.php) (Webhook client), [`src/Client/Api/Workflows.php`](https://github.com/kayedspace/laravel-n8n/blob/main/src/Client/Api/Workflows.php) (Workflows)

## Diagram (Mermaid)

```mermaid
flowchart TD

subgraph group_entry["Laravel entry points"]
  node_facade["Client facade<br/>[N8nClient.php]"]
  node_client["Client factory<br/>[N8nClient.php]"]
end

subgraph group_api["n8n API resources"]
  node_workflows["Workflows<br/>[Workflows.php]"]
  node_executions["Executions<br/>[Executions.php]"]
  node_projects["Projects<br/>[Projects.php]"]
  node_audit["Audit<br/>[Audit.php]"]
  node_sourcecontrol["Source control<br/>[SourceControl.php]"]
  node_tags["Tags<br/>[Tags.php]"]
  node_users["Users<br/>[Users.php]"]
  node_variables["Variables<br/>[Variables.php]"]
  node_credentials["Credentials"]
end

subgraph group_runtime["Request runtime"]
  node_api["API client base<br/>[AbstractApi.php]"]
  node_base["Request runtime<br/>[BaseClient.php]"]
  node_pagination["Pagination<br/>[HasPagination.php]"]
  node_events["Resource events<br/>[N8nEvent.php]"]
end

subgraph group_webhooks["Webhook handling"]
  node_webhooks["Webhook client<br/>[Webhooks.php]"]
  node_queuejob["Queued trigger job"]
  node_verify["Signature middleware"]
end

subgraph group_tools["Workflow tools"]
  node_builder["Workflow builder"]
  node_health["Health checks<br/>[HealthCheck.php]"]
  node_commands["CLI commands"]
end

node_app(("Laravel application"))
node_n8n{{"n8n instance"}}

node_app -->|"calls"| node_facade
node_facade -->|"resolves"| node_client
node_client -->|"creates"| node_workflows
node_client -->|"creates"| node_executions
node_client -->|"creates"| node_projects
node_client -->|"creates"| node_audit
node_client -->|"creates"| node_sourcecontrol
node_client -->|"creates"| node_tags
node_client -->|"creates"| node_users
node_client -->|"creates"| node_variables
node_client -->|"creates"| node_webhooks
node_facade -->|"exposes"| node_credentials
node_workflows -->|"requests through"| node_api
node_executions -->|"requests through"| node_api
node_projects -->|"requests through"| node_api
node_api -->|"executes via"| node_base
node_api -->|"sends API requests"| node_n8n
node_workflows -->|"dispatches events"| node_events
node_workflows -->|"uses"| node_pagination
node_executions -->|"uses"| node_pagination
node_app -->|"triggers"| node_webhooks
node_webhooks -->|"sends webhook"| node_n8n
node_webhooks -->|"queues"| node_queuejob
node_queuejob -->|"runs synchronously"| node_webhooks
node_n8n -->|"sends signed request"| node_verify
node_verify -->|"verifies signature"| node_webhooks
node_builder -->|"uses client"| node_facade
node_health -->|"checks instance"| node_facade
node_commands -->|"runs operations"| node_facade
node_n8n -.->|"workflow operations"| node_workflows

click node_facade "https://github.com/kayedspace/laravel-n8n/blob/main/src/Facades/N8nClient.php"
click node_client "https://github.com/kayedspace/laravel-n8n/blob/main/src/Client/N8nClient.php"
click node_api "https://github.com/kayedspace/laravel-n8n/blob/main/src/Client/Api/AbstractApi.php"
click node_base "https://github.com/kayedspace/laravel-n8n/blob/main/src/Client/BaseClient.php"
click node_pagination "https://github.com/kayedspace/laravel-n8n/blob/main/src/Concerns/HasPagination.php"
click node_events "https://github.com/kayedspace/laravel-n8n/blob/main/src/Events/N8nEvent.php"
click node_workflows "https://github.com/kayedspace/laravel-n8n/blob/main/src/Client/Api/Workflows.php"
click node_executions "https://github.com/kayedspace/laravel-n8n/blob/main/src/Client/Api/Executions.php"
click node_projects "https://github.com/kayedspace/laravel-n8n/blob/main/src/Client/Api/Projects.php"
click node_audit "https://github.com/kayedspace/laravel-n8n/blob/main/src/Client/Api/Audit.php"
click node_sourcecontrol "https://github.com/kayedspace/laravel-n8n/blob/main/src/Client/Api/SourceControl.php"
click node_tags "https://github.com/kayedspace/laravel-n8n/blob/main/src/Client/Api/Tags.php"
click node_users "https://github.com/kayedspace/laravel-n8n/blob/main/src/Client/Api/Users.php"
click node_variables "https://github.com/kayedspace/laravel-n8n/blob/main/src/Client/Api/Variables.php"
click node_webhooks "https://github.com/kayedspace/laravel-n8n/blob/main/src/Client/Webhook/Webhooks.php"
click node_queuejob "https://github.com/kayedspace/laravel-n8n/blob/main/src/Jobs/TriggerN8nWebhook.php"
click node_verify "https://github.com/kayedspace/laravel-n8n/blob/main/src/Http/Middleware/VerifyN8nWebhook.php"
click node_builder "https://github.com/kayedspace/laravel-n8n/blob/main/src/Support/WorkflowBuilder.php"
click node_health "https://github.com/kayedspace/laravel-n8n/blob/main/src/Support/HealthCheck.php"
click node_commands "https://github.com/kayedspace/laravel-n8n/tree/main/src/Console"

classDef toneNeutral fill:#f8fafc,stroke:#334155,stroke-width:1.5px,color:#0f172a
classDef toneBlue fill:#dbeafe,stroke:#2563eb,stroke-width:1.5px,color:#172554
classDef toneAmber fill:#fef3c7,stroke:#d97706,stroke-width:1.5px,color:#78350f
classDef toneMint fill:#dcfce7,stroke:#16a34a,stroke-width:1.5px,color:#14532d
classDef toneRose fill:#ffe4e6,stroke:#e11d48,stroke-width:1.5px,color:#881337
classDef toneIndigo fill:#e0e7ff,stroke:#4f46e5,stroke-width:1.5px,color:#312e81
classDef toneTeal fill:#ccfbf1,stroke:#0f766e,stroke-width:1.5px,color:#134e4a
class node_facade,node_client toneBlue
class node_workflows,node_executions,node_projects,node_audit,node_sourcecontrol,node_tags,node_users,node_variables,node_credentials toneAmber
class node_api,node_base,node_pagination,node_events toneMint
class node_webhooks,node_queuejob,node_verify toneRose
class node_builder,node_health,node_commands,node_app,node_n8n toneIndigo
```

## Components

### Laravel entry points

- [Client facade](https://github.com/kayedspace/laravel-n8n/blob/main/src/Facades/N8nClient.php): `src/Facades/N8nClient.php`
- [Client factory](https://github.com/kayedspace/laravel-n8n/blob/main/src/Client/N8nClient.php): `src/Client/N8nClient.php`

### n8n API resources

- [Workflows](https://github.com/kayedspace/laravel-n8n/blob/main/src/Client/Api/Workflows.php): `src/Client/Api/Workflows.php`
- [Executions](https://github.com/kayedspace/laravel-n8n/blob/main/src/Client/Api/Executions.php): `src/Client/Api/Executions.php`
- [Projects](https://github.com/kayedspace/laravel-n8n/blob/main/src/Client/Api/Projects.php): `src/Client/Api/Projects.php`
- [Audit](https://github.com/kayedspace/laravel-n8n/blob/main/src/Client/Api/Audit.php): `src/Client/Api/Audit.php`
- [Source control](https://github.com/kayedspace/laravel-n8n/blob/main/src/Client/Api/SourceControl.php): `src/Client/Api/SourceControl.php`
- [Tags](https://github.com/kayedspace/laravel-n8n/blob/main/src/Client/Api/Tags.php): `src/Client/Api/Tags.php`
- [Users](https://github.com/kayedspace/laravel-n8n/blob/main/src/Client/Api/Users.php): `src/Client/Api/Users.php`
- [Variables](https://github.com/kayedspace/laravel-n8n/blob/main/src/Client/Api/Variables.php): `src/Client/Api/Variables.php`
- **Credentials**

### Request runtime

- [API client base](https://github.com/kayedspace/laravel-n8n/blob/main/src/Client/Api/AbstractApi.php): `src/Client/Api/AbstractApi.php`
- [Request runtime](https://github.com/kayedspace/laravel-n8n/blob/main/src/Client/BaseClient.php): `src/Client/BaseClient.php`
- [Pagination](https://github.com/kayedspace/laravel-n8n/blob/main/src/Concerns/HasPagination.php): `src/Concerns/HasPagination.php`
- [Resource events](https://github.com/kayedspace/laravel-n8n/blob/main/src/Events/N8nEvent.php): `src/Events/N8nEvent.php`

### Webhook handling

- [Webhook client](https://github.com/kayedspace/laravel-n8n/blob/main/src/Client/Webhook/Webhooks.php): `src/Client/Webhook/Webhooks.php`
- [Queued trigger job](https://github.com/kayedspace/laravel-n8n/blob/main/src/Jobs/TriggerN8nWebhook.php): `src/Jobs/TriggerN8nWebhook.php`
- [Signature middleware](https://github.com/kayedspace/laravel-n8n/blob/main/src/Http/Middleware/VerifyN8nWebhook.php): `src/Http/Middleware/VerifyN8nWebhook.php`

### Workflow tools

- [Workflow builder](https://github.com/kayedspace/laravel-n8n/blob/main/src/Support/WorkflowBuilder.php): `src/Support/WorkflowBuilder.php`
- [Health checks](https://github.com/kayedspace/laravel-n8n/blob/main/src/Support/HealthCheck.php): `src/Support/HealthCheck.php`
- [CLI commands](https://github.com/kayedspace/laravel-n8n/tree/main/src/Console): `src/Console`

### Other components

- **Laravel application**
- **n8n instance**

## Connections

- Laravel application → Client facade: calls
- Client facade → Client factory: resolves (evidence: `src/Facades/N8nClient.php`)
- Client factory → Workflows: creates (evidence: `src/Client/N8nClient.php`)
- Client factory → Executions: creates (evidence: `src/Client/N8nClient.php`)
- Client factory → Projects: creates (evidence: `src/Client/N8nClient.php`)
- Client factory → Audit: creates (evidence: `src/Client/N8nClient.php`)
- Client factory → Source control: creates (evidence: `src/Client/N8nClient.php`)
- Client factory → Tags: creates (evidence: `src/Client/N8nClient.php`)
- Client factory → Users: creates (evidence: `src/Client/N8nClient.php`)
- Client factory → Variables: creates (evidence: `src/Client/N8nClient.php`)
- Client factory → Webhook client: creates (evidence: `src/Client/N8nClient.php`)
- Client facade → Credentials: exposes (evidence: `src/Facades/N8nClient.php`)
- Workflows → API client base: requests through (evidence: `src/Client/Api/Workflows.php`)
- Executions → API client base: requests through (evidence: `src/Client/Api/Executions.php`)
- Projects → API client base: requests through (evidence: `src/Client/Api/Projects.php`)
- API client base → Request runtime: executes via (evidence: `src/Client/Api/AbstractApi.php`)
- API client base → n8n instance: sends API requests (evidence: `src/Client/Api/AbstractApi.php`)
- Workflows → Resource events: dispatches events (evidence: `src/Client/Api/Workflows.php`)
- Workflows → Pagination: uses (evidence: `src/Client/Api/Workflows.php`)
- Executions → Pagination: uses (evidence: `src/Client/Api/Executions.php`)
- Laravel application → Webhook client: triggers
- Webhook client → n8n instance: sends webhook (evidence: `src/Client/Webhook/Webhooks.php`)
- Webhook client → Queued trigger job: queues (evidence: `src/Client/Webhook/Webhooks.php`)
- Queued trigger job → Webhook client: runs synchronously (evidence: `src/Jobs/TriggerN8nWebhook.php`)
- n8n instance → Signature middleware: sends signed request
- Signature middleware → Webhook client: verifies signature (evidence: `src/Http/Middleware/VerifyN8nWebhook.php`)
- Workflow builder → Client facade: uses client (evidence: `src/Support/WorkflowBuilder.php`)
- Health checks → Client facade: checks instance (evidence: `src/Support/HealthCheck.php`)
- CLI commands → Client facade: runs operations (evidence: `src/Console/HealthCheckCommand.php`)
- n8n instance → Workflows: workflow operations
