Skip to main content

Generate weekly energy consumption reports with EnergiDataService, email and Google Drive

Workflow preview

Workflow preview
100%
Generate weekly energy consumption reports with EnergiDataService, email and Google Drive preview
Open on n8n.io

Important notice

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

1. Workflow Overview

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 distri...

Best for

  • Document Extraction automation workflows
  • Multimodal AI automation workflows
  • intermediate n8n builders looking for reusable templates

Tools used

n8n-nodes-base.cron, n8n-nodes-base.httprequest, n8n-nodes-base.code, n8n-nodes-base.converttofile, n8n-nodes-base.emailsend, n8n-nodes-base.googledrive, n8n-nodes-base.stickynote

Source and attribution

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

Original n8n.io source

1.1 Workflow description

Title
Generate weekly energy consumption reports with EnergiDataService, email and Google Drive
Workflow name
Generate weekly energy consumption reports with EnergiDataService, email and Google Drive

📊 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:

  • Import the workflow into your n8n instance.
  • Configure your API, email details and Google Drive folder.
  • (Optional) Adjust the CRON schedule if you need a different time or frequency.
  • Activate workflow—automated weekly reports begin immediately.

🎯 Who’s It For

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

🛠 Requirements

  • n8n instance
  • Energy Consumption API access
  • Google Drive account
  • Email SMTP access

⚙️ 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)

  • Type: Cron Node
  • Runs every Monday at 8:00 AM.
  • Triggers the workflow execution automatically.

2. Fetch Energy Data

  • Type: HTTP Request Node
  • Makes a GET request to:
https://api.energidataservice.dk/dataset/ConsumptionDE35Hour
(sample API)
  • The API returns JSON data with hourly electricity consumption in Denmark.

Sample Response Structure:

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

3. Normalize Records

  • Type: Code Node
  • Extracts the records array from the API response and maps each entry into separate JSON items for easier handling downstream.
  • Code used:
const itemlist = $input.first().json.records;
return itemlist.map(r => ({ json: r }));

4. Convert to File

  • Type: Convert to File Node
  • Converts the array of JSON records into a CSV file.
  • The CSV is stored in a binary field called data.

5. Send Email Weekly Report

  • Type: Email Send Node
  • Sends the generated CSV file as an attachment.
  • Parameters:
  • fromEmail: Sender email address (configure in node).
  • toEmail: Recipient email address.
  • subject: "Weekly Energy Consumption Report".
  • attachments: =data (binary data from the previous node).

6. Report File Upload to Google Drive

  • Type: Google Drive Node
  • Uploads the CSV file to your Google Drive root folder.
  • Filename pattern:
energy_report_{{ $now.format('yyyy_MM_dd_HH_ii_ss') }}
  • Requires valid Google Drive OAuth2 credentials.

✨ How To Customize

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

➕ Add-ons

  • Integration with analytics tools (Power BI, Tableau)
  • Additional reporting formats (Excel, PDF)
  • Slack notifications

🚦 Use Case Examples

  • Automated weekly/monthly reporting for compliance
  • Historical consumption tracking
  • Operational analytics and forecasting

🔍 Troubleshooting Guide

Issue Cause Solution
Data not fetched API endpoint incorrect Verify URL
Email delivery issues SMTP configuration incorrect Verify SMTP
Drive save fails Permissions/Drive ID incorrect Check Drive permissions

📞 Need Assistance?

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

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 - Schedule Weekly (Mon 8AM)

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

Block 2 - Fetch Energy Data

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

Block 3 - Normalize Records

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

Block 4 - Convert to File

Type / Role
n8n-nodes-base.convertToFile - convertToFile
Config choices
Version 1.1

Block 5 - Send Email Weekly Report

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

Block 6 - Report File Upload to Google Drive

Type / Role
n8n-nodes-base.googleDrive - googleDrive
Config choices
Version 3

Block 7 - Sticky: Node Explanations1

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

Block 8 - Sticky: Node Explanations2

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

Block 9 - Sticky: Node Explanations3

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

Block 10 - Sticky: Node Explanations4

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

Block 11 - Sticky: Node Explanations5

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

Block 12 - Sticky: Node Explanations6

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

3. Summary Table

Workflow Generate weekly energy consumption reports with EnergiDataService, email and Google Drive
Complexity intermediate
Nodes 12
Categories Document Extraction, Multimodal AI
Author WeblineIndia
Published 19 Aug 2025

4. Reproducing the Workflow from Scratch

  1. 1. Download the workflow JSON

    Use the JSON export at /data/workflows/7592/7592.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 Generate weekly energy consumption reports with EnergiDataService, email and Google Drive do?

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 distri...

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 Document Extraction, Multimodal AI use case.