Weekly HubSpot deal recap posted to Slack every Friday

By General Input

Every Friday at 4pm, roll up the week's HubSpot deal activity into a plain-English recap and post it to your leadership Slack channel.

Integrations

  • HubSpot
  • Groq
  • Slack Bot

Type

Deterministic Code

Categories

  • Sales

Every Friday at 4pm local time, a cron trigger kicks off a weekly deal-motion recap for our leadership team. This is a deterministic pipeline: fixed query, fixed grouping logic, one LLM formatting step, one Slack post.

Step 1 (HubSpot Search Deals). Call HubSpot's Search Deals with a filter on hs_lastmodifieddate greater than 7 days ago. Request these properties: dealname, dealstage, amount, hubspot_owner_id, closedate, createdate, hs_lastmodifieddate, plus any custom "won reason" and "lost reason" properties the account has. Resolve owner names by calling Get Owner (or batching them) on the returned hubspot_owner_id values.

Step 2 (group in code, deterministically). Sort the returned deals into five buckets:

• New deals created — createdate falls within the last 7 days.

• Deals that advanced stages — dealstage changed in the last 7 days and the new stage sits later in the pipeline than the previous one.

• Deals won — dealstage is closedwon and closedate is within the last 7 days. Include the won-reason field if present.

• Deals lost — dealstage is closedlost and closedate is within the last 7 days. Include the lost-reason field if present.

• Deals stalled — no modification in >7 days AND closedate is in the past.

For every deal in every bucket include: deal name, amount, owner name, current stage, close date, and the relevant reason field where applicable. Also compute per-bucket count and total amount.

Step 3 (Groq Create Chat Completion). Send the grouped payload to Groq using the llama-3.3-70b model (versatile variant is fine) with a fixed prompt template that outputs a written narrative in the same structure every single week. The system message locks the format so week-over-week diffs are readable at a glance. Target output shape:

*Deal recap — week of [start] to [end]*

*Won this week:* [N] deals, $[total] — [name, owner, amount, reason for each]

*Lost this week:* [N] deals, $[total] — [name, owner, amount, reason]

*Advanced:* [N] deals — [name, owner, old stage → new stage, amount]

*New:* [N] deals, $[total] — [name, owner, amount, stage]

*At risk (stalled past expected close):* [N] deals, $[total] — [name, owner, amount, days past close]

Keep the LLM temperature low (0.2 or lower) so the structure stays stable. No branching, no reasoning about what to include — the code decides which deals are in which bucket, Groq only formats.

Step 4 (Slack Bot Send a Message). Post the returned markdown to a configurable leadership Slack channel via the Slack Bot Send a Message operation. Slack mrkdwn (single-asterisk bold) is what the LLM should emit, so the recap lands with proper formatting.

Handle empty weeks gracefully: if all buckets are empty, still post a short "Quiet week — no closed or advanced deals" note rather than skipping.

Related prompts

Explore more prompts
A brand asset library your marketing team actually searchesTurn Mailjet email clicks into ranked HubSpot follow-upsClean out the Looker dashboards and Looks nobody opensLiveKit live operations console for room moderationWake up dormant Keap leads with a researched reasoniMessage campaign console with pre-flight checks and delivery boardLiveChat coverage board for planning next week's shiftsPhone routing control panel for LiveKit voice agentsA searchable RFP answer library your bid team drafts fromLinkedIn Ads budget pacing dashboard for every client account