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).

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.

FAQs

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

Log Agorapulse social conversations to HubSpot contacts

Twice every weekday, the conversations from your social inbox land on the right HubSpot contact timelines, with a Slack recap for sales.

Agorapulse
HubSpot
Slack Bot
Agentic Task
Turn procurement portal tenders into CRM deals each morning

Every weekday at 7am, sign in to the tender portals you track, filter new notices against your bid criteria, and open a deal for the ones worth chasing.

Anchor Browser
Google Sheets
HubSpot
+1
Agentic Task
Clean up HubSpot contacts from your Amazon SES suppression list

Every morning, find the addresses that hard bounced or filed a spam complaint, update the matching HubSpot contacts, and post a short Slack recap.

Amazon SES
HubSpot
Slack Bot
Agentic Task
Provision customer entitlements in DynamoDB when a deal is won

When a HubSpot deal hits Closed Won, the customer's plan, seats and renewal dates land in your DynamoDB accounts table, with a Slack note showing what changed.

HubSpot
Amazon DynamoDB
Slack Bot
Agentic Task
Raise a Zoho Books invoice the moment a HubSpot deal is won

When a deal moves to closed won in HubSpot, we find or create the customer in Zoho Books, draft the invoice, and tell finance in Slack.

HubSpot
Zoho Books
Slack
Deterministic Code
File win-loss survey feedback on the right HubSpot deal

The moment someone finishes your win-loss survey, their answers land as a short note on the deal they belong to, not in a dashboard nobody opens.

SurveyMonkey
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.