{"product_id":"n8n-stale-workflow-alerts-via-api-gmail-http-request","title":"n8n Stale Workflow Alerts via API \u0026 Gmail (HTTP Request)","description":"\u003ch3\u003eStay on top of failed and “stale” n8n workflows—automatically alert via Gmail\u003c\/h3\u003e\n\u003cp\u003eThis n8n workflow monitors a specific workflow’s latest execution using the n8n REST API and sends a Gmail alert when the run fails or hasn’t successfully completed within the expected time window. Designed to help SaaS operators and automation engineers catch issues early—every 6 hours.\u003c\/p\u003e\n\n\u003ch3\u003eWhat this workflow does\u003c\/h3\u003e\n\u003cul\u003e\n  \u003cli\u003e\n\u003cstrong\u003eRuns on a 6-hour schedule\u003c\/strong\u003e using a schedule trigger.\u003c\/li\u003e\n  \u003cli\u003e\n\u003cstrong\u003eFetches the latest execution\u003c\/strong\u003e for your configured workflow ID by calling the \u003cstrong\u003en8n REST API\u003c\/strong\u003e via an \u003cstrong\u003eHTTP Request\u003c\/strong\u003e node.\u003c\/li\u003e\n  \u003cli\u003e\n\u003cstrong\u003eDetects “stale” executions\u003c\/strong\u003e by calculating the number of hours since the last execution finished (or started), then comparing it against the expected run interval plus a grace period.\u003c\/li\u003e\n  \u003cli\u003e\n\u003cstrong\u003eDetermines whether attention is needed\u003c\/strong\u003e when either:\n    \u003cul\u003e\n      \u003cli\u003ethe latest execution status is \u003cstrong\u003enon-success\u003c\/strong\u003e, or\u003c\/li\u003e\n      \u003cli\u003ethe execution is considered \u003cstrong\u003estale\u003c\/strong\u003e (didn’t succeed in the defined time window).\u003c\/li\u003e\n    \u003c\/ul\u003e\n  \u003c\/li\u003e\n  \u003cli\u003e\n\u003cstrong\u003eSends a Gmail alert\u003c\/strong\u003e when the monitor status indicates attention is required.\u003c\/li\u003e\n\u003c\/ul\u003e\n\n\u003ch3\u003eUse cases\u003c\/h3\u003e\n\u003cul\u003e\n  \u003cli\u003eAlert your team when a critical automation pipeline in n8n fails (e.g., data sync, provisioning, reporting jobs).\u003c\/li\u003e\n  \u003cli\u003eDetect silent failures where a workflow stops running or lags behind its expected schedule.\u003c\/li\u003e\n  \u003cli\u003eKeep operational visibility for multi-workflow n8n setups by monitoring one workflow at a time via workflow ID.\u003c\/li\u003e\n\u003c\/ul\u003e\n\n\u003ch3\u003eTechnical details\u003c\/h3\u003e\n\u003cul\u003e\n  \u003cli\u003e\n\u003cstrong\u003eSchedule Trigger\u003c\/strong\u003e: runs every 6 hours.\u003c\/li\u003e\n  \u003cli\u003e\n\u003cstrong\u003eHTTP Request\u003c\/strong\u003e: calls the n8n REST API (use your \u003ccode\u003eYOUR_N8N_API_KEY\u003c\/code\u003e and set \u003ccode\u003eYOUR_WORKFLOW_ID\u003c\/code\u003e).\u003c\/li\u003e\n  \u003cli\u003e\n\u003cstrong\u003eCode\u003c\/strong\u003e: calculates elapsed hours since the last execution and evaluates stale conditions.\u003c\/li\u003e\n  \u003cli\u003e\n\u003cstrong\u003eIf\u003c\/strong\u003e: applies logic to decide whether to alert based on status and staleness.\u003c\/li\u003e\n  \u003cli\u003e\n\u003cstrong\u003eGmail\u003c\/strong\u003e: sends the email using Gmail OAuth2; configure the recipient in the Gmail node’s \u003cem\u003esendTo\u003c\/em\u003e field.\u003c\/li\u003e\n\u003c\/ul\u003e\n\n\u003cp\u003eSet up the n8n instance URL (currently \u003ccode\u003ehttp:\/\/localhost:5678\u003c\/code\u003e) so the HTTP Request node can reach it from where this workflow runs.\u003c\/p\u003e","brand":"N8N Commerce","offers":[{"title":"Default Title","offer_id":46146332426419,"sku":"N8N-20243","price":37.99,"currency_code":"GBP","in_stock":true}],"thumbnail_url":"\/\/cdn.shopify.com\/s\/files\/1\/0749\/6279\/6723\/files\/AAHwIKPp6IFSuUjHPuKl-_45s4UFR6.png?v=1790846128","url":"https:\/\/buyflowscripts.com\/products\/n8n-stale-workflow-alerts-via-api-gmail-http-request","provider":"N8N Commerce","version":"1.0","type":"link"}