Every Monday, posts the week's new HubSpot leads to Slack: how many, how that compares to last week, and who they are.

UsesHubSpotSlack

Weekly HubSpot lead report to Slack

ScheduleRun every Monday at 07:00.Run every Monday at 07:00.
ValuesSet slackChannelId to blank.Set slackChannelId to blank.
ValuesSet leadLimit to 500.Set leadLimit to 500.
ValuesSet maxNamed to 12.Set maxNamed to 12.
Dates & TimesGet the date 7 days before the current date and time and save it as weekStart.Get the date 7 days before the current date and time and save it as weekStart.
Dates & TimesGet the date 7 days before weekStart and save it as priorWeekStart.Get the date 7 days before weekStart and save it as priorWeekStart.
HubSpotHubSpotFind contacts created since weekStart. Save it as newLeads.Find contacts created since weekStart. Save it as newLeads.
HubSpotHubSpotFind contacts created since priorWeekStart. Save it as priorLeads.Find contacts created since priorWeekStart. Save it as priorLeads.
ValuesSet newLeadCount to newLeads.total.Set newLeadCount to newLeads.total.
MathSet leadChange to newLeadCount minus priorLeads.total.Set leadChange to newLeadCount minus priorLeads.total.
MathCalculate the absolute value of leadChange and save it as leadSwing.Calculate the absolute value of leadChange and save it as leadSwing.
ValuesSet percentNote to blank.Set percentNote to blank.
Decisions & LoopsIf priorLeads.total is greater than 0If priorLeads.total is greater than 0
Yes
MathSet swingRatio to leadSwing divided by priorLeads.total.Set swingRatio to leadSwing divided by priorLeads.total.
MathFormat 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.
ValuesChange percentNote to (swingPercent).Change percentNote to (swingPercent).
No
No steps
ValuesSet momentum to level with the week before.Set momentum to level with the week before.
Decisions & LoopsIf leadChange is greater than 0If leadChange is greater than 0
Yes
ValuesChange momentum to up leadSwing@percentNote on the week before.Change momentum to up leadSwing@percentNote on the week before.
Else if @leadChange is less than 0
ValuesChange momentum to down leadSwing@percentNote on the week before.Change momentum to down leadSwing@percentNote on the week before.
Otherwise
No steps
CodeRun Python code on 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.
Dates & TimesMake weekStart readable as “November 2, 2026” and save it as weekLabel.Make weekStart readable as “November 2, 2026” and save it as weekLabel.
TextBuild the text *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.
SlackSlackSend a message to slackChannelId. Save it as posted.Send a message to slackChannelId. Save it as posted.reportText