Every Monday, posts the week's new HubSpot leads to Slack: how many, how that compares to last week, and who they are.
Uses
HubSpot
Slack
Weekly HubSpot lead report to Slack
Every Monday at 07:00, the contacts created in HubSpot over the last seven days are read and posted to Slack as a single report, so the team starts the week knowing whether the funnel moved without opening a dashboard. A second search counts the week before, for the comparison.
The report leads with how many contacts were created and whether that is up, down or level on the week before, by how many and by what percentage. Under it sits the split by lifecycle stage and by original source, then the newest leads named individually with title, company and email so a rep can pick one up straight away. Duplicates are dropped and each contact's creation date is re-checked against the week, so a stray record cannot land in the counts. The headline count comes from HubSpot's own total, so it stays right however many leads there were, and the report says so if not every contact could be pulled back.
You need HubSpot and Slack connected, and the ID of the Slack channel the report goes to.
slackChannelId to blank.Set slackChannelId to blank.leadLimit to 500.Set leadLimit to 500.maxNamed to 12.Set maxNamed to 12.weekStart.Get the date 7 days before the current date and time and save it as weekStart.weekStart and save it as priorWeekStart.Get the date 7 days before weekStart and save it as priorWeekStart.weekStart. Save it as newLeads.Find contacts created since weekStart. Save it as newLeads.priorWeekStart. Save it as priorLeads.Find contacts created since priorWeekStart. Save it as priorLeads.newLeadCount to newLeads.total.Set newLeadCount to newLeads.total.leadChange to newLeadCount minus priorLeads.total.Set leadChange to newLeadCount minus priorLeads.total.leadChange and save it as leadSwing.Calculate the absolute value of leadChange and save it as leadSwing.percentNote to blank.Set percentNote to blank.priorLeads.total is greater than 0If priorLeads.total is greater than 0swingRatio to leadSwing divided by priorLeads.total.Set swingRatio to leadSwing divided by priorLeads.total.swingRatio as a percentage with 0 decimal places and save it as swingPercent.Format swingRatio as a percentage with 0 decimal places and save it as swingPercent.percentNote to (swingPercent).Change percentNote to (swingPercent).momentum to level with the week before.Set momentum to level with the week before.leadChange is greater than 0If leadChange is greater than 0momentum to up leadSwing@percentNote on the week before.Change momentum to up leadSwing@percentNote on the week before.momentum to down leadSwing@percentNote on the week before.Change momentum to down leadSwing@percentNote on the week before.contacts, window_start, max_named, has_more, and total_count and save it as digest.Run Python code on contacts, window_start, max_named, has_more, and total_count and save it as digest.weekStart readable as “November 2, 2026” and save it as weekLabel.Make weekStart readable as “November 2, 2026” and save it as weekLabel.*New HubSpot leads, week of @weekLabel* @newLeadCount new contacts, @momentum. @digest.body and save it as reportText.Build the text *New HubSpot leads, week of @weekLabel* @newLeadCount new contacts, @momentum. @digest.body and save it as reportText.slackChannelId. Save it as posted.Send a message to slackChannelId. Save it as posted.reportText