Post a custom deal-won celebration card in Slack
Every time a HubSpot deal closes won, generate a branded celebration card with the customer name and amount, then drop it into your wins channel.
Build a code workflow that posts a personalized celebration card to our #wins Slack channel every time a HubSpot deal closes won. The whole chain is deterministic: webhook in, three CRM fetches, one image generation, one file upload, one message. Use these integrations: HubSpot, Generate Image, Slack.
Trigger: a HubSpot webhook for deal property changes, filtered to deal stage transitions where the new stage is closed-won (the closed-won stage in the deal's pipeline). The webhook payload gives us the deal id.
Step 1 - HubSpot Get Deal: fetch the deal by id and request the properties dealname, amount, dealstage, pipeline, closedate, and hubspot_owner_id, plus associations to companies and contacts.
Step 2 - HubSpot Get Company: take the first associated company id from step 1 and fetch it, requesting properties name, domain, and industry.
Step 3 - HubSpot Get Contact: fetch the deal owner if hubspot_owner_id is set (use the owners endpoint to resolve the owner's name and email), otherwise fall back to the first associated contact id from step 1 and fetch it with properties firstname, lastname, and email.
Guard rail: if any of the three lookups returns null or the deal has no associated company, the workflow should no-op cleanly and exit without posting anything. Do not generate a half-personalized card.
Step 4 - Generate Image: call Generate an Image with aspect ratio 16:9. Keep the prompt structure stable across runs so every card feels like part of one consistent series. Template: a celebratory branded card that prominently displays the company name from step 2, the deal name from step 1, and the closing amount from step 1 formatted as a currency value. Use a clean modern style with confetti or rising-line motifs, our brand colors, large readable typography, no stock-photo people, and leave whitespace for Slack feed display. The image comes back as imageBase64 plus mimeType.
Step 5 - Slack Upload a File: decode the base64 image and upload it into the #wins channel using Slack's 3-step upload flow (files.getUploadURLExternal then upload bytes then files.completeUploadExternal). Filename should include the company name and the date so files are searchable.
Step 6 - Slack Send a Message: post a short caption to #wins as a follow-up message that tags the deal owner by Slack user (look up their Slack user id by matching the HubSpot owner email to a Slack user via users.lookupByEmail). Caption template: a one-line congrats that includes the customer company name, the deal name, the amount, and an @-mention of the owner. Keep it punchy and on-brand, two sentences max.
Make the channel name (#wins) and the brand styling in the image prompt easy to edit at the top of the workflow so the team can tweak them without touching the rest of the code. Log each step with the deal id so failures are easy to trace.
Additional information
What does this prompt do?
- Watches HubSpot for any deal that moves to closed-won and kicks off automatically.
- Pulls the company, the deal details, and the deal owner so the card is fully personalized.
- Generates a fresh 16:9 celebration graphic with the customer name, deal name, and closing amount.
- Posts the card into your wins channel in Slack with a short caption that tags the rep who closed it.
What do I need to use this?
- A HubSpot account where you can turn on a webhook for deal stage changes.
- A Slack workspace and a channel for sharing wins (for example #wins).
- Permission to connect both accounts to General Input.
How can I customize it?
- Change the Slack channel, or fan out to multiple channels for different segments.
- Tweak the visual style of the card so every win looks like part of one consistent series.
- Adjust the caption template, including who gets tagged and what extra context shows up.
- Choose which deal pipelines or amount thresholds qualify for a celebration card.
Frequently asked questions
Does this work for every deal that closes, or only certain ones?
What happens if a deal is missing a company or contact?
Can I change the look of the celebration card?
Will the deal owner get tagged in Slack?
Can I post into more than one Slack channel?
Make every closed-won feel like a moment.
Connect HubSpot and Slack once, and every deal that closes turns into a custom card in your wins channel automatically.