Launch Customer.io onboarding when a HubSpot deal closes won
The moment a HubSpot deal flips to closed won, add the new customer to Customer.io, fire the right onboarding sequence by plan, and post the win to Slack.
Build an agent workflow that hands off a closed-won HubSpot deal to Customer.io for onboarding and posts the win in Slack.
Trigger: HubSpot webhook subscribed to deal property changes, filtered so the agent only runs when a deal's stage moves to Closed Won. The webhook payload gives the agent the deal id, the new stage, the deal amount, the owner id, and the primary contact id.
What the agent should do, in order:
1) Pull the buyer from HubSpot. Use HubSpot Get Contact on the primary contact id from the deal. Read the email, first name, last name, company name, and the custom plan_tier property (values like self_serve or enterprise). If the deal has no primary contact, skip steps 2 to 4 and still do step 5 so the team sees the win and knows to do a manual handoff.
2) Upsert the customer in Customer.io. Call Customer.io Identify Person using the contact's email as the identifier. Set traits: email, first_name, last_name, company, plan_tier, deal_amount (number), account_owner_email (HubSpot owner's email), and became_customer_at (current ISO timestamp). These traits are what existing onboarding journeys branch on, so do not rename them without checking.
3) Fire the lifecycle event. Call Customer.io Track Event with event name became_customer for the same person. Include the same plan_tier and deal_amount in the event properties so any journey already waiting on this event can branch on them.
4) Trigger the right onboarding broadcast. Decide which API-triggered broadcast to fire based on plan_tier: a self-serve onboarding broadcast for self_serve plans, an enterprise onboarding broadcast for enterprise plans, and a sensible default for anything else. Call Customer.io Trigger Broadcast with the chosen broadcast id, the contact as the single recipient (by email), and personalization data (first_name, company, account_owner_email, deal_amount). Remember Customer.io's broadcast trigger rate limit is one call per ten seconds per broadcast, so do not retry tightly.
5) Post the win in Slack. Call Slack Send a Message to the wins channel (default: #wins, but make this configurable). Format it for celebration: company name, plan tier, deal amount formatted as currency, the account owner's name, and a short congrats line. Use Slack mrkdwn, not standard markdown.
Agent reasoning lives in two places: picking the correct onboarding broadcast for the plan tier (and falling back gracefully when plan_tier is missing or unrecognized), and writing the celebratory Slack post so it sounds human, not templated.
Inputs the user should configure: the HubSpot pipeline and the exact stage label that counts as Closed Won, the name of the plan tier custom property on deals, the Customer.io broadcast id for each plan tier, the Slack channel for wins, and which HubSpot owner field to use for account_owner_email.
Error handling: if Customer.io returns a non-2xx response on Identify, Track, or Trigger Broadcast, log it and still attempt the Slack post so the team is not blind to the win. If the Slack post fails, raise so the user notices, since silent failure on the visible step is worse than a noisy retry.
Additional information
What does this prompt do?
- Watches HubSpot for deals that move to Closed Won and uses each one as a trigger to start onboarding.
- Adds the buyer to Customer.io with their plan tier, deal size, and account owner so journeys can branch on real values.
- Fires a became_customer event and kicks off the matching onboarding broadcast (self-serve vs enterprise) so the right sequence runs.
- Posts a celebratory note to a wins channel in Slack with the deal amount, plan, and owner so the team sees the handoff happen.
What do I need to use this?
- A HubSpot account where deals move through a stage called Closed Won.
- A Customer.io workspace with onboarding broadcasts already set up for each plan you sell.
- A Slack workspace and the name of the channel that should get the wins post.
How can I customize it?
- Swap which onboarding broadcast fires for each plan tier, or add tiers (free trial, mid-market, enterprise) with their own broadcasts.
- Change which deal fields get sent to Customer.io as traits, like industry, contract length, or referral source, so journeys can personalize on them.
- Pick a different Slack channel for the wins post, or change the tone and what data the message includes.
Frequently asked questions
Does it run automatically the moment a deal closes?
What if I have more than two plan tiers?
Will it work if my onboarding journey already listens for an event?
What if the deal does not have a primary contact?
Can I send the win to a private channel?
Stop dropping new customers between sales and onboarding.
Connect HubSpot, Customer.io, and Slack once, and every closed-won deal kicks off the right onboarding sequence with the team in the loop.