π Send daily marketplace KPI reports via Slack and Microsoft Outlook
β‘ 25 views Β· π Market Research & Insights
Description
Quick Overview
This workflow runs daily at 10am, reads a marketplaces configuration file, fetches KPI statistics from marketplace APIs via HTTP requests, compiles the results into an Excel file, then posts a Slack notification and emails the file using Microsoft Outlook while also saving it to disk.
How it works
- Runs every day at 10am on a scheduled trigger.
- Reads
/home/node/.n8n-files/config/marketplaces.jsonfrom disk and parses it as JSON to get the list of marketplaces to process. - Iterates through each marketplace entry and calls the marketplace stats endpoint with an HTTP GET request using environment-variable-based URL parts and an Authorization header.
- Extracts KPI fields from each API response (offers, orders, evaluations, grades, and various rates) and builds a consolidated metrics dataset with the current date.
- Converts the consolidated dataset into an
.xlsxfile and attaches it to a Microsoft Outlook email. - Sends a Slack message to confirm the KPI file was sent, and writes the same Excel file to
/home/node/.n8n-files/share_files/.
Setup
- Create the
marketplaces.jsonfile at/home/node/.n8n-files/config/marketplaces.jsonwith adataarray containing each marketplaceβsmarketplacename plus thebaseUrlEnv,endpointstatsEnv, andapiKeyEnvenvironment-variable keys used to build the request. - Define the required environment variables in your n8n environment for each marketplace (base URL, stats endpoint path, and API key/token used in the
Authorizationheader). - Add Microsoft Outlook OAuth2 credentials, set the recipient email address and message body in the Outlook node, and ensure attachments are allowed for your tenant.
- Add Slack OAuth2 credentials and select the target channel for the confirmation message.
- Ensure the n8n instance has read access to the config path and write access to
/home/node/.n8n-files/share_files/if you want to save the generated Excel file.
π Nodes Used
HTTP Request, Slack, Microsoft Outlook, Schedule Trigger, Read/Write Files from Disk, Convert to File
π₯ Import
Download workflow.json and import into n8n:
Workflow menu β Import from File