n8n API Tutorial
n8n has its own REST API that allows programmatic management of workflows, executions, credentials, and instances. For technical teams running n8n at scale — managing workflows across environments, building internal tools on top of n8n, or integrating n8n into DevOps pipelines — the n8n API is essential. This guide covers the n8n API's key endpoints and common use cases.
What the n8n API Enables
The n8n API provides programmatic access to your n8n instance:
- List, create, update, delete workflows — manage your automation portfolio via code
- Execute workflows — trigger workflow runs programmatically
- Get execution history — retrieve logs and results from past executions
- Manage credentials — create and update integration credentials
- Manage tags and annotations — organise workflows systematically
Common use cases: deploying workflows to production as part of a CI/CD pipeline, building internal dashboards that show automation performance, programmatically triggering workflows from custom applications, and bulk operations on large workflow portfolios.
Authentication
The n8n API uses API key authentication. Create an API key in n8n's settings: Settings → API → Create API key.
Include the key in all requests:
For self-hosted instances, the API base URL is your n8n URL + /api/v1. For n8n cloud, use the cloud instance URL.
Key Endpoints
List all workflows:
Returns all workflows with their metadata (not full definition). Add ?active=true to filter active workflows only.
Get a specific workflow:
Returns the full workflow definition as JSON — the same format as a workflow export.
Create a workflow:
Accepts the workflow definition JSON. Used to deploy workflows programmatically.
Activate/deactivate a workflow:
Execute a workflow:
Starts a workflow execution. The optional data object is available in the workflow as input.
Get execution history:
Returns execution records. Filter by workflow ID, status (success/error), or date range.
Programmatic Workflow Deployment
For teams managing n8n workflows as code, a deployment pipeline:
This pattern allows version-controlling n8n workflows in git and deploying them through your standard CI/CD process.
Monitoring Dashboard with the API
Build an execution monitoring dashboard using the n8n API:
Run this script daily (via n8n itself or a cron job) to generate performance reports.
Triggering Workflows via API
The Webhook trigger provides one way to trigger workflows externally. The Execute endpoint provides another — useful for internal applications.
From a web application (Node.js example):
Recommended Tools
- n8n — The platform with API access
- Postman — Test n8n API calls during development
- GitHub Actions — CI/CD for workflow deployment
- Airtable — Dashboard for monitoring data
“The n8n API turns n8n from a visual tool into an automation platform that developers can manage programmatically. For teams running n8n in production, the API is essential.”
Related articles
n8n vs Make.com vs Zapier: a 2026 honest comparison
No affiliate fluff — where each tool wins, where it breaks, and what we actually run.
Self-hosting n8n: a production-grade setup guide
Queue mode, workers, backups, and the security defaults you should never skip.
Complete n8n Guide: Everything You Need to Build Powerful Automations
The definitive n8n guide — nodes, credentials, triggers, and production-grade patterns.