Quick Overview
This workflow ingests electricity and fuel consumption via webhook, schedule, or manual run, estimates CO2e using a live grid carbon-intensity API with fallback factors, generates an OpenAI sustainability report after human review, then sends approved reports to an ESG dashboard API and posts them to Slack.
How it works
- Triggers from a POST webhook, a monthly schedule, or a manual test run and loads reporting configuration and consumption inputs.
- Fetches the current grid carbon-intensity from api.carbonintensity.org.uk and falls back to a static emissions factor if the request fails.
- Calculates electricity, fuel, and total CO2e emissions and classifies the result into low, medium, high, or critical based on configured thresholds.
- Pauses for a human data review and continues only when the run is resumed and marked as approved.
- Uses OpenAI to generate a structured sustainability report from the calculated emissions, then parses the JSON into a final report payload with a safe fallback if parsing fails.
- Pauses again for report approval and, if approved, pushes the report to an ESG dashboard API endpoint and posts a formatted summary to a Slack channel (otherwise it marks the run as discarded).
Setup
- Add OpenAI credentials for the Chat Model used to generate the sustainability report.
- Add Slack credentials with permission to post messages (chat:write) and set the target channel in the workflow configuration.
- Update the configuration values (facility/company details, thresholds, emission factors, period dates, and dashboardApiUrl) to match your reporting requirements.
- If using the webhook trigger, copy the webhook URL and configure your metering/facilities system to POST consumption data to it.
- Configure the resume webhook URLs for the data-review and report-approval waits in your approval UI or process, and secure your ESG dashboard API endpoint (authentication, payload expectations) if you replace the demo URL.