{"product_id":"nightly-n8n-api-workflow-shutdown-data-table-logging","title":"Nightly n8n API Workflow Shutdown + Data Table Logging","description":"\u003ch3\u003eNightly n8n Shutdown Automation: Log Active Workflows to a Data Table, Then Deactivate for Maintenance\u003c\/h3\u003e\n\u003cp\u003eThis n8n API workflow runs every night at \u003cstrong\u003e22:30\u003c\/strong\u003e to identify all currently active workflows, records them in an \u003cstrong\u003en8n Data Table\u003c\/strong\u003e, and then \u003cstrong\u003edeactivates\u003c\/strong\u003e everything except the workflow(s) you choose to exclude—perfect for safe, repeatable maintenance windows.\u003c\/p\u003e\n\n\u003ch3\u003eWhat this workflow does\u003c\/h3\u003e\n\u003cul\u003e\n  \u003cli\u003e\n\u003cstrong\u003eScheduled execution:\u003c\/strong\u003e Automatically runs daily at \u003cstrong\u003e22:30\u003c\/strong\u003e.\u003c\/li\u003e\n  \u003cli\u003e\n\u003cstrong\u003eFetch active workflows via API:\u003c\/strong\u003e Calls the \u003cstrong\u003en8n API\u003c\/strong\u003e to list up to \u003cstrong\u003e250 active workflows\u003c\/strong\u003e on your instance.\u003c\/li\u003e\n  \u003cli\u003e\n\u003cstrong\u003eProcess results one-by-one:\u003c\/strong\u003e Splits the API response into \u003cem\u003eone item per workflow\u003c\/em\u003e.\u003c\/li\u003e\n  \u003cli\u003e\n\u003cstrong\u003eSkip protected workflows:\u003c\/strong\u003e Skips the \u003cstrong\u003ecurrent workflow\u003c\/strong\u003e and any workflow IDs listed in \u003cstrong\u003eexcluded_workflow_ids\u003c\/strong\u003e.\u003c\/li\u003e\n  \u003cli\u003e\n\u003cstrong\u003eLog deactivation candidates:\u003c\/strong\u003e For each remaining workflow, writes \u003cstrong\u003eworkflow_id\u003c\/strong\u003e, \u003cstrong\u003eworkflow_name\u003c\/strong\u003e, and \u003cstrong\u003edeactivated_at\u003c\/strong\u003e to an \u003cstrong\u003en8n Data Table\u003c\/strong\u003e.\u003c\/li\u003e\n  \u003cli\u003e\n\u003cstrong\u003eDeactivate for maintenance:\u003c\/strong\u003e Calls the \u003cstrong\u003en8n API\u003c\/strong\u003e again to deactivate each logged workflow.\u003c\/li\u003e\n\u003c\/ul\u003e\n\n\u003ch3\u003eUse cases\u003c\/h3\u003e\n\u003cul\u003e\n  \u003cli\u003eBefore planned downtime, reliably deactivate active automations to reduce load and avoid unintended runs.\u003c\/li\u003e\n  \u003cli\u003eMaintain auditability by storing which workflows were deactivated and when.\u003c\/li\u003e\n  \u003cli\u003eExclude critical workflows (e.g., monitoring or handoff automations) from shutdown using \u003cstrong\u003eexcluded_workflow_ids\u003c\/strong\u003e.\u003c\/li\u003e\n  \u003cli\u003eRun maintenance consistently on SaaS operators managing multiple n8n instances.\u003c\/li\u003e\n\u003c\/ul\u003e\n\n\u003ch3\u003eTechnical details\u003c\/h3\u003e\n\u003cul\u003e\n  \u003cli\u003e\n\u003cstrong\u003eIntegrations:\u003c\/strong\u003e n8n API via \u003cstrong\u003eHTTP Request\u003c\/strong\u003e using an \u003cstrong\u003en8n API credential\u003c\/strong\u003e.\u003c\/li\u003e\n  \u003cli\u003e\n\u003cstrong\u003eNodes used:\u003c\/strong\u003e \u003cstrong\u003eif\u003c\/strong\u003e, \u003cstrong\u003eset\u003c\/strong\u003e, \u003cstrong\u003esplit out\u003c\/strong\u003e, \u003cstrong\u003eData Table\u003c\/strong\u003e, \u003cstrong\u003eSticky Note\u003c\/strong\u003e, \u003cstrong\u003eHTTP Request\u003c\/strong\u003e.\u003c\/li\u003e\n  \u003cli\u003e\n\u003cstrong\u003eConfiguration:\u003c\/strong\u003e Set \u003cstrong\u003ebase_url\u003c\/strong\u003e to your n8n instance and select the target \u003cstrong\u003eData Table\u003c\/strong\u003e (e.g., \u003cem\u003emaintenance_log\u003c\/em\u003e with columns: \u003cem\u003eworkflow_id\u003c\/em\u003e, \u003cem\u003eworkflow_name\u003c\/em\u003e, \u003cem\u003edeactivated_at\u003c\/em\u003e).\u003c\/li\u003e\n  \u003cli\u003e\n\u003cstrong\u003eScalability note:\u003c\/strong\u003e If you have more than \u003cstrong\u003e250 active workflows\u003c\/strong\u003e, add pagination to the “list active workflows” request.\u003c\/li\u003e\n\u003c\/ul\u003e","brand":"N8N Commerce","offers":[{"title":"Default Title","offer_id":46075752022195,"sku":"N8N-19829","price":50.99,"currency_code":"GBP","in_stock":true}],"thumbnail_url":"\/\/cdn.shopify.com\/s\/files\/1\/0749\/6279\/6723\/files\/sJcU1FuTnzH9P_3xwsD2J_Gigkjxco.png?v=1790154230","url":"https:\/\/buyflowscripts.com\/products\/nightly-n8n-api-workflow-shutdown-data-table-logging","provider":"N8N Commerce","version":"1.0","type":"link"}