Overview
The Weekly Digest workflow automatically compiles and sends a comprehensive summary of feedback activity to your team’s Slack channel. It provides a weekly snapshot of new feature requests, customer feedback, and product area metrics to keep stakeholders informed without manual reporting.Located at:
apps/www/src/workflows/weekly-digest/index.tsPurpose
This workflow solves the communication challenge of keeping teams updated on feedback trends. By automatically generating and sending weekly digests, it:- Highlights top product areas with the most activity
- Showcases new feature requests created in the past week
- Surfaces recent customer feedback from key accounts
- Provides product area metrics in a threaded breakdown
Trigger Conditions
The workflow is triggered by:- Scheduled cron job: Weekly (typically Monday mornings)
- Manual invocation: Via API or admin interface for on-demand digests
Cron Configuration
Execution Steps
Calculate Date Range
Determines the 7-day window for the digest:This ensures the digest covers exactly the last 7 days, regardless of when it runs.
Fetch Recent Requests
Queries the database for new feature requests:Returns requests with creator information for attribution.
Fetch Recent Feedback
Queries for new customer feedback (unique by account):Includes account names and associated request details for context.
Aggregate Product Area Metrics
Calculates activity metrics for each product area:Returns array of areas with:
- Request count
- Feedback count
- Area name and slug
- Sorted by total activity
Send Main Digest Message
Composes and sends the primary Slack message:The message includes:
- Header with date range
- Top 3 product areas with activity
- New feature requests with links
- Recent customer feedback
ts) for threading.Send Area Metrics in Thread
Posts detailed metrics as a thread reply:Provides a complete breakdown of all product areas, keeping the main message concise.
Code Example
Invoking the Workflow
Example Slack Message Format
The workflow generates a Slack message like:Workflow Steps Reference
getRecentRequests
getRecentRequests
Purpose: Fetch recently created feature requestsLocation:
apps/www/src/workflows/weekly-digest/steps/get-recent-requests.tsImplementation:getRecentFeedback
getRecentFeedback
Purpose: Fetch recent customer feedback, unique by accountLocation:
apps/www/src/workflows/weekly-digest/steps/get-recent-feedback.tsKey feature: Groups by account to show diverse customer feedback rather than multiple entries from the same accountReturns: Feedback entries with account and request detailsgetProductAreaMetrics
getProductAreaMetrics
Purpose: Calculate activity metrics for all product areasLocation:
apps/www/src/workflows/weekly-digest/steps/get-product-area-metrics.tsImplementation:- Queries all product areas
- For each area, counts requests and feedback in date range
- Sorts by total activity (requests + feedback)
sendSlackDigestMessage
sendSlackDigestMessage
Purpose: Send the main digest message to SlackLocation:
apps/www/src/workflows/weekly-digest/steps/send-slack-digest-message.tsFeatures:- Formats dates as “Nov 25 - Dec 2”
- Includes clickable links to requests and areas
- Uses custom Slack emojis (
:gtm-feedback-feedback-icon:) - Returns message timestamp for threading
sendSlackProductAreaMetrics
sendSlackProductAreaMetrics
Purpose: Send detailed area breakdown as thread replyLocation:
apps/www/src/workflows/weekly-digest/steps/send-slack-product-area-metrics.tsImplementation: Posts to the thread using thread_ts parameter, showing all areas with their individual metricsConfiguration
Environment Variables
Customizing Content
Adjust Item Limits
Modify the limit parameters in the workflow:Change Date Range
Modify the date calculation:Customize Message Format
Edit the message template insend-slack-digest-message.ts:
Error Handling
The workflow fails fast on critical errors:- Failed digests are retried by the workflow runtime
- Teams are alerted if digests stop sending
- No partial digests (main message without thread) are posted
Performance Considerations
Query Optimization
All data fetching steps run in sequence (not parallel) to avoid overwhelming the database:- 8 product areas
- 100+ requests
- 500+ feedback entries
Scalability
For very large datasets, consider:- Add indexes on
createdAtcolumns - Cache area metrics if the calculation is slow
- Batch process areas in chunks if there are 20+ areas
Monitoring & Debugging
Add logging to track digest generation:Related
Slack Integration
Learn about Slack app setup and configuration
Analytics & Insights
Understand product area metrics
Feature Requests
Learn about request management
Workflows Concept
Deep dive into workflow architecture