What problem does it solve?
Building or modifying n8n's Public API v1 endpoints requires strict adherence to architectural rules, decorator patterns, and OpenAPI generation conventions. Without guidance, developers risk breaking public contracts, leaking secrets, or violating ESLint guardrails.
Core Features & Use Cases
- Controller Creation: Scaffold new
@PublicApiController classes with proper decorators for API-key scopes, RBAC, pagination, and OpenAPI metadata.
- Legacy Migration: Migrate endpoints from the legacy
express-openapi-validator (EOV) handler system to the modern decorator-based controller architecture.
- DTO and Pagination: Build strict input DTOs, allowlist output DTOs, and implement cursor-based pagination for list endpoints.
- Use Case: Expose a new internal service (e.g., data tables) through
/api/v1 by creating a public controller, defining DTOs in @n8n/api-types, registering the route, and regenerating the OpenAPI spec.
Quick Start
Add a new public API endpoint for the workflows resource by creating a controller class with the @PublicApiController decorator and registering it in the controllers index.