Post a Slack alert when a new HubSpot deal is created
Every time a deal is created in HubSpot, drop a formatted card into your sales Slack channel so the whole team sees the win without anyone announcing it.
Build a code workflow that posts a formatted Slack card to our sales channel every time a new deal is created in HubSpot, so the team gets shared visibility on wins without anyone manually announcing them.
Trigger: incoming webhook from HubSpot on the deal.creation event. The webhook payload includes the deal's objectId, which is what the workflow uses to load the full record.
Steps:
1. Parse the webhook payload and pull out the new deal's objectId.
2. Call HubSpot Get Deal for that objectId. Request the properties dealname, amount, dealstage, pipeline, hubspot_owner_id, and closedate. Include associations to contacts and companies so the primary contact and company come back in the same response.
3. If the deal has an associated company, resolve its name and domain. If it has an associated contact, resolve the contact's first name, last name, and email. If hubspot_owner_id is set, resolve the owner's name and email so the message can credit them.
4. Pick a leading emoji based on the amount band. Default thresholds: under 5,000 is a small deal (use a small emoji like a seedling), 5,000 to 49,999 is mid (use a chart-rising emoji), 50,000 and above is big (use a rocket or money-bag emoji). Make these thresholds easy to edit at the top of the workflow.
5. Format a deterministic Slack message using Block Kit. The card should include: a header line with the band emoji and deal name, the amount formatted with currency and thousands separators, the pipeline stage label, the deal owner's name, the primary contact's name and email, the company name and domain, and a button or link that deep-links to the deal in HubSpot at https://app.hubspot.com/contacts/{portalId}/deal/{dealId}. Fall back gracefully if any of these fields are missing rather than printing 'undefined'.
6. Use Slack Bot Send a Message to post the formatted card to a configurable channel (default to the sales channel ID stored as a workflow variable). Set unfurl_links and unfurl_media to false so the HubSpot link does not balloon the message.
Keep the flow strictly deterministic. No LLM calls. No retries beyond standard transient-error handling. If the HubSpot fetch fails, log and exit cleanly so we do not double-post on retry.
Expose the following as configurable variables: Slack channel ID, currency code (default USD), small/mid/big amount thresholds, and the HubSpot portal ID used to build the deep link.
Additional information
What does this prompt do?
- Listens for HubSpot's deal.creation webhook and fires the moment a new deal is created.
- Loads the full deal from HubSpot with its associated primary contact and company.
- Posts a formatted card to a configurable Slack channel with deal name, amount, stage, owner, contact, company domain, and a deep link back to HubSpot.
- Adds an emoji band by deal size (small, mid, big) so the channel stays skimmable at a glance.
What do I need to use this?
- A HubSpot account with a private app or OAuth connection that includes crm.objects.deals.read, crm.objects.contacts.read, and crm.objects.companies.read.
- A Slack workspace with the Slack Bot integration connected and chat:write (plus chat:write.public if posting to channels the bot has not joined).
- The Slack channel ID where new deal alerts should land (for example, your #sales or #wins channel).
- A HubSpot webhook subscription on the deal.creation event pointed at the workflow's webhook URL.
How can I customize it?
- Change the destination channel, or fan out to multiple channels based on deal owner or pipeline.
- Tune the emoji bands by editing the amount thresholds for small, mid, and big deals.
- Add a filter so only deals above a minimum amount or in a specific pipeline trigger a post.
- Extend the card with extra HubSpot properties like close date, deal type, or source.
Frequently asked questions
Does this work with HubSpot's free tier?
Will the bot post in private channels?
What if the deal has no contact or company associated yet?
Can I prevent test or low-value deals from triggering the alert?
Is this a code workflow or an agent?
Make every new deal a team moment.
Connect HubSpot and Slack once, and Geni posts a clean win card the instant a deal is created.