n8n-local: n8n server with feature-based architecture for local use
npm install @easynet/n8n-localn8n-local is an n8n server that can be easily integrated into your applications. It provides APIs without authentication, no initial user setup required, and automatic bidirectional synchronization of workflows and credentials with a local data folder.
> ⚠️ IMPORTANT: Personal Use Only
>
> This tool is ONLY for personal use on your own machine.
>
> Intended Use:
> - ✅ Personal development and testing
> - ✅ Local automation on your own computer
> - ✅ Learning and experimentation
>
> Not Intended For:
> - ❌ Distribution to others
> - ❌ Commercial use
> - ❌ Any use beyond personal/local use on your own machine
- Features
- Installation
- Quick Start
- Configuration
- Data Sync
- REST API Endpoints
- 🚀 No Initial User Setup - Ready to use out of the box, no user registration or setup required
- 🔓 APIs Without Authentication - All REST API endpoints work without authentication tokens (auto-login enabled by default)
- 🔁 Auto Sync - Automatic bidirectional synchronization of workflows and credentials between n8n and local data folder with file watching
``bash`
npm install "@easynet/n8n-local"
`bash`
n8n-local
The server will be available at http://127.0.0.1:9991. All APIs work without authentication - no setup required!
Configuration is done via environment variables in the .env file. Key settings:
| Variable | Description | Default |
|----------|-------------|---------|
| N8N_PORT | Server port | 9991 |N8N_AUTO_LOGIN
| | Enable auto-login (APIs without auth) | true |N8N_DISABLE_USER_MANAGEMENT
| | Disable user management (no setup required) | true |
Workflows and credentials are automatically synced to the data/ folder in the current directory. The sync is bidirectional:
- Changes in n8n → automatically saved to local files
- Changes to local files → automatically synced back to n8n
- File watching enables immediate sync when files are modified
n8n-local automatically synchronizes your workflows and credentials between n8n and a local data/ folder. This allows you to:
- Version control your workflows and credentials using Git
- Edit workflows directly in JSON files using your favorite editor
- Backup your workflows and credentials as files
- Share workflows by copying JSON files
The sync happens automatically in both directions:
- When you create or modify a workflow in n8n, it's saved to data/workflows/{workflowId}.jsondata/credentials/{credentialId}.json
- When you create or modify a workflow file, it's imported into n8n
- The same applies to credentials in
By default, the data/ folder is created in your current working directory. You can specify a custom location using the dataFolder option when initializing n8n-local.
All REST API endpoints work without authentication - no tokens or credentials required. Auto-login is enabled by default, so all requests are automatically authenticated.
All endpoints are available at http://127.0.0.1:9991 (or your configured N8N_PORT).
n8n-local provides two types of endpoints:
1. Standard n8n Endpoints (/rest/*) - These are n8n's native API endpoints that work out of the box:GET /rest/workflows
- - List workflowsGET /rest/workflows/:id
- - Get workflowPOST /rest/workflows
- - Create workflowPUT /rest/workflows/:id
- - Update workflowGET /rest/executions
- - List executionsGET /rest/executions/:id
- - Get execution
- And other standard n8n endpoints
2. n8n-local Custom Endpoints (/rest/n8n-local/*) - These are custom endpoints provided by n8n-local with enhanced functionality:DELETE /rest/n8n-local/workflows/:id
- - Delete workflow (auto-archives before deletion)POST /rest/n8n-local/workflows/:id/activate
- - Activate workflowPOST /rest/n8n-local/workflows/:id/deactivate
- - Deactivate workflowPOST /rest/n8n-local/workflows/:id/execute
- - Execute workflow (unified endpoint, auto-detects trigger type)GET /rest/n8n-local/workflows/:id/executions
- - List workflow executionsDELETE /rest/n8n-local/executions/:id
- - Delete executionPOST /rest/n8n-local/chat/workflow/:workflowId
- - Chat Trigger workflows (legacy, redirects to unified endpoint)GET /rest/n8n-local/chat/session/:sessionId
- - Get chat session historyDELETE /rest/n8n-local/chat/session/:sessionId
- - Clear chat sessionGET /rest/n8n-local/chat/execution/:executionId
- - Get execution details
- And other custom endpoints
Note: The /rest/n8n-local/ prefix is used to avoid conflicts with future n8n API versions and clearly identifies custom n8n-local functionality.
GET /rest/workflows - List all workflows
Description: Retrieve a list of all workflows.
Query Parameters:
- active (optional): Filter by active status (true or false)tags
- (optional): Filter by tags (comma-separated list)
Request Body: None
Response:
`json`
{
"data": [
{
"id": "string",
"name": "string",
"active": true,
"nodes": [...],
"connections": {...},
"createdAt": "ISO date string",
"updatedAt": "ISO date string",
"tags": [...]
}
]
}
GET /rest/workflows/:id - Get a specific workflow by ID
Description: Retrieve a specific workflow by its ID.
Query Parameters: None
Request Body: None
Response:
`json`
{
"data": {
"id": "string",
"name": "string",
"active": true,
"nodes": [...],
"connections": {...},
"createdAt": "ISO date string",
"updatedAt": "ISO date string",
"tags": [...]
}
}
POST /rest/workflows - Create a new workflow
Description: Create a new workflow.
Query Parameters: None
Request Body:
`json`
{
"name": "string (required)",
"nodes": [...],
"connections": {...},
"active": true,
"tags": [...]
}
Response:
`json`
{
"data": {
"id": "string",
"name": "string",
"active": true,
"nodes": [...],
"connections": {...},
"createdAt": "ISO date string",
"updatedAt": "ISO date string",
"tags": [...]
}
}
PUT /rest/workflows/:id - Update an existing workflow
Description: Update an existing workflow by its ID.
Query Parameters: None
Request Body:
`json`
{
"name": "string",
"nodes": [...],
"connections": {...},
"active": true,
"tags": [...]
}
All fields are optional
Response:
`json`
{
"data": {
"id": "string",
"name": "string",
"active": true,
"nodes": [...],
"connections": {...},
"createdAt": "ISO date string",
"updatedAt": "ISO date string",
"tags": [...]
}
}
DELETE /rest/n8n-local/workflows/:id - Delete a workflow
Description: Delete a workflow by its ID.
Query Parameters: None
Request Body: None
Response:
`json`
{
"data": {
"id": "string"
}
}
POST /rest/n8n-local/workflows/:id/activate - Activate a workflow
Description: Activate a workflow by its ID.
Query Parameters: None
Request Body: None
Response:
`json`
{
"data": {
"id": "string",
"active": true
}
}
POST /rest/n8n-local/workflows/:id/deactivate - Deactivate a workflow
Description: Deactivate a workflow by its ID.
Query Parameters: None
Request Body: None
Response:
`json`
{
"data": {
"id": "string",
"active": false
}
}
POST /rest/n8n-local/workflows/:id/execute - Execute a workflow (unified endpoint)
Description: Execute a workflow by its ID. This unified endpoint automatically detects the trigger type and routes to the appropriate implementation. Supports:
- Chat Triggers (@n8n/n8n-nodes-langchain.chatTrigger) - Send messages to chat workflowsn8n-nodes-base.start
- Manual Triggers ( or n8n-nodes-base.manualTrigger) - Execute with optional input datan8n-nodes-base.formTrigger
- Form Triggers () - Submit form data
- Other trigger types - Executes the workflow with its default trigger behavior
Note: The server automatically detects the trigger type - you don't need to specify it. The endpoint routes to the appropriate handler internally.
Query Parameters: None
Request Body for Chat Triggers:
`json`
{
"messages": ["Hello", "How are you?"],
"sessionId": "optional-session-id",
"lastExecutionId": "optional-execution-id",
"isNewWorkflow": false,
"chatHistory": []
}`
For chat workflows, you can also use:json`
{
"message": "Hello" // Single message (will be converted to array)
}
Request Body for Manual/Form Triggers:
`json`
{
"data": {
"field1": "value1",
"field2": "value2"
}
}
Optional: Input data for the workflow execution
- For Manual Triggers: Data will be passed to the Start/Manual Trigger node
- For Form Triggers: Data should match the form fields (form submission data)
- For Other triggers: Data may be ignored depending on trigger type
Response:
`json`
{
"status": "success",
"data": {
"executionId": "string",
"finished": true,
"data": {...}
}
}
Response for Chat Triggers:
`json`
{
"status": "success",
"data": {
"sessionId": "string",
"response": "string",
"executionId": "string",
"transcript": [...],
"messageCount": number,
"lastExecutionId": "string",
"executionDetails": {...}
}
}
GET /rest/executions - List all workflow executions
Description: Retrieve a list of all workflow executions.
Query Parameters:
- workflowId (optional): Filter by workflow IDstatus
- (optional): Filter by status (success, error, waiting, running)finished
- (optional): Filter by finished status (true or false)limit
- (optional): Limit results (default: 20)cursor
- (optional): Pagination cursor
Request Body: None
Response:
`json`
{
"data": [
{
"id": "string",
"finished": true,
"mode": "string",
"retryOf": "string | null",
"retrySuccessId": "string | null",
"startedAt": "ISO date string",
"stoppedAt": "ISO date string | null",
"workflowId": "string",
"workflowData": {...},
"status": "string"
}
],
"nextCursor": "string | null"
}
GET /rest/executions/:id - Get a specific execution by ID
Description: Retrieve a specific execution by its ID.
Query Parameters: None
Request Body: None
Response:
`json`
{
"data": {
"id": "string",
"finished": true,
"mode": "string",
"retryOf": "string | null",
"retrySuccessId": "string | null",
"startedAt": "ISO date string",
"stoppedAt": "ISO date string | null",
"workflowId": "string",
"workflowData": {...},
"data": {...},
"status": "string"
}
}
DELETE /rest/n8n-local/executions/:id - Delete an execution
Description: Delete an execution by its ID.
Query Parameters: None
Request Body: None
Response:
`json`
{
"data": {
"id": "string"
}
}
GET /rest/n8n-local/workflows/:id/executions - List executions for a specific workflow
Description: Retrieve all executions for a specific workflow.
Query Parameters: Same as /rest/executions
Request Body: None
Response: Same format as /rest/executions
GET /rest/workflows/:id/executions/last-successful - Get the last successful execution for a workflow
Description: Retrieve the last successful execution for a specific workflow.
Query Parameters: None
Request Body: None
Response:
`json`
{
"data": {
"id": "string",
"finished": true,
"status": "success",
"mode": "string",
"startedAt": "ISO date string",
"stoppedAt": "ISO date string",
"workflowId": "string",
"workflowData": {...},
"data": {...}
}
}
POST /rest/n8n-local/chat/workflow/:workflowId - Execute a Chat Trigger workflow
Description: Legacy endpoint for executing Chat Trigger workflows. This endpoint is kept for backward compatibility but internally redirects to the unified POST /rest/n8n-local/workflows/:id/execute endpoint.
Note: For new integrations, use the unified endpoint POST /rest/n8n-local/workflows/:id/execute which automatically detects trigger types. This legacy endpoint will continue to work but may be deprecated in future versions.
Query Parameters: None
Request Body:
`json`
{
"sessionId": "string (optional, auto-generated if not provided)",
"messages": ["string"] or "message": "string (required)",
"lastExecutionId": "string (optional)",
"isNewWorkflow": boolean (optional),
"chatHistory": [
{
"sender": "user" | "bot",
"message": "string",
"timestamp": "ISO date string"
}
] (optional)
}
Response:
`json`
{
"status": "success",
"data": {
"sessionId": "string",
"response": "string",
"executionId": "string",
"transcript": [...],
"messageCount": number,
"lastExecutionId": "string",
"executionDetails": {...}
}
}
Note: For regular (non-Chat Trigger) workflows, use POST /rest/n8n-local/workflows/:id/execute instead.
GET /rest/n8n-local/chat/session/:sessionId - Get chat session history
Description: Retrieve the chat history for a specific session.
Query Parameters: None
Request Body: None
Response:
`json`
{
"status": "success",
"data": {
"sessionId": "string",
"transcript": [
{
"sender": "user" | "bot",
"message": "string",
"timestamp": "ISO date string"
}
]
}
}
Error Response (404):
`json`
{
"status": "error",
"message": "Session not found"
}
DELETE /rest/n8n-local/chat/session/:sessionId - Clear a chat session
Description: Clear all messages from a chat session.
Query Parameters: None
Request Body: None
Response:
`json`
{
"status": "success",
"message": "Session cleared successfully"
}
GET /rest/n8n-local/chat/execution/:executionId - Get execution details
Description: Retrieve detailed execution information for a chat workflow execution.
Query Parameters: None
Request Body: None
Response:
`json`
{
"status": "success",
"data": {
"executionId": "string",
"status": "success" | "error" | "waiting" | "running",
"finished": true,
"startedAt": "ISO date string",
"stoppedAt": "ISO date string",
"duration": 1234,
"nodeExecutions": [
{
"nodeName": "string",
"nodeType": "string",
"status": "success" | "error" | "running",
"executionTime": 123,
"error": "string"
}
],
"error": "string"
}
}
Error Response (404):
`json``
{
"status": "error",
"message": "Execution not found"
}
Important: This setup is intended for personal/local use only. Do not expose these endpoints to the internet without proper security measures.
For issues and questions, please open an issue on GitHub.
- n8n - Workflow automation tool