n8n-conventions

πŸ“š Full Documentation:

Safety Notice

This listing is imported from skills.sh public index metadata. Review upstream SKILL.md and repository scripts before running.

Copy this and send it to your AI assistant to learn

Install skill "n8n-conventions" with this command: npx skills add n8n-io/n8n/n8n-io-n8n-n8n-conventions

n8n Quick Reference

πŸ“š Full Documentation:

  • General: /AGENTS.md

  • Architecture, commands, workflows

  • Frontend: /packages/frontend/AGENTS.md

  • CSS variables, timing

Use this skill when you need quick reminders on critical patterns.

Critical Rules (Must Follow)

TypeScript:

  • Never any β†’ use unknown

  • Prefer satisfies over as (except tests)

  • Shared types in @n8n/api-types

Error Handling:

import { UnexpectedError } from 'n8n-workflow'; throw new UnexpectedError('message', { extra: { context } }); // DON'T use deprecated ApplicationError

Frontend:

  • Vue 3 Composition API (<script setup lang="ts"> )

  • CSS variables (never hardcode px) - see /packages/frontend/AGENTS.md

  • All text via i18n ($t('key') )

  • data-testid for E2E (single value, no spaces)

Backend:

  • Controller β†’ Service β†’ Repository

  • Dependency injection via @n8n/di

  • Config via @n8n/config

  • Zod schemas for validation

Testing:

  • Vitest (unit), Playwright (E2E)

  • Mock external dependencies

  • Work from package directory: pushd packages/cli && pnpm test

Database:

  • SQLite/PostgreSQL only (app DB)

  • Exception: DB nodes (MySQL Node, etc.) can use DB-specific features

Commands:

pnpm build > build.log 2>&1 # Always redirect pnpm typecheck # Before commit pnpm lint # Before commit

Key Packages

Package Purpose

packages/cli

Backend API

packages/frontend/editor-ui

Vue 3 frontend

packages/@n8n/api-types

Shared types

packages/@n8n/db

TypeORM entities

packages/workflow

Core interfaces

Common Patterns

Pinia Store:

import { STORES } from '@n8n/stores'; export const useMyStore = defineStore(STORES.MY_STORE, () => { const state = shallowRef([]); return { state }; });

Vue Component:

<script setup lang="ts"> type Props = { title: string }; const props = defineProps<Props>(); </script>

Service:

import { Service } from '@n8n/di'; import { Config } from '@n8n/config';

@Service() export class MyService { constructor(private readonly config: Config) {} }

πŸ“– Need more details? Read /AGENTS.md and /packages/frontend/AGENTS.md

Source Transparency

This detail page is rendered from real SKILL.md content. Trust labels are metadata-based hints, not a safety guarantee.

Related Skills

Related by shared tags or category signals.

General

create-pr

No summary provided by upstream source.

Repository SourceNeeds Review
595-n8n-io
General

content-design

No summary provided by upstream source.

Repository SourceNeeds Review
207-n8n-io
General

linear-issue

No summary provided by upstream source.

Repository SourceNeeds Review
General

reproduce-bug

No summary provided by upstream source.

Repository SourceNeeds Review