๐Ÿ“Š Daily Report Generation

Every morning when you open your messaging app, a well-organized business report is waiting for you. This is Daily Report Automationโ€”let Rose collect data, analyze trends, and format it into an easy-to-read format.


Scenario Description

Use Cases

ScenarioReport Content
๐Ÿ›’ E-commerce OperationsYesterdayโ€™s revenue, order count, top-selling products
๐Ÿ“ฑ App OperationsActive users, new users, retention rate
๐ŸŒ Website ManagementPage views, popular pages, traffic sources
๐Ÿ’ฐ Financial ManagementIncome/expense details, cash flow, accounts receivable
๐Ÿ“Š Marketing TrackingAd performance, conversion rate, ROI

Expected Results

  • โฐ Save Time: No need to manually log into various platforms daily
  • ๐Ÿ“ˆ Stay Informed: Know yesterdayโ€™s business status first thing in the morning
  • ๐ŸŽฏ Quick Decisions: Easier to spot trends when data is consolidated
  • ๐Ÿ“ฑ Anywhere Access: View reports on your mobile device

Data Source Integration

Common Data Sources

Source TypeAccess MethodDifficulty
Google AnalyticsAPI integrationโญโญ
DatabaseSQL queriesโญโญโญ
SpreadsheetsGoogle Sheets APIโญโญ
Third-party PlatformsREST APIโญโญโญ
CSV/JSON FilesFile readingโญ

Data Integration Flow

โ”Œโ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”    โ”Œโ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”    โ”Œโ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”
โ”‚  Data Source โ”‚ โ†’ โ”‚  Data Collection โ”‚ โ†’ โ”‚  Data Processing โ”‚
โ”œโ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”ค    โ”œโ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”ค    โ”œโ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”ค
โ”‚ โ€ข GA4        โ”‚    โ”‚              โ”‚    โ”‚              โ”‚
โ”‚ โ€ข Database   โ”‚    โ”‚ Rose executesโ”‚    โ”‚ โ€ข Aggregate  โ”‚
โ”‚ โ€ข API        โ”‚    โ”‚ queries/callsโ”‚    โ”‚ โ€ข Calculate  โ”‚
โ”‚ โ€ข Files      โ”‚    โ”‚              โ”‚    โ”‚ โ€ข Analyze    โ”‚
โ””โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”˜    โ””โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”˜    โ””โ”€โ”€โ”€โ”€โ”€โ”€โ”ฌโ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”˜
                                               โ”‚
                                               โ–ผ
                                        โ”Œโ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”
                                        โ”‚  Generate Report โ”‚
                                        โ”œโ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”ค
                                        โ”‚ โ€ข Format     โ”‚
                                        โ”‚ โ€ข Visualize  โ”‚
                                        โ”‚ โ€ข Send       โ”‚
                                        โ””โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”˜

Report Format Design

Basic Report Structure

{`# ๐Ÿ“Š Daily Business Report
**Date:** 2026-03-21
**Generated:** 08:00

---

## ๐Ÿ“ˆ Key Metrics

| Metric | Yesterday | Day Before | Change |
|------|------|------|------|
| Revenue | $50,000 | $45,000 | +11% ๐ŸŸข |
| Orders | 120 | 110 | +9% ๐ŸŸข |
| Avg Order Value | $417 | $409 | +2% ๐ŸŸข |
| Visitors | 2,500 | 2,800 | -11% ๐Ÿ”ด |

---

## ๐Ÿ† Yesterday's Highlights

- Revenue hit weekly high
- New product "XXX" performed well (sold 30 units)

---

## โš ๏ธ Attention Needed

- Visitors decreased 11%, recommend checking traffic sources
- Cart abandonment rate slightly high (65%)

---

## ๐Ÿ“‹ Today's Tasks

- [ ] Follow up on yesterday's incomplete orders
- [ ] Check inventory levels
- [ ] Reply to customer feedback

---

๐Ÿ’ก *This report was automatically generated by Rose*`}

Report Design Principles

PrincipleDescriptionExample
Key Points FirstMost important data at the topKey metrics table
Clear ComparisonCompare with previous day/weekChange percentage + color indicators
VisualUse emoji and tables๐ŸŸข Growth ๐Ÿ”ด Decline
Action-OrientedProvide next step recommendationsTodayโ€™s task list

Auto-Send Configuration

Using Cron Scheduling

{`# Generate and send report every day at 8 AM
0 8 * * * cd /home/node/.openclaw/workspace && node scripts/daily-report.js

# Send weekly report every Monday at 8 AM
0 8 * * 1 cd /home/node/.openclaw/workspace && node scripts/weekly-report.js

# Send monthly report on the 1st at 8 AM
0 8 1 * * cd /home/node/.openclaw/workspace && node scripts/monthly-report.js`}

Report Generation Script Example

