Build daily sales and support KPI reports from HTTP APIs with file logs
Ready for 3.0What this workflow does
This workflow has 13 nodes and runs on a schedule (cron 5 7 * * *) (plus 1 other trigger). It uses only n8n's built-in nodes.
How it runs
Trigger: On a schedule (cron 5 7 * * *) (plus 1 other trigger).
- Configure KPI report (Edit Fields (Set)): sets 12 fields: reports_dir, alerts_path, runs_log_path…
- Check config and pick date (Code): runs custom JavaScript code
- Date OK? (If): checks a condition and branches into true / false
- Get sales numbers (HTTP Request): calls an HTTP API
- Reply (Respond to Webhook): sends the response back to the webhook caller
- Get support numbers (HTTP Request): calls an HTTP API
- Build report (Code): runs custom JavaScript code
- Save report, alerts and run line (Code): runs custom JavaScript code
- Saved? (If): checks a condition and branches into true / false
- Reply (Respond to Webhook): sends the response back to the webhook caller
…plus 1 more step. See the full node list below.
Before you upgrade to n8n 3.0
Nothing in this workflow is removed in n8n 3.0, so it should import and run after the upgrade.
- Code node: the task timeout drops from 300s to 60s. Test with a realistic data volume.
Nodes used (7)
- Schedule Trigger
n8n-nodes-base.scheduleTrigger - Webhook
n8n-nodes-base.webhook - Edit Fields (Set)
n8n-nodes-base.set - Code
n8n-nodes-base.code - If
n8n-nodes-base.if - Respond to Webhook
n8n-nodes-base.respondToWebhook - HTTP Request
n8n-nodes-base.httpRequest
From the author
Quick overview On a schedule or on demand, this workflow pulls a day's orders, revenue, new tickets and first-response time from two REST APIs, compares them with the day before, writes a Markdown report and logs alerts when thresholds are crossed. A failed…