Skip to main content

Detect AWS Orphaned Resources & Send Cost Reports to Slack, Email, and Sheets

Workflow preview

Workflow preview
100%
Detect AWS Orphaned Resources & Send Cost Reports to Slack, Email, and Sheets preview
Open on n8n.io

Important notice

This workflow is provided as-is. Please review and test before using in production.

1. Workflow Overview

How it works This workflow automatically scans AWS accounts for orphaned resources (unattached EBS volumes, old snapshots 90 days, unassociated Elastic IPs) that waste money. It calculates cost...

Best for

  • DevOps automation workflows
  • advanced n8n builders looking for reusable templates

Tools used

n8n-nodes-base.stickynote, n8n-nodes-base.scheduletrigger, n8n-nodes-base.set, n8n-nodes-base.aggregate, n8n-nodes-base.code, n8n-nodes-base.slack, n8n-nodes-base.gmail, n8n-nodes-base.awslambda

Source and attribution

This workflow is cataloged by N8N Workflows and links back to its original n8n.io source page by Chad M. Crowell.

Original n8n.io source

1.1 Workflow description

Title
Detect AWS Orphaned Resources & Send Cost Reports to Slack, Email, and Sheets
Workflow name
Detect AWS Orphaned Resources & Send Cost Reports to Slack, Email, and Sheets

How it works

This workflow automatically scans AWS accounts for orphaned resources (unattached EBS volumes, old snapshots >90 days, unassociated Elastic IPs) that waste money. It calculates cost impact, validates compliance tags, and sends multi-channel alerts via Slack, Email, and Google Sheets audit logs.

Key Features:

  • ๐Ÿ” Multi-region scanning with parallel execution
  • ๐Ÿ’ฐ Monthly/annual cost calculation with risk scoring
  • ๐Ÿ“Š Professional HTML reports with charts and tables
  • ๐Ÿท๏ธ Tag compliance validation (SOC2/ISO27001/HIPAA)
  • โœ… Conditional alerting (only alerts when resources found)
  • ๐Ÿ“ˆ Google Sheets audit trail for trend analysis

What gets detected:

  • Unattached EBS volumes ($0.10/GB/month waste)
  • Snapshots older than 90 days ($0.05/GB/month)
  • Unassociated Elastic IPs ($3.60/month each)

Typical savings: $50-10K/month depending on account size

Set up steps

Prerequisites

AWS Configuration:

  1. Create IAM user n8n-resource-scanner with these permissions:
    • ec2:DescribeVolumes
    • ec2:DescribeSnapshots
    • ec2:DescribeAddresses
    • ec2:DescribeInstances
    • lambda:InvokeFunction
  2. Deploy Lambda function aws-orphaned-resource-scanner (Node.js 18+)
  3. Add EC2 read-only permissions to Lambda execution role
  4. Generate AWS Access Key + Secret Key

Lambda Function Code: See sticky notes in workflow for complete implementation using @aws-sdk/client-ec2

Credentials Required:

  • AWS IAM (Access Key + Secret)
  • Slack (OAuth2 or Webhook)
  • Gmail (OAuth2)
  • Google Sheets (OAuth2)