{`// Daily report generation script

const { getGA4Data } = require('./apis/google-analytics');
const { queryDatabase } = require('./apis/database');
const { sendTelegramMessage } = require('./apis/telegram');

async function generateDailyReport() {
  const today = new Date();
  const yesterday = new Date(today);
  yesterday.setDate(yesterday.getDate() - 1);
  
  // Collect data
  const [gaData, orderData] = await Promise.all([
    getGA4Data(yesterday),
    queryDatabase('
      SELECT COUNT(*) as orders, SUM(total) as revenue
      FROM orders
      WHERE DATE(created_at) = DATE(?)
    ', [yesterday])
  ]);
  
  // Calculate changes
  const prevDayData = await getPrevDayData(yesterday);
  const changes = calculateChanges(orderData, prevDayData);
  
  // Generate report content
  const report = formatReport({
    date: formatDate(yesterday),
    revenue: orderData.revenue,
    orders: orderData.orders,
    visitors: gaData.activeUsers,
    changes: changes
  });
  
  // Send report
  await sendTelegramMessage({
    chat_id: process.env.ADMIN_CHAT_ID,
    text: report,
    parse_mode: 'Markdown'
  });
  
  console.log('โœ… Report sent');
}

generateDailyReport().catch(console.error);`}

Using Heartbeat Checks

{`# Heartbeat task list

## Daily Report Check

Time: Every day 08:00
Tasks:
1. Check if report was sent successfully
2. Check if data is complete
3. Notify admin immediately if any anomalies

## Data Source Health Check

Time: Every day 06:00
Tasks:
1. Check GA4 API connection
2. Check database connection
3. Check spreadsheet permissions
4. Record check results`}

Advanced Applications

Multi-Platform Report Integration

{`# ๐Ÿ“Š Daily Multi-Platform Report

## ๐Ÿ›’ E-commerce Platforms
| Platform | Revenue | Orders | Status |
|------|--------|--------|------|
| Website | $30,000 | 75 | ๐ŸŸข |
| Shopee | $15,000 | 35 | ๐ŸŸข |
| Momo | $5,000 | 10 | ๐ŸŸก |

## ๐Ÿ“ฑ Social Media
| Platform | Followers | Engagement | New Posts |
|------|--------|--------|----------|
| FB | 5,200 | 3.2% | 2 |
| IG | 3,800 | 4.1% | 3 |
| LINE | 2,100 | 12% | 1 |

## ๐Ÿ“ง Newsletter
- Sent: 1,500
- Open Rate: 25%
- Click Rate: 3.5%

Total: Revenue $50,000 | Total Orders 120 | Total Visitors 2,500`}

Anomaly Detection & Alerts

{`# Anomaly detection settings

alerts:
  revenue_drop:
    condition: "revenue < yesterday_revenue * 0.7"
    message: "๐Ÿšจ Revenue dropped more than 30% from yesterday"
    priority: high
    
  order_spike:
    condition: "orders > avg_orders * 2"
    message: "๐Ÿ“ˆ Order spike detected, please ensure sufficient inventory"
    priority: medium
    
  zero_sales:
    condition: "revenue == 0"
    message: "โš ๏ธ No sales today, please check system status"
    priority: high
    
  traffic_drop:
    condition: "visitors < yesterday_visitors * 0.5"
    message: "๐Ÿ”ด Traffic dropped abnormally, please check website"
    priority: high`}

Report Archive Management

{`#!/bin/bash
# Report archive script

REPORT_DIR="/reports/daily"
ARCHIVE_DIR="/reports/archive"
DATE=$(date +%Y%m%d)

# Create monthly directory
MONTH_DIR="$ARCHIVE_DIR/$(date +%Y-%m)"
mkdir -p "$MONTH_DIR"

# Move last month's reports to archive
find "$REPORT_DIR" -name "report-*.md" -mtime +30 -exec mv {} "$MONTH_DIR/" \;

# Delete archives older than 3 months
find "$ARCHIVE_DIR" -name "*.tar.gz" -mtime +90 -delete

# Compress last month's archive
if [ "$(date +%d)" == "01" ]; then
    LAST_MONTH="$(date -d 'last month' +%Y-%m)"
    tar -czf "$ARCHIVE_DIR/$LAST_MONTH.tar.gz" -C "$ARCHIVE_DIR" "$LAST_MONTH/"
    rm -rf "$ARCHIVE_DIR/$LAST_MONTH/"
fi

echo "โœ… Report archiving complete"`}

FAQ

Q: What if the report data is inaccurate?

  1. Check data source API permissions
  2. Confirm timezone settings are correct
  3. Validate against original data
  4. Establish data validation mechanisms

Q: Can I customize report timing?

Yes! Modify Cron settings:

  • 8 AM: 0 8 * * *
  • 6 PM: 0 18 * * *
  • Every 4 hours: 0 */4 * * *

Q: Can reports be simplified?

Can set summary mode:

  • Only show key metrics
  • Show detailed info only when anomalies exist
  • Provide โ€œView Full Reportโ€ link

Summary

๐Ÿ“Š Daily Report Generation gives you a complete view of your business every morning:

  • Data Integration: Connect to various platform APIs for automatic data collection
  • Visual Presentation: Tables, emoji, and color indicators for easy reading
  • Auto-Send: Cron scheduling delivers reports to you on time
  • Smart Alerts: Automatic notifications for anomalies so you donโ€™t miss important changes