Library / Code, Git & Developer Tools
Code, Git & Developer Tools
Shut down nightly active workflows with the n8n API and data tables
On a schedule, it automates developer work using Data Table.
What it does
## 🌙 Maintenance ON — Nightly Workflow Shutdown Deactivates every currently active workflow on this n8n instance on a schedule, then logs what it turned off so a companion "Maintenance OFF" workflow can bring everything back the next morning. ### What it does 1. Fires on a schedule (default 22:30) 2. Fetches all active workflows via the n8n API 3. Skips itself and any workflow you list as excluded 4. Deactivates each remaining workflow 5. Logs workflow_id, workflow_name and deactivated_at to a Data Table, so "Maintenance OFF" knows exactly what to turn back on ### You need - An n8n API key (Settings → n8n API), added as credentials on both HTTP Request nodes - A Data Table with columns workflow_id (string), workflow_name (string), deactivated_at (date/time) - A companion "Maintenance OFF" workflow that reads that table and reactivates the listed workflows (not included in this template) ### Before you activate 1. Open Config and set base_url to your own instance URL 2. In excluded_workflow_ids, list — comma-separated — the workflow IDs to never touch (this workflow excludes itself automatically) 3. Connect your n8n API credential on both HTTP Request nodes 4. Pick or create your Data Table on Save to maintenance_log ⚠️ The "fetch active workflows" call uses limit=250. With more than 250 active workflows, add pagination (nextCursor).
The steps
- Ogni sera alle 22:30
- Config
- Recupera workflow pubblicati
- Estrai singoli workflow
- Escludi self e workflow esclusi
- Salva in maintenance_log
- Disattiva workflow
- Loop su ogni workflow
Similar automations
Code, Git & Developer ToolsReactivate nightly maintenance workflows with Data Tables and the n8n API8 stepsMonitoring, Ops & IncidentsMonitor competitor pricing pages nightly with EnConvert and Data Tables11 stepsCode, Git & Developer ToolsAttach a Default Error Handler to Active Workflows8 stepsCode, Git & Developer ToolsGenerate a Swagger Preview of Active n8n Webhooks4 steps