Re-engage closed lost HubSpot deals with Reply.io sequences

When a HubSpot deal moves to Closed Lost, an agent decides if the contact is worth winning back and enrolls them in the right Reply.io sequence.

Agentic Task
HubSpotReply.ioSalesMarketingEmail AutomationLead Enrichment
PromptCreate

Build me an agent workflow that turns closed lost HubSpot deals into smart Reply.io re-engagement enrollments. The trigger is a HubSpot webhook firing when a deal's stage property changes. I will configure HubSpot to send the webhook to General Input when the dealstage property changes on any deal.

When the webhook fires, the agent should do the following:

1. Read the deal ID from the webhook payload and use HubSpot's Get Deal to fetch the deal with its properties (dealstage, closed_lost_reason, amount, dealname, industry, notes_last_updated) and its associated contact IDs. Only proceed if the new stage matches one of the stages I designate as worth revisiting (default: Closed Lost, but I want to be able to list other stage IDs in the agent instructions). If the stage is not on the list, exit silently.

2. Identify the primary contact on the deal. Use HubSpot's Get Deal with associations=contacts to pull the contact IDs, then look up that contact's properties (email, firstname, lastname, industry, persona or jobtitle, and a custom property called re_engagement_enrolled_at) so we know who they are.

3. Idempotency check. If re_engagement_enrolled_at is already set on the contact, do not re-enroll. Skip the rest of the workflow but still write a short HubSpot note on the deal saying we declined to re-enroll because this contact was already added to a re-engagement sequence on that date.

4. Judgment call. Read the closed_lost_reason and any recent engagement notes on the deal. If the lost reason is "not a fit", "competitor won", "do not contact", or "unqualified", skip Reply.io enrollment entirely. Use HubSpot's Create Note to add a note on the deal that says we declined re-enrollment, and include the lost reason verbatim. Stop here.

5. Pick the sequence. Otherwise, use Reply.io's List Sequences to fetch active sequences and match by name to the contact's industry or persona. The agent should use its judgment based on the sequence name (e.g. an "SMB Win-Back" sequence for SMB personas, an "Enterprise Re-engagement" sequence for enterprise, an industry-named sequence when the contact's industry matches). If no sequence matches confidently, fall back to a default sequence whose name I will provide in the agent instructions.

6. Enroll. Use Reply.io's Search Contacts by Email to check whether the contact already exists in Reply.io. If they do, use Add Contact to Sequence with the contact ID. If not, use Add Contact to Sequence with the email, first name, last name, and company so Reply.io creates the contact and enrolls them in one call.

7. Stamp the contact. Use HubSpot's Update Contact on the contact ID to set re_engagement_enrolled_at to the current ISO timestamp, so future stage edits on the same deal do not re-enroll them. (I will create this custom contact property in HubSpot ahead of time.)

8. Log the decision. Use HubSpot's Create Note to write a note on the deal that explains which Reply.io sequence the contact was enrolled in, why that sequence was chosen, and a link to the contact. Keep the note short and human-readable so the deal owner can see exactly what happened.

Error handling: if Reply.io returns 409 (contact already in sequence), treat that as a soft success, still stamp the contact and write the note. If any HubSpot or Reply.io call fails after retries, write a note on the deal explaining the failure so a human can finish the enrollment manually.

Integrations: HubSpot (webhook trigger, Get Deal, Search Contacts, Update Contact, Create Note) and Reply.io (List Sequences, Search Contacts by Email, Add Contact to Sequence).

Additional information

What does this prompt do?
  • Watches your HubSpot deals and reacts the moment one moves to Closed Lost or any other stage you flag as worth revisiting.
  • Reads the lost reason and recent activity, then makes a judgment call about whether the contact is a real fit for re-engagement.
  • Picks the right Reply.io win-back sequence based on the contact's industry or persona and enrolls them, creating the Reply.io contact if needed.
  • Writes a note back on the HubSpot deal explaining which sequence the contact was added to and why, or why you decided to skip them.
What do I need to use this?
  • A HubSpot account with permission to read deals and contacts and to write notes and contact properties.
  • A Reply.io account with at least one re-engagement sequence built and ready to enroll contacts in.
  • A custom contact property in HubSpot to stamp when someone has been enrolled, so the same deal does not re-enroll on later edits.
How can I customize it?
  • Change which deal stages count as worth revisiting. Closed Lost is the default, but you can include long-stalled or nurture stages too.
  • Tune the rules for skipping. Common skips are lost reasons like not a fit, competitor won, or do not contact.
  • Add more sequences and let the agent pick by industry, persona, deal size, or how recently the deal closed.

Frequently asked questions

Will the same deal get re-enrolled every time someone edits it?
No. Once a contact is enrolled, the agent stamps a re-engagement date on their HubSpot contact record and uses that to skip them on any future updates to the same deal.
What happens to contacts you decide not to re-engage?
The agent writes a note on the deal explaining why it skipped them, for example the lost reason was competitor won or not a fit. Nothing is added to Reply.io.
Can I use this for stages other than Closed Lost?
Yes. You can point it at any stage you treat as worth revisiting later, like long-stalled deals, nurture, or disqualified. Just tell the agent which stages to watch.
What if the contact does not exist in Reply.io yet?
The agent creates the Reply.io contact using the email and name from HubSpot, then adds them to the right sequence in one pass.
How does the agent decide which sequence to use?
It reads the contact's industry or persona from HubSpot and matches it to your sequence names. You can describe your own routing rules in plain language and the agent will follow them.

Related templates

Screen new HubSpot contacts for data breach exposure

The moment a new contact lands in HubSpot, we check their email against known data breaches and flag the high-risk ones so your team can act fast.

Have I Been Pwned
HubSpot
Slack Bot
Agentic Task
Enrich and prioritize new Help Scout tickets in Slack

The moment a new Help Scout conversation arrives, we check the customer in your CRM, flag high-value accounts, and post a priority alert to Slack before anyone touches it.

Help Scout
HubSpot
Slack Bot
Agentic Task
Screen new HubSpot companies against Companies House

Every time a new company lands in HubSpot, we look it up on the UK register, save a due-diligence summary to the record, and alert your team to any red flags.

HubSpot
Companies House
Slack Bot
Agentic Task
Turn newly incorporated UK companies into HubSpot leads

Each weekday morning, spot UK companies registered the day before in your target sectors, add the best fits to HubSpot, and recap them in Slack.

Companies House
HubSpot
Slack Bot
Agentic Task
Keep Gladly customers in sync with new HubSpot contacts

Every time you add a contact in HubSpot, we automatically create or update their Gladly profile so support always sees up-to-date customer details.

Gladly
HubSpot
Deterministic Code
Screen new HubSpot companies for security risk with Censys

Every morning we scan each new company's domain, rate its external security exposure, log the findings to the CRM record, and alert your team when a vendor looks risky.

Censys
HubSpot
Slack Bot
Agentic Task

Stop letting good lost deals go cold.

Connect HubSpot and Reply.io once, and every closed lost deal gets a fair shot at a second touch, with the judgment call written right on the record.