> ## Documentation Index
> Fetch the complete documentation index at: https://docs.os.default.com/llms.txt
> Use this file to discover all available pages before exploring further.

# Re-engaging closed-lost deals in Salesforce and HubSpot with Default

> Re-engage closed-lost opportunities and deals with Default: a CRM Record Updated trigger on a Salesforce Opportunity or HubSpot Deal with a Time Delay, or an Account Signal or Form Submission trigger, then Match Record to find the closed-lost deal and Send Slack Message to alert the rep who owned it.

Closed lost is the CRM status of a deal your team did not win. In Salesforce it is an Opportunity in
the Closed Lost stage, and in HubSpot it is a Deal in a pipeline's Closed lost stage.

Closed-lost re-engagement brings those deals back to sales when the timing may have changed: some
months after the loss, or when someone from the account shows interest again. In Default, a workflow
notices that moment, **Match Record** finds the closed-lost opportunity or deal in your CRM, and
**Send Slack Message** alerts the rep who worked it.

## Closed-lost re-engagement at a glance

| Play | Trigger | Nodes after the trigger | Result |
| - | - | - | - |
| 1. Revisit a lost deal later | **CRM Record Updated** on the Opportunity or Deal, when its stage changes to closed lost | **Time Delay**, **Match Record**, **Send Slack Message** | The owner hears about the deal again, for example 90 days after the loss. |
| 2. A lost account visits your site | **Account Signal** | **Match Record** for the account, **Match Record** for a closed-lost opportunity, **Send Slack Message** | The owner hears that the account is back on your site. |
| 3. A lost account fills in a form | **Form Submission** | The same 2 **Match Record** nodes, **Send Slack Message**, and optionally **Display Scheduler** | The person reaches the rep who worked the deal. |

