πŸ”¬ Generate weekly energy consumption reports with EnergiDataService, email and Google Drive

⚑ 379 views Β· πŸ”¬ Document Extraction & Analysis

Description

πŸ“Š Generate Weekly Energy Consumption Reports with API, Email and Google Drive

This workflow automates the process of retrieving energy consumption data, formatting it into a CSV report, and distributing it every week via email and Google Drive.

⚑ Quick Implementation Steps:

🎯 Who’s It For

Energy providers, sustainability departments, facility managers, renewable energy operators.

πŸ›  Requirements

βš™οΈ How It Works

Workflow triggers every Monday at 8 AM, fetches consumption data, emails CSV report and saves a copy to Google Drive.

πŸ”„ Workflow Steps

1. Schedule Weekly (Mon 8:00 AM)

2. Fetch Energy Data

https://api.energidataservice.dk/dataset/ConsumptionDE35Hour
(sample API)

Sample Response Structure:

{
"records": [
{
"HourDK": "2025-08-25T01:00:00",
"MunicipalityNo": ___,
"MunicipalityName": "Copenhagen",
"ConsumptionkWh": 12345.67
}
]
}

3. Normalize Records

const itemlist = $input.first().json.records;
return itemlist.map(r => ({ json: r }));

4. Convert to File

5. Send Email Weekly Report

6. Report File Upload to Google Drive

energy_report_{{ $now.format('yyyy_MM_dd_HH_ii_ss') }}

✨ How To Customize

Change report frequency, email template, data format (CSV/Excel) or add-ons.

βž• Add-ons

🚦 Use Case Examples

πŸ” Troubleshooting Guide

IssueCauseSolution
Data not fetchedAPI endpoint incorrectVerify URL
Email delivery issuesSMTP configuration incorrectVerify SMTP
Drive save failsPermissions/Drive ID incorrectCheck Drive permissions

πŸ“ž Need Assistance?

Contact WeblineIndia for additional customization and support, we’re happy to help.

πŸ”— Nodes Used

Cron, Send Email, HTTP Request, Google Drive, Convert to File

πŸ“₯ Import

Download workflow.json and import into n8n: Workflow menu β†’ Import from File

πŸ“– Importing guide Β· πŸ”‘ Credential setup