CtrlK
BlogDocsLog inGet started
Tessl Logo

n8n:conventions

Quick reference for n8n patterns. Full docs /AGENTS.md

Invalid
This skill can't be scored yet
Validation errors are blocking scoring. Review and fix them to unlock Quality, Impact and Security scores. See what needs fixing →
SKILL.md
Quality
Evals
Security

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

Secrets: pnpm command lines may be recorded verbatim (opt-in dev metrics) — pass sensitive values via env vars, never inline on the command line.

Key Packages

PackagePurpose
packages/cliBackend API
packages/frontend/editor-uiVue 3 frontend
packages/@n8n/api-typesShared types
packages/@n8n/dbTypeORM entities
packages/workflowCore 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

Repository
n8n-io/n8n
Last updated
First committed

Is this your skill?

If you maintain this skill, you can claim it as your own. Once claimed, you can manage eval scenarios, bundle related skills, attach documentation or rules, and ensure cross-agent compatibility.