The steps below use Salesforce. HubSpot works the same way with Company and Deal, with 1 difference
in how the deal is found. See [Salesforce and HubSpot differences](#salesforce-and-hubspot-differences).

## Setup for closed-lost workflows

| Requirement | Where | Why |
| - | - | - |
| Salesforce or HubSpot connected | **Settings** → **Integrations**. See [Salesforce](/settings/integrations/salesforce) and [HubSpot](/settings/integrations/hubspot). | The triggers and **Match Record** read your opportunities and deals. |
| Slack connected | **Settings** → **Integrations**. See [Slack](/settings/integrations/slack). | **Send Slack Message** sends the alert. |
| Each rep mapped to their CRM user and Slack user | **Settings** → **Users**. See [Users](/settings/users). | Default converts the CRM owner into the Default user, then into their Slack user. |
| For play 2: the Pixel, Clearbit Reveal or Demandbase, and the **Reveal** switch on your key pages | See [Reveal](/forms/reveal). | The **Account Signal** identifies the visitor's company. Each identified visitor uses credits: 1 for Clearbit Reveal, 2 for Demandbase. |
| For play 3: a tracked form | See [Your forms](/forms/your-forms). | **Form Submission** starts the workflow. |

## How a workflow finds a closed-lost opportunity

Default has no closed-lost flag of its own, so the workflow asks your CRM. In Salesforce, a
**Match Record** node on **Opportunity** looks for an opportunity whose Account ID is the account
you matched and whose Stage is `Closed Lost`. **Match** means the account has a closed-lost
opportunity, and later nodes can use its owner, name, and close date. **No Match** means it has none.

The **Account Signal** and **Form Submission** triggers don't know your CRM accounts. The
**Account Signal** carries the visitor's company domain, and a form carries an email. A first
**Match Record** turns either one into the CRM account. See
[Match an account by company domain](/workflows/steps-crm#match-an-account-by-company-domain).

If your CRM already keeps a field on the account for this, for example a checkbox or a last
closed-lost date that a Salesforce flow or HubSpot workflow sets, you can skip the opportunity match
and branch on that field with **Multi-Branch** after you match the account.

## Play 1: revisit a deal some time after it closes lost

This example alerts the opportunity owner 90 days after a Salesforce opportunity closes lost, unless
someone reopened it in the meantime.

<Steps>
  <Step title="Add the trigger">
    In **Workflows**, create a workflow and add **CRM Record Updated**. Set **CRM** to
    **Salesforce** and **Record** to **Opportunity**. Under **Condition**, add 2 conditions joined
    with and: Stage equals `Closed Lost`, and **Fields Updated** **contains any of** Stage. The second condition
    starts the workflow only when the stage changes, not on every later edit to a lost opportunity.
  </Step>

  <Step title="Wait">
    Add **Time Delay** and set it to 90 days. The longest delay you can set is 365 days.
  </Step>

  <Step title="Check that the deal is still lost">
    Add **Match Record**. Set **CRM** to **Salesforce** and **Record** to **Opportunity**. Under
    **Match Details**, match Opportunity ID to the opportunity ID from the trigger, and Stage to
    `Closed Lost`. An opportunity someone reopened during the wait takes **No Match**, and the run
    ends there.
  </Step>

  <Step title="Alert the owner">
    On **Match**, add **Send Slack Message**. Set **Recipients** to the owner of the matched
    opportunity. In **Message**, type `{{` to insert the opportunity name, the account, and the close
    date. To also post to a team channel, set **Slack channels**.
  </Step>

  <Step title="Test and publish">
    A test waits the full delay, so set **Time Delay** to 1 minute while you test. Select **Test**
    and fill in the ID of a test opportunity that is closed lost in Salesforce. The test checks the
    trigger's **Condition**, so also set `StageName` to `Closed Lost` and add `StageName` to the
    `fieldsUpdated` list. Select **Run Test**. When the Slack message arrives, set the delay back to
    90 days and select **Publish**. Check that the status
    next to the [deployment switch](/workflows#the-deployment-switch) reads **Live**. A new workflow
    goes live when you first publish it. If the status reads **Paused**, turn the switch on.
  </Step>
</Steps>

<Note>
  A run that is waiting shows **Suspended** in **Runs** until the delay ends. It keeps the version of
  the workflow it started with: publishing changes doesn't change it, and pausing the workflow stops
  new runs but not runs already waiting. The check after the delay is what keeps a reopened deal from
  sending an alert.
</Note>

To add a contact to a re-engagement sequence instead of alerting the owner, match that contact first,
then add a sequencing node. Each run adds 1 person, so pick 1 contact, for example with
**Match Record** on **Opportunity Contact Role** for the primary contact, then on **Contact** for
their email. See [Send routed leads to sales sequences](/guides/routed-leads-to-sequences).

For a wait longer than 365 days, or a timer your CRM team wants to own, have a Salesforce flow or
HubSpot workflow set a field when the time comes, for example a `Re-engage` checkbox. Then start the
Default workflow with **CRM Record Updated** and a **Fields Updated** condition on that field, and
leave out the **Time Delay**.

## Play 2: alert the owner when a closed-lost account visits your site

This example tells the opportunity owner when someone from an account with a closed-lost
opportunity views your pricing page.

<Steps>
  <Step title="Add the trigger">
    In **Workflows**, create a workflow. Select **Add Node**, then **Triggers**, and choose
    **Account Signal**. Set **Page URL pattern** to `/pricing` and select **Create Trigger**.
  </Step>

  <Step title="Find the account">
    Add **Match Record**. Set **CRM** to **Salesforce** and **Record** to **Account**. Under
    **Match Details**, choose **Website** with the **domain matches** operator, and pick the company
    domain from the trigger.
  </Step>

  <Step title="Look for a closed-lost opportunity">
    On **Match**, add a second **Match Record** with **Record** set to **Opportunity**. Under
    **Match Details**, match Account ID to the ID of the account from the previous node, and Stage to
    `Closed Lost`. Under **Prioritize matched records by**, select **Add tiebreaker** and sort by Close
    Date, **Newest** first, so the most recent loss wins.
  </Step>

  <Step title="Alert the owner">
    On the second node's **Match** branch, add **Send Slack Message**. Set **Recipients** to the owner
    of the matched opportunity, and insert the account name, the page, and the opportunity's close
    date in **Message**. Leave both **No Match** branches empty, or send them to your usual visitor
    workflow. See [Website visitor to outbound](/guides/website-visitor-to-outbound).
  </Step>

  <Step title="Test and publish">
    Select **Test**, fill in the domain of an account that has a closed-lost opportunity, and select
    **Run Test**. Then select **Publish** and check that the status reads **Live**. If it reads
    **Paused**, turn the switch on.
  </Step>
</Steps>

To skip accounts that already have a new deal in progress, add a third **Match Record** on
**Opportunity** for the same account where Stage is any of your open stages. Send the alert only from
its **No Match** branch.

## Play 3: route a returning form submission to the previous owner

1. Start the workflow with **Form Submission** and set **Connected Form** to your form.
2. Add **Match Record** on **Account**. Match **Website** with **domain matches** to the email from
   the form, and choose **Domain from email**.
3. On **Match**, add the closed-lost opportunity **Match Record** from play 2.
4. On its **Match** branch, if the form shows a calendar, add **Display Scheduler**, turn off
   **Use event hosts**, and set the host to the owner of the matched opportunity. Set
   **Fallback Host (Optional)** for when they're away. See
   [Connect a scheduler to your form](/forms/scheduler).
5. Add **Send Slack Message** to the same owner. With a scheduler, put it on the **Booked** and
   **Not booked** branches, so the alert doesn't delay the calendar.
6. Send every **No Match** branch to your usual routing, for example a **Round-Robin** node.

## Salesforce and HubSpot differences

<AccordionGroup>
  <Accordion title="HubSpot: find a closed-lost Deal">
    For play 1, set **CRM** to **HubSpot** and **Record** to **Deal**, with the conditions Deal Stage
    equals your closed lost stage and **Fields Updated** **contains any of** Deal Stage. To check the deal after
    the delay, match the Deal by its Record ID and Deal Stage.

    For plays 2 and 3, match the **Company** by its Company Domain Name with **domain matches**. To
    find the Deal, add **Match Record** on **Deal** and turn on **Match by association**. Set
    **Source record type** to **Company** and **Source record** to the matched company. With
    association on, **Match Details** doesn't apply, so:

    1. Under **Prioritize matched records by**, add **Prefer records where** Deal Stage is your closed
       lost stage, then sort by Close Date, **Newest** first.
    2. Add **Multi-Branch** with a branch where the matched deal's Deal Stage is your closed lost
       stage. Send the alert from that branch, and leave **Else** empty.

    The **Multi-Branch** check matters: a company with no closed-lost deal still matches its other
    deals, and the preference falls back to them.
  </Accordion>

  <Accordion title="Several pipelines or lost stages">
    In HubSpot, each pipeline has its own closed lost stage. Pick the closed lost stage of every
    pipeline you sell through. In Salesforce, if you renamed the lost stage or use more than 1, match
    Closed equals true and Won equals false instead of Stage.
  </Accordion>

  <Accordion title="Lost reasons">
    If you record why a deal was lost, for example HubSpot's Closed Lost Reason property or a custom
    Salesforce field, add a **Multi-Branch** condition on it before the alert. Leave out deals lost for
    reasons that don't change, such as `No fit`.
  </Accordion>

  <Accordion title="How changes reach Default">
    Salesforce pushes opportunity changes to Default as they happen. Default checks HubSpot for updated
    deals every few minutes, so play 1 starts a little later in HubSpot. See
    [How Salesforce changes reach Default](/settings/integrations/salesforce#how-salesforce-changes-reach-default)
    and [How HubSpot changes reach Default](/settings/integrations/hubspot#how-hubspot-changes-reach-default).
  </Accordion>
</AccordionGroup>

## Check that closed-lost re-engagement works

* **Runs**: open the workflow and select **Runs**. Play 1 runs read **Suspended** while they wait.
  Filter by status to see every run still waiting. See [Run logs](/workflows/run-logs).
* **Run Details**: each **Match Record** step shows the condition and the record it matched. Expand
  **Show data** under a step to see the values it read and wrote.
* **Watched fields**: on the Salesforce or HubSpot page in **Settings** → **Integrations**, Opportunity
  or Deal no longer reads **No active triggers** once a play 1 workflow is published.
* **Account Signal**: it starts 1 run per company per hour, so a second visit within the hour
  doesn't start another run. Visitors on home networks or a VPN often stay anonymous.

## Troubleshoot closed-lost workflows

| What you see | What to check |
| - | - |
| Play 1 never starts when a deal closes lost | Check that the status reads **Live** and that the Stage value in the **Condition** matches your CRM exactly. In Salesforce, check that Opportunity doesn't read **No active triggers** under **Watched fields**, and that your org has room under its Change Data Capture object limit. See [Salesforce](/settings/integrations/salesforce#how-salesforce-changes-reach-default). |
| **Publish** stops with a message asking an admin to publish | Default needs to watch a new object or field. An admin publishes the workflow once. |
| The owner gets more than 1 alert for the same deal | Add **Fields Updated** **contains any of** Stage to the trigger's **Condition**, so later edits to a lost deal don't start new runs. |
| Alerts arrive for deals someone reopened | Add the **Match Record** check after **Time Delay**, and send the alert only from its **Match** branch. |
| The opportunity **Match Record** always takes **No Match** | Check that Account ID uses the ID from the account **Match Record**, and that `Closed Lost` is spelled as in Salesforce. In HubSpot, use **Match by association** and **Multi-Branch** as described above. |
| **Send Slack Message** fails for the owner | Map the owner to their CRM user and their Slack user in **Settings** → **Users**. Add a **Slack channels** value so the alert also lands in a channel. |

Related: [Sales workflow software from Default](https://www.default.com/product/sales-workflow-software)


This documentation is built and hosted on [Mintlify](https://mintlify.com), a developer documentation platform.