{"product_id":"n8n-workflow-schedule-aws-ecs-office-hours-teams-alerts","title":"n8n Workflow: Schedule AWS ECS Office Hours + Teams Alerts","description":"\u003ch3\u003eKeep your Amazon ECS cost under control—with office-hours scheduling and instant Microsoft Teams alerts\u003c\/h3\u003e\n\u003cp\u003eThis n8n workflow automatically turns tagged \u003cstrong\u003eAmazon ECS services\u003c\/strong\u003e on during office hours, scales them to \u003cstrong\u003ezero at night\u003c\/strong\u003e, and posts clear \u003cstrong\u003estatus updates to Microsoft Teams\u003c\/strong\u003e. It also supports self-service restarts through an \u003cstrong\u003en8n Form\u003c\/strong\u003e for a limited duration.\u003c\/p\u003e\n\n\u003ch3\u003eWhat this workflow does\u003c\/h3\u003e\n\u003cul\u003e\n  \u003cli\u003e\n\u003cstrong\u003eSchedules runs\u003c\/strong\u003e on two time windows: \u003cstrong\u003e20:00 daily\u003c\/strong\u003e and \u003cstrong\u003e08:00 on weekdays\u003c\/strong\u003e—or when a user submits an \u003cstrong\u003en8n Form\u003c\/strong\u003e restart request.\u003c\/li\u003e\n  \u003cli\u003e\n\u003cstrong\u003eDiscovers ECS services\u003c\/strong\u003e across the configured clusters, lists services, describes them with tags, and keeps only those tagged \u003ccode\u003eauto-schedule=office-hours\u003c\/code\u003e.\u003c\/li\u003e\n  \u003cli\u003e\n\u003cstrong\u003eAt 20:00:\u003c\/strong\u003e saves each running service’s desired count into the \u003ccode\u003esaved-desired-count\u003c\/code\u003e tag, scales the service to \u003cstrong\u003e0\u003c\/strong\u003e, and posts a stop summary to a \u003cstrong\u003eMicrosoft Teams\u003c\/strong\u003e channel via incoming webhook.\u003c\/li\u003e\n  \u003cli\u003e\n\u003cstrong\u003eAt 08:00 (weekdays):\u003c\/strong\u003e restores services from \u003ccode\u003esaved-desired-count\u003c\/code\u003e, clears \u003ccode\u003esaved-desired-count\u003c\/code\u003e and \u003ccode\u003eoverride-until\u003c\/code\u003e, and posts a start summary to Teams.\u003c\/li\u003e\n  \u003cli\u003e\n\u003cstrong\u003eRestart requests (self-service):\u003c\/strong\u003e optionally prompts for a project, lets the requester choose stopped or already-overridden services and select a duration, sets \u003ccode\u003eoverride-until\u003c\/code\u003e, scales selected services back to their saved desired count, and then waits.\u003c\/li\u003e\n  \u003cli\u003e\n\u003cstrong\u003eHealth polling:\u003c\/strong\u003e polls Amazon ECS every \u003cstrong\u003e30 seconds\u003c\/strong\u003e until all selected services are healthy (or the max attempts is reached) and sends a ready\/failure alert to Teams.\u003c\/li\u003e\n  \u003cli\u003e\n\u003cstrong\u003eAutomatic switch-off:\u003c\/strong\u003e when the requested end time arrives, if it’s outside office hours and \u003ccode\u003eoverride-until\u003c\/code\u003e still matches, it scales services back to \u003cstrong\u003e0\u003c\/strong\u003e, clears the override tag, and notifies Teams.\u003c\/li\u003e\n\u003c\/ul\u003e\n\n\u003ch3\u003eUse cases\u003c\/h3\u003e\n\u003cul\u003e\n  \u003cli\u003eReduce ECS spend by running workloads only during business hours.\u003c\/li\u003e\n  \u003cli\u003eProvide developers an easy “turn it back on” option with controlled duration.\u003c\/li\u003e\n  \u003cli\u003eCentralize operational visibility in Microsoft Teams for scheduled stops\/starts and restart outcomes.\u003c\/li\u003e\n\u003c\/ul\u003e\n\n\u003ch3\u003eTechnical details\u003c\/h3\u003e\n\u003cul\u003e\n  \u003cli\u003e\n\u003cstrong\u003eAmazon ECS\u003c\/strong\u003e service tagging strategy: \u003ccode\u003eauto-schedule=office-hours\u003c\/code\u003e, \u003ccode\u003esaved-desired-count\u003c\/code\u003e, and \u003ccode\u003eoverride-until\u003c\/code\u003e.\u003c\/li\u003e\n  \u003cli\u003e\n\u003cstrong\u003eMicrosoft Teams\u003c\/strong\u003e notifications via \u003cstrong\u003eincoming webhook\u003c\/strong\u003e.\u003c\/li\u003e\n  \u003cli\u003e\n\u003cstrong\u003en8n nodes\/workflow building blocks:\u003c\/strong\u003e \u003ccode\u003eif\u003c\/code\u003e, \u003ccode\u003eset\u003c\/code\u003e, \u003ccode\u003ecode\u003c\/code\u003e, \u003ccode\u003eform\u003c\/code\u003e, \u003ccode\u003ewait\u003c\/code\u003e, \u003ccode\u003eswitch\u003c\/code\u003e.\u003c\/li\u003e\n\u003c\/ul\u003e","brand":"N8N Commerce","offers":[{"title":"Default Title","offer_id":46164146225331,"sku":"N8N-20522","price":10.99,"currency_code":"GBP","in_stock":true}],"thumbnail_url":"\/\/cdn.shopify.com\/s\/files\/1\/0749\/6279\/6723\/files\/PUWnDuQLVzLHrHK736AQF_hKnzwjZs.png?v=1791277312","url":"https:\/\/buyflowscripts.com\/products\/n8n-workflow-schedule-aws-ecs-office-hours-teams-alerts","provider":"N8N Commerce","version":"1.0","type":"link"}