{"product_id":"set-default-error-workflow-in-n8n-via-api-batch-scan","title":"Set Default Error Workflow in n8n via API (Batch Scan)","description":"\u003ch3\u003eSet a Shared Default Error Workflow for Your n8n Automations—Automatically\u003c\/h3\u003e\n\u003cp\u003eThis n8n workflow runs nightly (or on demand) and uses the \u003cstrong\u003en8n public REST API\u003c\/strong\u003e to scan all workflows in your instance, then sets the configured \u003cstrong\u003edefault error workflow\u003c\/strong\u003e for eligible workflows—without disrupting anything already configured.\u003c\/p\u003e\n\n\u003ch3\u003eWhat this workflow does\u003c\/h3\u003e\n\u003cul\u003e\n  \u003cli\u003e\n\u003cstrong\u003eRuns on a schedule\u003c\/strong\u003e: executes every night at \u003cstrong\u003e01:00\u003c\/strong\u003e, or you can manually trigger it.\u003c\/li\u003e\n  \u003cli\u003e\n\u003cstrong\u003eFetches all workflows via API\u003c\/strong\u003e: calls the REST API and retrieves every workflow using \u003cstrong\u003ecursor-based pagination\u003c\/strong\u003e.\u003c\/li\u003e\n  \u003cli\u003e\n\u003cstrong\u003eFilters eligible targets\u003c\/strong\u003e:\n    \u003cul\u003e\n      \u003cli\u003eSkips workflows that are \u003cstrong\u003earchived\u003c\/strong\u003e.\u003c\/li\u003e\n      \u003cli\u003eSkips workflows tagged with the configured \u003cstrong\u003eexclusion_tag\u003c\/strong\u003e.\u003c\/li\u003e\n      \u003cli\u003eSkips the \u003cstrong\u003eerror workflow itself\u003c\/strong\u003e.\u003c\/li\u003e\n      \u003cli\u003eOptionally skips workflows that already have an error workflow set using \u003cstrong\u003eonly_fill_empty\u003c\/strong\u003e.\u003c\/li\u003e\n    \u003c\/ul\u003e\n  \u003c\/li\u003e\n  \u003cli\u003e\n\u003cstrong\u003eUpdates workflows safely\u003c\/strong\u003e: iterates through workflows in \u003cstrong\u003ebatches\u003c\/strong\u003e and updates each one via the API by setting \u003ccode\u003esettings.errorWorkflow\u003c\/code\u003e to your configured \u003cstrong\u003eerror_workflow_id\u003c\/strong\u003e, while keeping the existing workflow’s name, nodes, connections, and other settings intact.\u003c\/li\u003e\n  \u003cli\u003e\n\u003cstrong\u003eThrottles requests\u003c\/strong\u003e: waits briefly between updates to avoid hammering the API.\u003c\/li\u003e\n\u003c\/ul\u003e\n\n\u003ch3\u003eUse cases\u003c\/h3\u003e\n\u003cul\u003e\n  \u003cli\u003eAfter deploying a new SaaS, ensure \u003cstrong\u003eevery automation\u003c\/strong\u003e routes failures to your standard error handler.\u003c\/li\u003e\n  \u003cli\u003eReduce missed error handling when new workflows are created over time.\u003c\/li\u003e\n  \u003cli\u003eMaintain consistency across teams by enforcing a shared \u003cstrong\u003edefault error workflow\u003c\/strong\u003e, while skipping excluded or archived workflows.\u003c\/li\u003e\n\u003c\/ul\u003e\n\n\u003ch3\u003eTechnical details\u003c\/h3\u003e\n\u003cul\u003e\n  \u003cli\u003e\n\u003cstrong\u003eAPI integration\u003c\/strong\u003e: n8n REST API with an API key provided as an HTTP header credential (e.g., \u003ccode\u003eX-N8N-API-KEY\u003c\/code\u003e) used in both HTTP Request nodes.\u003c\/li\u003e\n  \u003cli\u003e\n\u003cstrong\u003eConfiguration\u003c\/strong\u003e: set \u003ccode\u003en8n_base_url\u003c\/code\u003e and \u003ccode\u003eerror_workflow_id\u003c\/code\u003e, then adjust \u003ccode\u003eonly_fill_empty\u003c\/code\u003e and \u003ccode\u003eexclusion_tag\u003c\/code\u003e.\u003c\/li\u003e\n  \u003cli\u003e\n\u003cstrong\u003eNodes used\u003c\/strong\u003e: set, no op, wait, filter, split out, sticky note.\u003c\/li\u003e\n\u003c\/ul\u003e","brand":"N8N Commerce","offers":[{"title":"Default Title","offer_id":45923082862771,"sku":"N8N-18868","price":55.99,"currency_code":"GBP","in_stock":true}],"thumbnail_url":"\/\/cdn.shopify.com\/s\/files\/1\/0749\/6279\/6723\/files\/LsMDEsSa0B_te3W8eOUwM_EdhdlVWO.png?v=1788167981","url":"https:\/\/buyflowscripts.com\/products\/set-default-error-workflow-in-n8n-via-api-batch-scan","provider":"N8N Commerce","version":"1.0","type":"link"}