Fully Typed
Every handle, request payload, and response is typed. Filters autocomplete, return types stay explicit, and refactors fail fast instead of drifting quietly.
Reach the n8n Public API through typed resource handles instead of handwritten HTTP calls. Build admin tooling, background jobs, CI integrations, and automation services with a client that stays close to the spec and out of your way.
import N8nClient from '@egose/n8n-client';
const client = new N8nClient({
baseUrl: 'http://localhost:5678',
apiKey: process.env.N8N_API_KEY,
});
// List active workflows
const { data } = await client.workflow().list({
active: true,
limit: 10,
});
// Get a workflow and inspect its nodes
const wf = await client.workflow().get('wf-123');
console.log(wf.nodes.length, 'nodes');
// Create a credential
await client.credential().create({
name: 'Slack Bot Token',
type: 'slackApi',
data: { accessToken: 'xoxb-...' },
});
// Find error executions
const { data: errors } = await client.execution().list({
status: 'error',
workflowId: 'wf-123',
});
// Stop a stuck execution
await client.execution().stop(errors[0].id);Why teams use it
Every handle, request payload, and response is typed. Filters autocomplete, return types stay explicit, and refactors fail fast instead of drifting quietly.
Rate limits, timeouts, and 5xx responses retry with exponential backoff. Good defaults are built in, so scripts do not need their own resilience wrapper.
Built on Node.js 20+ native fetch. No axios, no node-fetch, and no runtime dependency pile to audit before shipping automation code.
Full API coverage
Workflows, executions, credentials, tags, variables, projects, folders, users, data tables, audit, insights, source control, community packages, discovery, and n8n packages — all covered.
Practical flow
The docs are organized the same way the client is organized: start with the root client, move into resource handles, then use examples when you want complete flows instead of isolated methods.
Point the client at your n8n base URL and authenticate with an API key or Bearer token.
Use resource-scoped handles like workflow, execution, credential, or project instead of hand-writing endpoint paths.
Lean on typed inputs, explicit outputs, and automatic retries for the parts of the API that fail transiently.
Install the package, authenticate with an API key, and make your first API call in under a minute.
Browse all 15 resource handles — from workflows and executions to data tables and community packages.
End-to-end walkthroughs covering workflows, credentials, projects, and common automation patterns.
Typed automation
Install the package, authenticate, and call any n8n endpoint with full type safety. Drop down to the HTTP client when you need to — the typed surface stays out of your way.