Automate Sustainability Tracking in EU Legislation with n8n

This n8n workflow automates the extraction and classification of EU legislative procedures related to sustainability, saving you hours of manual research. It scrapes yesterday’s legislative documents, filters sustainability topics using OpenAI, and records results in Google Sheets while creating actionable Google Tasks.
HttpRequest
OpenAi
GoogleSheets
+7
Workflow Identifier: 2128
NODES in Use: SplitInBatches, Merge, If, HttpRequest, Html, Set, GoogleSheets, GoogleTasks, ManualTrigger, OpenAi

Press CTRL+F5 if the workflow didn't load.

Learn how to Build this Workflow with AI:

Visit through Desktop for Best experience

What This Workflow Does

This workflow gathers European Parliament legislative procedures from 18 days ago by default.
It pulls the HTML content of that day’s procedures, finds each law item, and gets details like reference number, committee, rapporteur, title, date, and PDF link.
Then, it asks GPT-4 Turbo AI to check if each item is related to sustainability topics such as environmental protection, circular economy, or pollution reduction.
Only the procedures marked as sustainability-related are saved into Google Sheets.
For each saved procedure, a Google Task is created for follow-up action.
This automation saves time by collecting and filtering relevant legislative items automatically.


Who Should Use This Workflow

This workflow fits people who track EU legislative procedures focused on sustainability.
It helps policy analysts and advocacy groups who want fast, reliable updates without reading many web pages manually.
Users who need to avoid missing sustainability-related laws or deadlines can use this automation.
It reduces manual work and makes sure no important sustainability procedures are overlooked.


Tools and Services Used

  • n8n Automation Platform: runs the workflow logic.
  • OpenAI GPT-4 Turbo API: classifies procedures for sustainability relevance.
  • Google Sheets API: stores filtered procedure data.
  • Google Tasks API: creates tasks for selected legislative items.
  • European Parliament Website HTTP Interface: provides raw HTML of procedures.

Inputs, Processing, and Outputs

Inputs

  • Date parameter set to 18 days ago by default (adjustable).
  • HTML content from the European Parliament’s legislative search page.

Processing Steps

  • Send HTTP GET request to fetch HTML of legislative items.
  • Use HTML extractor nodes to pull each procedure block.
  • Parse key details per procedure using CSS selectors.
  • Fix incomplete PDF links by adding the domain prefix.
  • Split items into batches for handling one by one.
  • Send each item’s data to OpenAI GPT-4 Turbo with a strict prompt to decide if it relates to sustainability.
  • Receive and collect AI classification: “yes” or “no”.
  • Merge classification results back with original data.
  • Filter out all items unless sustainability classification is “yes”.
  • Append filtered items into Google Sheets.
  • Create Google Tasks for each saved sustainability item.

Outputs

  • A Google Sheet listing all sustainability-related legislative procedures.
  • Google Tasks generated for each listed procedure to organize follow-up.

Beginner Step-by-Step: How to Use This Workflow in n8n

Importing the Workflow

  1. Download the workflow file by clicking the Download button on this page.
  2. Open n8n editor where you build workflows.
  3. Click on “Import from File” and select the downloaded workflow.

Configuration

  1. Add OpenAI API credentials for GPT-4 Turbo to the OpenAI (LLM) node.
  2. Enter Google Sheets API credentials and specify the Google Sheet ID and sheet tab to save data.
  3. Add Google Tasks API credentials and select the task list to create tasks.
  4. Check the HTTP Request node and adjust the date parameter if needed by editing {{$now.minus(18,’days’).format(‘yyyyMMdd’)}} expression.
  5. Verify the “Edit Links” Set node properly adds the domain to PDF links.

Testing and Activation

  1. Run the workflow manually by clicking the Manual Trigger node’s Execute button.
  2. Check output logs to confirm data fetching, parsing, classification, and saving are working as expected.
  3. If all works well, activate the workflow for production by enabling it and optionally set a schedule trigger.

If hosting n8n on your own server, consult self-host n8n for setup options.


Customization Ideas

  • Change the days offset number in the HTTP Request node to fetch procedures from a different date.
  • Modify the AI prompt in the Classification Agent node to include more sustainability-related topics or stricter criteria.
  • Adjust batch size in the SplitInBatches node to balance speed and API limits.
  • Switch Google Sheets output to other storage options like a database or send notifications instead.
  • Edit Google Tasks node to set different due dates, add reminders, or assign tasks to specific users.

Handling Common Problems

  • OpenAI API fails or times out: Check if the API key is correct and watch for quota limits. Add retries in n8n as needed.
  • Google Sheets append errors: Ensure API scopes allow writing, and the Sheet ID is correct. Reauthorize credentials if needed.
  • Broken PDF links: Confirm that the “Edit Links” node prepends the full domain URL correctly.

Summary

✓ Automatically fetches and parses European Parliament legislative records from a set date.
✓ Uses OpenAI GPT-4 Turbo to separate sustainability-related procedures.
✓ Saves relevant items into Google Sheets for easy tracking.
✓ Creates Google Tasks to organize follow-up work.
✓ Saves hours of manual searching and helps avoid missing key laws.
→ Makes monitoring sustainability laws faster and more reliable.
→ Lets policy workers focus on action instead of data collection.


Frequently Asked Questions

Import the workflow in n8n. Then open the OpenAI (LLM) node and enter the API Key in its credentials section.
Yes, change the date expression {{$now.minus(18,’days’).format(‘yyyyMMdd’)}} inside the HTTP Request node named “Extract Yesterday Records”.
Procedures classified as “no” are filtered out and not saved to Google Sheets or assigned as Google Tasks.
Yes, edit the configuration of the Google Tasks node to set custom due dates or reminders for tasks.

Promoted by BULDRR AI

Related Workflows

Automate Viral UGC Video Creation Using n8n + Degaus (Beginner-Friendly Guide)

Learn how to automate viral UGC video creation using n8n, AI prompts, and Degaus. This beginner-friendly guide shows how to import, configure, and run the workflow without technical complexity.
Form Trigger
Google Sheets
Gmail
+37
Free

AI SEO Blog Writer Automation in n8n

A complete beginner guide to building an AI-powered SEO blog writer automation using n8n.
AI Agent
Google Sheets
httpRequest
+5
Free

Automate CrowdStrike Alerts with VirusTotal, Jira & Slack

This workflow automates processing of CrowdStrike detections by enriching threat data via VirusTotal, creating Jira tickets for incident tracking, and notifying teams on Slack for quick response. Save hours daily by transforming complex threat data into actionable alerts effortlessly.
scheduleTrigger
httpRequest
jira
+5
Free

Automate Telegram Invoices to Notion with AI Summaries & Reports

Save hours on financial tracking by automating invoice extraction from Telegram photos to Notion using Google Gemini AI. This workflow extracts data, records transactions, and generates detailed spending reports with charts sent on schedule via Telegram.
lmChatGoogleGemini
telegramTrigger
notion
+9
Free

Automate Email Replies with n8n and AI-Powered Summarization

Save hours managing your inbox with this n8n workflow that uses IMAP email triggers, AI summarization, and vector search to draft concise replies requiring minimal review. Automate business email processing efficiently with AI guidance and Gmail integration.
emailReadImap
vectorStoreQdrant
emailSend
+12
Free

Automate Email Campaigns Using n8n with Gmail & Google Sheets

This n8n workflow automates personalized email outreach campaigns by integrating Gmail and Google Sheets, saving hours of manual follow-up work and reducing errors in email sequences. It ensures timely follow-ups based on previous email interactions, optimizing communication efficiency.
googleSheets
gmail
code
+5
Free