Launch Customer.io onboarding when a HubSpot deal closes won

By General Input

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.

Integrations

  • HubSpot
  • Customer.io
  • Slack

Type

Agentic Task

Categories

  • Sales
  • Marketing

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.

Related prompts

Explore more prompts
Call overdue Xero customers with an AI collections agentWin back LiveChat visitors whose chats went unansweredTurn Mailjet email clicks into ranked HubSpot follow-upsiMessage campaign console with pre-flight checks and delivery boardChat quality review board for LiveChat support leadsA searchable RFP answer library your bid team drafts fromSee which target accounts just started advertising on LinkedInAccount health board that puts product usage next to your CRMLook up a customer's full chat history mid conversationLusha prospecting workbench with credit-safe reveals