Skip to main content
TypeScript client for the n8n Public API

The n8n API, typed and ready to automate.

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.

Workflows, executions, credentialsProjects, folders, users15 resource handles, fully typed
15 resource handles covering the full n8n API surface
Cursor-based pagination on every list endpoint
API key or Bearer token auth — never both
example.ts
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

Why this client exists.

01

Fully Typed

Every handle, request payload, and response is typed. Filters autocomplete, return types stay explicit, and refactors fail fast instead of drifting quietly.

02

Automatic Retry

Rate limits, timeouts, and 5xx responses retry with exponential backoff. Good defaults are built in, so scripts do not need their own resilience wrapper.

03

Zero Dependencies

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

Every n8n API v1 resource, typed.

Workflows, executions, credentials, tags, variables, projects, folders, users, data tables, audit, insights, source control, community packages, discovery, and n8n packages — all covered.

Automation

  • workflows
  • executions
  • credentials
  • tags
  • variables

Organization

  • projects
  • folders
  • users
  • data tables

Operations

  • audit
  • insights
  • source control
  • community packages

System

  • discover
  • n8n packages
  • import / export

Practical flow

Get productive without memorizing endpoints.

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.

01

Create the client

Point the client at your n8n base URL and authenticate with an API key or Bearer token.

02

Pick a handle

Use resource-scoped handles like workflow, execution, credential, or project instead of hand-writing endpoint paths.

03

Ship scripts safely

Lean on typed inputs, explicit outputs, and automatic retries for the parts of the API that fail transiently.

Typed automation

Start building with the n8n API today.

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.