Configuration

  1. Initialize Config Node: Update these settings:

    • awsRegions: Your AWS regions (default: us-east-1)
    • emailRecipients: FinOps team emails
    • slackChannel: Alert channel (e.g., #cloud-ops)
    • requiredTags: Compliance tags to validate
    • snapshotAgeDays: Age threshold (default: 90)
  2. Set Region Variables: Choose regions to scan

  3. Lambda Function: Deploy function with provided code (see workflow sticky notes)

  4. Google Sheet: Create spreadsheet with headers:

    • Scan Date | Region | Resource Type | Resource ID | Monthly Cost | Compliance | etc.
  5. Credentials: Connect all four credential types in n8n

  6. Schedule: Enable "Weekly Scan Trigger" (default: Mondays 8 AM UTC)

Testing

  1. Click "Execute Workflow" to run manual test
  2. Verify Lambda invokes successfully
  3. Check Slack alert appears
  4. Confirm email with HTML report received
  5. Validate Google Sheets logging works

Customization Options

  • Multi-region: Add regions in "Initialize Config"
  • Alert thresholds: Modify cost/age thresholds
  • Additional resource types: Extend Lambda function
  • Custom tags: Update required tags list
  • Schedule frequency: Adjust cron trigger

Use Cases

  • FinOps Teams: Automated cloud waste detection and cost reporting
  • Cloud Operations: Weekly compliance and governance audits
  • DevOps: Resource cleanup automation and alerting
  • Security/Compliance: Tag validation for SOC2/ISO27001/HIPAA
  • Executive Reporting: Monthly cost optimization metrics

Resources

1.2 Logical Blocks

This catalog entry is organized from the workflow JSON. The node-level section below shows the executable blocks available for review before importing the template.

2. Block-by-Block Analysis

Block 1 - Workflow Overview

Type / Role
n8n-nodes-base.stickyNote - stickyNote
Config choices
Version 1

Block 2 - Weekly Scan Trigger1

Type / Role
n8n-nodes-base.scheduleTrigger - scheduleTrigger
Config choices
Version 1.2

Block 3 - Initialize Config

Type / Role
n8n-nodes-base.set - set
Config choices
Version 3.4

Block 4 - Aggregate All Resources

Type / Role
n8n-nodes-base.aggregate - aggregate
Config choices
Version 1

Block 5 - Calculate Summary Stats

Type / Role
n8n-nodes-base.code - code
Config choices
Version 2

Block 6 - Generate HTML Report

Type / Role
n8n-nodes-base.code - code
Config choices
Version 2

Block 7 - Generate CSV Export

Type / Role
n8n-nodes-base.code - code
Config choices
Version 2

Block 8 - Send Slack Alert

Type / Role
n8n-nodes-base.slack - slack
Config choices
Version 2.2

Block 9 - Send Email Report

Type / Role
n8n-nodes-base.gmail - gmail
Config choices
Version 2.1

Block 10 - Set Region Variables

Type / Role
n8n-nodes-base.set - set
Config choices
Version 3.4

Block 11 - Scan Elastic IPs

Type / Role
n8n-nodes-base.awsLambda - awsLambda
Config choices
Version 1

Block 12 - Scan EBS Snapshots

Type / Role
n8n-nodes-base.awsLambda - awsLambda
Config choices
Version 1

Block 13 - Scan unattached EBS Volumes

Type / Role
n8n-nodes-base.awsLambda - awsLambda
Config choices
Version 1

Block 14 - Process Snapshots

Type / Role
n8n-nodes-base.code - code
Config choices
Version 2

Block 15 - Process EBS Volumes

Type / Role
n8n-nodes-base.code - code
Config choices
Version 2

Block 16 - Process Elastic IPs

Type / Role
n8n-nodes-base.code - code
Config choices
Version 2

Block 17 - None Found Slack Message

Type / Role
n8n-nodes-base.slack - slack
Config choices
Version 2.2

Block 18 - Clean Scan CSV Export

Type / Role
n8n-nodes-base.code - code
Config choices
Version 2

Block 19 - Append or update row in sheet

Type / Role
n8n-nodes-base.googleSheets - googleSheets
Config choices
Version 4.7

Block 20 - Sticky Note

Type / Role
n8n-nodes-base.stickyNote - stickyNote
Config choices
Version 1

Block 21 - Sticky Note2

Type / Role
n8n-nodes-base.stickyNote - stickyNote
Config choices
Version 1

Block 22 - Sticky Note3

Type / Role
n8n-nodes-base.stickyNote - stickyNote
Config choices
Version 1

Block 23 - Sticky Note1

Type / Role
n8n-nodes-base.stickyNote - stickyNote
Config choices
Version 1

Block 24 - Sticky Note4

Type / Role
n8n-nodes-base.stickyNote - stickyNote
Config choices
Version 1

Showing the first 24 of 29 workflow blocks. Download the JSON for the full node graph.

3. Summary Table

Workflow Detect AWS Orphaned Resources & Send Cost Reports to Slack, Email, and Sheets
Complexity advanced
Nodes 29
Categories DevOps
Author Chad M. Crowell
Published 08 Dec 2025

4. Reproducing the Workflow from Scratch

  1. 1. Download the workflow JSON

    Use the JSON export at /data/workflows/11612/11612.json as the source template for this automation.

  2. 2. Import the template into n8n

    Open n8n, import the downloaded JSON, and review each node before activating the workflow.

  3. 3. Configure credentials and variables

    Replace placeholder credentials, API keys, webhook URLs, account IDs, and environment-specific values with your own settings.

  4. 4. Test with sample data

    Run the workflow manually or in a staging workspace, inspect node output, and confirm downstream systems receive the expected data.

  5. 5. Activate and monitor

    Enable the workflow only after testing, then monitor executions, errors, and rate limits during the first production runs.

5. General Notes & Resources

Review imported nodes carefully before activation. This catalog entry is intended to help you inspect the workflow structure, understand required services, and find related templates faster.

Node names, credentials, schedules, webhook paths, and external service limits may need adjustment for your workspace.

Frequently asked questions

What does Detect AWS Orphaned Resources & Send Cost Reports to Slack, Email, and Sheets do?

How it works This workflow automatically scans AWS accounts for orphaned resources (unattached EBS volumes, old snapshots 90 days, unassociated Elastic IPs) that waste money. It calculates cost...

What do I need before importing this workflow?

Review the workflow JSON, configure any required credentials in n8n, and test the automation in a safe workspace before using it in production.

Can I customize this workflow?

Yes. Use the block-by-block analysis and the downloadable JSON to inspect each node, then adjust credentials, prompts, schedules, filters, or destinations for your DevOps use case.