n8n-workflow-sdk

Installation
SKILL.md
Contains Shell Commands

This skill contains shell command directives (!`command`) that may execute system commands. Review carefully before installing.

n8n Workflow SDK

Overview

@n8n/workflow-sdk is n8n's own TypeScript SDK (it lives in packages/@n8n/workflow-sdk of the n8n monorepo). You declare nodes with a few factory functions, wire them with .add() / .to(), and get standard n8n workflow JSON. It validates workflows, turns existing JSON into SDK code (generateWorkflowCode) and parses SDK code back into JSON (parseWorkflowCode). Checked against 0.39.5 (5 November 2026: the npm latest and stable tags; beta is 0.40.0 and rc 1.1.0). The package is pre-1.0 and changes weekly, so pin an exact version.

The API is generic: there are no per-node helpers such as httpRequest() or code() and no new WorkflowBuilder(). Every node is node({ type, version, config }), and the node's type and version come from n8n (copy them from an exported workflow or generateWorkflowCode).

Instructions

Install

npm install --save-exact @n8n/workflow-sdk@0.39.5

Building blocks

Installs
6
GitHub Stars
197
First Seen
May 17, 2026