Monitor & auto-heal AWS EC2 instances with multi-channel alerts
This n8n workflow automates the monitoring, health assessment, and self-healing of AWS EC2 instances in production environments. It runs periodic checks, identifies unhealthy instances based on status and metrics, restarts them automatically, and notifies teams via multi-channel alerts while logging data for auditing and reporting.
Key Features
- Triggers health checks every 5 minutes to proactively monitor EC2 fleet status.
- Fetches and loops through all production EC2 instances for individualized analysis.
- Evaluates instance health using AWS metrics and custom thresholds to detect issues like high CPU or stopped states.
- Performs automatic restarts on unhealthy instances to minimize downtime.
- Sends instant WhatsApp notifications for urgent alerts, detailed email reports for team review, and logs metrics to Google Sheets for long-term tracking.
- Includes sticky notes for quick reference on configuration, self-healing logic, and alert setup.
Workflow Process
- The Schedule Trigger node runs the workflow every 5 minutes, ensuring frequent health monitoring without overwhelming AWS APIs.
- The Get EC2 Instances node fetches all production-tagged EC2 instances from AWS, filtering by environment (e.g., tag: Environment=Production).
- The Loop Over Instances node iterates through each fetched instance individually, allowing parallel processing for scalability.
- The Check Instance Status node retrieves detailed health metrics for the current instance via AWS API (e.g., status checks, CPU utilization, and state).
- The Health Status Check node evaluates the instance's status against predefined thresholds (e.g., failed system checks or high load); if healthy, it skips to logging.
- The Analyze Health Data node assesses metrics in depth to determine action (e.g., restart if CPU > 90% for 5+ minutes) and prepares alert payloads.
- The Restart Instance node automatically initiates a reboot on unhealthy instances using AWS EC2 API, with optional dry-run mode for testing.
- The WhatsApp Notification node (part of Multi-Channel Alerts) sends instant alerts via Twilio WhatsApp API, including instance ID, issue summary, and restart status.
- The Email Report node generates and sends a detailed HTML report to the team via SMTP, summarizing checked instances, actions taken, and metrics trends.
- The Google Sheets Logging node appends health data, timestamps, and outcomes to a specified spreadsheet for historical analysis and dashboards.
- The Sticky Notes nodes provide inline documentation: one for AWS credential setup, one explaining self-healing thresholds, and one for alert channel configurations.
Setup Instructions
- Import the workflow into n8n and activate the Schedule Trigger with a 5-minute cron expression (e.g.,
*/5 * * * *). - Configure AWS credentials in the Get EC2 Instances, Check Instance Status, and Restart Instance nodes using IAM roles with EC2 read/restart permissions.
- Set up Twilio credentials in the WhatsApp Notification node, including your Twilio SID, auth token, and WhatsApp-enabled phone numbers for sender/receiver.
- Add SMTP credentials (e.g., Gmail or AWS SES) in the Email Report node, and update sender/receiver email addresses in the node parameters.
- Link Google Sheets in the Google Sheets Logging node by providing the spreadsheet ID, sheet name, and OAuth credentials for write access.
- Customize health thresholds in Health Status Check and Analyze Health Data (e.g., via expressions for CPU/memory limits).
- Test the workflow by manually executing it on a small set of instances and verifying alerts/logging before enabling production scheduling.
- Review sticky notes within n8n for quick tips, and monitor executions in the dashboard to fine-tune intervals or error handling.
Prerequisites
- AWS account with EC2 access and IAM user/role for DescribeInstances, DescribeInstanceStatus, and RebootInstances actions.
- Twilio account with WhatsApp sandbox or approved number for notifications.
- SMTP email service (e.g., Gmail, Outlook) with app-specific passwords enabled.
- Google Workspace or personal Google account for Sheets integration.
- n8n instance with AWS, Twilio, SMTP, and Google Sheets nodes installed (cloud or self-hosted).
- Production EC2 instances tagged consistently (e.g., Environment=Production) for filtering.
Modification Options
- Adjust the Schedule Trigger interval to hourly for less frequent checks or integrate with AWS CloudWatch Events for dynamic triggering.
- Expand Analyze Health Data to include advanced metrics (e.g., disk I/O via CloudWatch) or ML-based anomaly detection.
- Add more alert channels in Multi-Channel Alerts, such as Slack webhooks or PagerDuty integrations, by duplicating the WhatsApp/Email branches.
- Enhance Google Sheets Logging with charts or conditional formatting via Google Apps Script for visual dashboards.
- Implement approval gates in Restart Instance (e.g., via email confirmation) to prevent auto-restarts in sensitive environments.
Explore More AI Workflows: Get in touch with us for custom n8n automation!
n8n AWS EC2 Instance Monitoring and Auto-Healing Workflow with Multi-Channel Alerts
This n8n workflow provides a robust solution for monitoring AWS EC2 instances, automatically attempting to heal them if issues are detected, and sending multi-channel alerts to keep you informed. It simplifies the process of maintaining the health and availability of your EC2 fleet.
What it does
This workflow automates the following steps:
- Scheduled Trigger: The workflow is initiated on a predefined schedule (e.g., every 5 minutes) to regularly check the status of your EC2 instances.
- AWS EC2 Status Check: It makes an HTTP request to the AWS API to retrieve the current status of your EC2 instances.
- Process Instance Data: A Code node processes the raw data received from AWS, likely extracting relevant instance IDs, states, and any detected issues.
- Loop Through Instances: It iterates through each EC2 instance identified in the previous step.
- Conditional Healing/Alerting: For each instance, it checks its status:
- If an issue is detected (e.g., instance stopped, unhealthy):
- It attempts to restart or perform a healing action on the EC2 instance via another HTTP request to the AWS API.
- It logs the incident and the healing attempt to a Google Sheet for historical tracking and auditing.
- It sends an email notification to a specified recipient, detailing the incident and the action taken.
- If no issue is detected:
- It proceeds to the next instance without taking any action, effectively doing nothing.
- If an issue is detected (e.g., instance stopped, unhealthy):
Prerequisites/Requirements
To use this workflow, you will need:
- n8n Instance: A running n8n instance.
- AWS Account: An AWS account with appropriate IAM permissions to:
- List EC2 instance statuses.
- Start/Stop/Reboot EC2 instances (for auto-healing).
- Google Sheets Account: A Google Sheets account for logging incidents and actions.
- SMTP Server/Email Service: An SMTP server or email service configured in n8n for sending email alerts.
- n8n Credentials: Configured n8n credentials for:
- AWS (API Key/Secret or IAM Role).
- Google Sheets (OAuth or Service Account).
- Email (SMTP credentials).
Setup/Usage
- Import the Workflow:
- Download the provided JSON file.
- In your n8n instance, go to "Workflows" and click "New".
- Click the three dots in the top right corner and select "Import from JSON".
- Paste the workflow JSON or upload the file.
- Configure Credentials:
- Locate the "HTTP Request" nodes (for AWS API calls), "Google Sheets" node, and "Send Email" node.
- For each of these nodes, select or create the necessary credentials. Ensure your AWS credentials have the permissions mentioned in the "Prerequisites" section.
- Customize AWS API Calls:
- Review the "HTTP Request" nodes. You may need to adjust the AWS API endpoints, regions, and request bodies to match your specific EC2 monitoring and healing requirements (e.g., filtering by tags, specific instance IDs, different healing actions).
- Configure Google Sheets:
- Open the "Google Sheets" node.
- Specify the "Spreadsheet ID" and "Sheet Name" where incidents will be logged. Ensure the sheet has appropriate columns for incident details (e.g., Instance ID, Status, Action Taken, Timestamp).
- Configure Email Alerts:
- Open the "Send Email" node.
- Set the "To" email address(es) for notifications.
- Customize the "Subject" and "Body" of the email to provide clear and actionable information about the EC2 incident.
- Adjust Schedule:
- Open the "Schedule Trigger" node.
- Adjust the "Interval" or "CRON Expression" to define how frequently the workflow should run (e.g., every 5 minutes, every hour).
- Activate the Workflow:
- Once configured, activate the workflow by toggling the "Active" switch in the top right corner of the workflow editor.
The workflow will now automatically monitor your AWS EC2 instances, attempt to heal them if issues arise, and send out alerts through email and log to Google Sheets.
Related Templates
Synchronizing WooCommerce inventory and creating products with Google Gemini AI and BrowserAct
Synchronize WooCommerce Inventory & Create Products with Gemini AI & BrowserAct This sophisticated n8n template automates WooCommerce inventory management by scraping supplier data, updating existing products, and intelligently creating new ones with AI-formatted descriptions. This workflow is essential for e-commerce operators, dropshippers, and inventory managers who need to ensure their product pricing and stock levels are synchronized with multiple third-party suppliers, minimizing overselling and maximizing profit. --- Self-Hosted Only This Workflow uses a community contribution and is designed and tested for self-hosted n8n instances only. --- How it works The workflow is typically run by a Schedule Trigger (though a Manual Trigger is also shown) to check stock automatically. It reads a list of suppliers and their inventory page URLs from a central Google Sheet. The workflow loops through each supplier: A BrowserAct node scrapes the current stock and price data from the supplier's inventory page. A Code node parses this bulk data into individual product items. It then loops through each individual product found. The workflow checks WooCommerce to see if the product already exists based on its name. If the product exists: It proceeds to update the existing product's price and stock quantity. If the product DOES NOT exist: An If node checks if the missing product's category matches a predefined type (optional filtering). If it passes the filter, a second BrowserAct workflow scrapes detailed product attributes from a dedicated product page (e.g., DigiKey). An AI Agent (Gemini) transforms these attributes into a specific, styled HTML table for the product description. Finally, the product is created in WooCommerce with all scraped details and the AI-generated description. Error Handling: Multiple Slack nodes are configured to alert your team immediately if any scraping task fails or if the product update/creation process encounters an issue. Note: This workflow does not support image uploads for new products. To enable this functionality, you must modify both the n8n and BrowserAct workflows. --- Requirements BrowserAct API account for web scraping BrowserAct n8n Community Node -> (n8n Nodes BrowserAct) BrowserAct templates named “WooCommerce Inventory & Stock Synchronization” and “WooCommerce Product Data Reconciliation” Google Sheets credentials for the supplier list WooCommerce credentials for product management Google Gemini account for the AI Agent Slack credentials for error alerts --- Need Help? How to Find Your BrowseAct API Key & Workflow ID How to Connect n8n to Browseract How to Use & Customize BrowserAct Templates How to Use the BrowserAct N8N Community Node --- Workflow Guidance and Showcase STOP Overselling! Auto-Sync WooCommerce Inventory from ANY Supplier
Tax deadline management & compliance alerts with GPT-4, Google Sheets & Slack
AI-Driven Tax Compliance & Deadline Management System Description Automate tax deadline monitoring with AI-powered insights. This workflow checks your tax calendar daily at 8 AM, uses GPT-4 to analyze upcoming deadlines across multiple jurisdictions, detects overdue and critical items, and sends intelligent alerts via email and Slack only when immediate action is required. Perfect for finance teams and accounting firms who need proactive compliance management without manual tracking. 🏛️🤖📊 Good to Know AI-Powered: GPT-4 provides risk assessment and strategic recommendations Multi-Jurisdiction: Handles Federal, State, and Local tax requirements automatically Smart Alerts: Only notifies executives when deadlines are overdue or critical (≤3 days) Priority Classification: Categorizes deadlines as Overdue, Critical, High, or Medium priority Dual Notifications: Critical alerts to leadership + daily summaries to team channel Complete Audit Trail: Logs all checks and deadlines to Google Sheets for compliance records How It Works Daily Trigger - Runs at 8:00 AM every morning Fetch Data - Pulls tax calendar and company configuration from Google Sheets Analyze Deadlines - Calculates days remaining, filters by jurisdiction/entity type, categorizes by priority AI Analysis - GPT-4 provides strategic insights and risk assessment on upcoming deadlines Smart Routing - Only sends alerts if overdue or critical deadlines exist Critical Alerts - HTML email to executives + Slack alert for urgent items Team Updates - Slack summary to finance channel with all upcoming deadlines Logging - Records compliance check results to Google Sheets for audit trail Requirements Google Sheets Structure Sheet 1: TaxCalendar DeadlineID | DeadlineName | DeadlineDate | Jurisdiction | Category | AssignedTo | IsActive FED-Q1 | Form 1120 Q1 | 2025-04-15 | Federal | Income | John Doe | TRUE Sheet 2: CompanyConfig (single row) Jurisdictions | EntityType | FiscalYearEnd Federal, California | Corporation | 12-31 Sheet 3: ComplianceLog (auto-populated) Date | AlertLevel | TotalUpcoming | CriticalCount | OverdueCount 2025-01-15 | HIGH | 12 | 3 | 1 Credentials Needed Google Sheets - Service Account OAuth2 OpenAI - API Key (GPT-4 access required) SMTP - Email account for sending alerts Slack - Bot Token with chat:write permission Setup Steps Import workflow JSON into n8n Add all 4 credentials Replace these placeholders: YOURTAXCALENDAR_ID - Tax calendar sheet ID YOURCONFIGID - Company config sheet ID YOURLOGID - Compliance log sheet ID C12345678 - Slack channel ID tax@company.com - Sender email cfo@company.com - Recipient email Share all sheets with Google service account email Invite Slack bot to channels Test workflow manually Activate the trigger Customizing This Workflow Change Alert Thresholds: Edit "Analyze Deadlines" node: Critical: Change <= 3 to <= 5 for 5-day warning High: Change <= 7 to <= 14 for 2-week notice Medium: Change <= 30 to <= 60 for 2-month lookout Adjust Schedule: Edit "Daily Tax Check" trigger: Change hour/minute for different run time Add multiple trigger times for tax season (8 AM, 2 PM, 6 PM) Add More Recipients: Edit "Send Email" node: To: cfo@company.com, director@company.com CC: accounting@company.com BCC: archive@company.com Customize Email Design: Edit "Format Email" node to change colors, add logo, or modify layout Add SMS Alerts: Insert Twilio node after "Is Critical" for emergency notifications Integrate Task Management: Add HTTP Request node to create tasks in Asana/Jira for critical deadlines Troubleshooting | Issue | Solution | |-------|----------| | No deadlines found | Check date format (YYYY-MM-DD) and IsActive = TRUE | | AI analysis failed | Verify OpenAI API key and account credits | | Email not sending | Test SMTP credentials and check if critical condition met | | Slack not posting | Invite bot to channel and verify channel ID format | | Permission denied | Share Google Sheets with service account email | 📞 Professional Services Need help with implementation or customization? Our team offers: 🎯 Custom workflow development 🏢 Enterprise deployment support 🎓 Team training sessions 🔧 Ongoing maintenance 📊 Custom reporting & dashboards 🔗 Additional API integrations Discover more workflows – Get in touch with us
Weekly job discovery and CV matching with Gemini 1.5 Pro and Decodo Scraper
Header 1Smart Weekly Job Discovery Powered by Decodo This workflow automates the entire search process: every week, it uses Decodo’s reliable scraping engine to scan the web for fresh opportunities in your region and industry — no manual searching, no endless scrolling. Decodo handles the heavy lifting behind the scenes: it gathers search results, opens each job link, and extracts clean, readable text from pages that are normally full of scripts and formatting noise. The workflow always receives structured, usable information ready for AI analysis. Intelligent Matching — Not Just Scraping Once the jobs are collected, the system analyzes the candidate’s CV and compares it to each posting. It evaluates: Skill alignment Experience relevance Domain match Seniority level Then it generates a Match Percentage for each role, filtering out weak options and keeping only meaningful opportunities. A Weekly Report That Feels Human Every week, the workflow sends a polished report straight to your inbox: A quick overview of the candidate’s strengths Best-fit roles sorted by match score Clear reasons why each job fits Posted dates and direct links Insights on skills and market trends It reads like a personalized career briefing — generated automatically. How to Configure It Decodo Setup Add your Decodo API credentials to n8n. The Google Search + Scraper nodes rely on Decodo’s Web Scraping API. Make sure your plan supports scraping LinkedIn/Indeed pages. AI Setup Add your Google Gemini API key. The workflow uses two Gemini models: one for summarizing, one for job-matching. You can switch to OpenAI or Claude if you prefer. CV Input Add your CV text into the workflow (or connect Google Drive/Sheets for auto-loading). The Job Matcher Agent will use this text to compute match percentages. Email Setup Add your Gmail credentials and choose where the final report should be sent. Flexible and Easy to Customize Change the search region. Target different industries. Store all job data in Notion or Google Sheets. With Decodo’s scraping pipeline at the core, the whole process stays consistent, fast, and dependable. If you need any help Get in Touch