Articles / Product
Product

How to Close a Salesforce Opportunity When the Agreement Is Signed

When the last signature is in, the deal is won. This step-by-step guide builds a Flow that closes the opportunity for you, with the Close Date set to the day signing finished. Standard Flow Builder only, no code.

Jerry Huang
Jerry Huang
17 November 2026
How to Close a Salesforce Opportunity When the Agreement Is Signed

When you send an agreement for signature from an opportunity, the deal is won once everyone has signed: the customer, and anyone on your team who countersigns. The Flow in this guide closes the opportunity for you at that moment. It sets the opportunity’s Stage to Closed Won and its Close Date to the day the last person signed.

It uses standard Flow Builder only, so you don’t need any code. It works with Sliick Docs e-signature, which is free on the AppExchange.

Before you start

Send the agreement from the opportunity. Sliick Docs remembers which record a request was sent from, and the Flow uses that to find the opportunity. See Sending a document.

What the Flow watches

Each request you send is a Signature Request record (sliick__Doc_Signature_Request__c). Three of its fields matter here:

  • Status (sliick__Status__c) changes to Completed when the last signer signs. A request that is declined, cancelled or expires never reaches Completed, so the Flow leaves its opportunity alone.
  • Completed At (sliick__Completed_At__c) is when that last signature arrived.
  • Source Record Id (sliick__Source_Record_Id__c) is the Id of the record you sent from.

Build the Flow

The screenshots below use an example opportunity, Tailspin Aviation - Annual Support Renewal, signed by the customer and then countersigned by the account owner.

1. Create a record-triggered Flow

In Setup, open Flows and click New Flow. In the New Automation window, choose Triggered Automations, then Record-Triggered Flow.

The New Automation window showing Triggered Automations, with Record-Triggered Flow first in the list of types

2. Set the trigger

Flow Builder opens Configure Start. Fill it in from top to bottom:

  • Object: search for and choose Signature Request.
  • Trigger the Flow When: A record is updated.

Configure Start with Object set to Signature Request and Trigger the Flow When set to A record is updated

  • Condition Requirements: All Conditions Are Met (AND), with one condition: Status Equals Completed.
  • When to Run the Flow for Updated Records: Only when a record is updated to meet the condition requirements. The Flow then runs once, when the request is completed, and not on later changes.

The entry condition Status Equals Completed, with Only when a record is updated to meet the condition requirements selected

3. Add the asynchronous path

Scroll to the bottom of Configure Start. Leave Optimize the Flow for on Actions and Related Records, and turn on Add Asynchronous Path.

Optimize Flow set to Actions and Related Records, and the Add Asynchronous Path switch turned on

The canvas now shows two paths, Run Immediately and Run Asynchronously. Build every remaining step on Run Asynchronously, and leave Run Immediately empty. See Why the asynchronous path.

4. Find the opportunity

Click + under Run Asynchronously and add Get Records:

  • Label: Get Opportunity.
  • Object: Opportunity.
  • Condition Requirements: All Conditions Are Met (AND), with one condition: Opportunity ID Equals the request’s Source Record Id. To pick it, click Value, then the arrow next to Triggering Signature Request (it can show as Triggering sliick__Doc_Signature_Request__c), then Source Record Id.
  • How Many Records to Store: Only the first record.

Get Records filtering Opportunity ID Equals the triggering request's Source Record Id, storing only the first record

Pick the value from the list rather than typing it. A typed value can stay as plain text instead of becoming a blue reference like the one in the screenshot.

If the request was not sent from an opportunity, this step finds nothing, and the next step stops the Flow.

5. Check the opportunity is still open

Click + under Get Opportunity and add a Decision:

  • Label: Is the Opportunity Open.

  • Name the first outcome Open opportunity found, with All Conditions Are Met (AND) and two conditions:

    ResourceOperatorValue
    Opportunity from Get OpportunityIs NullFalse
    Opportunity from Get Opportunity > ClosedEqualsFalse

The Open opportunity found outcome: Opportunity from Get Opportunity Is Null False, and Opportunity from Get Opportunity > Closed Equals False

The first condition stops the Flow when no opportunity was found. The second leaves alone an opportunity that is already Closed Won or Closed Lost, so the Flow never overwrites a deal someone closed by hand.

6. Work out the signed date

Open the Toolbox (the panel icon at the top left of Flow Builder) and click New Resource:

  • Resource Type: Formula.

  • API Name: SignedDate.

  • Data Type: Date.

  • Formula:

    DATEVALUE({!$Record.sliick__Completed_At__c})

Click Check Syntax. It should say Valid. Then click Done.

The New Resource window for the SignedDate formula, with Data Type Date and Check Syntax showing Valid

See Getting the right date before you rely on it.

7. Close the opportunity

Click + under Open opportunity found and add Update Records:

  • Label: Close Opportunity Won.
  • How to Find Records to Update and Set Their Values: Specify conditions to identify records, and set fields individually.
  • Object: Opportunity.

Update Records set to Specify conditions to identify records, and set fields individually, on the Opportunity object

  • Filter Opportunity Records: Opportunity ID Equals Opportunity from Get Opportunity > Opportunity ID.
  • Set Field Values for the Opportunity Records:
    • Stage ← Closed Won
    • Close Date ← SignedDate (click Add Field for the second row)

The Update Records filter on Opportunity ID, and the field values Stage set to Closed Won and Close Date set to SignedDate

8. Save and activate

Click Save, give the Flow a name such as Close Opportunity When Signing Is Complete, and save again. Your Flow should look like this:

The finished Flow: Run Asynchronously leads to Get Opportunity, then Is the Opportunity Open, and the Open opportunity found path leads to Close Opportunity Won

Test it in a sandbox first (see Try it out), then click Activate.

Try it out

  1. On an open opportunity, send a document for signature with two signers: the customer’s contact, and yourself as the countersigner.
  2. Sign it as the customer. In a sandbox, Signs in person on each signer is the quickest way: no email is sent, and you sign on the same device.
  3. Refresh the opportunity. It is still open, because one signature is missing.
  4. Sign as the countersigner, then refresh the opportunity again a few seconds later. Its Stage is Closed Won and its Close Date is the day of the last signature.

The example opportunity after the last signature, with Stage Closed Won and Close Date 17/11/2026

The asynchronous path runs as the person who triggered it. When the last signer signs on your signing site, the opportunity’s Last Modified By shows your site’s guest user. That is expected.

Getting the right date

In a Flow, DATEVALUE gives the date in the time zone of the user the Flow runs as. When the last signer signs on your signing site, that user is the site’s guest user. So SignedDate is the signing day in the guest user’s time zone.

The guest user is often set to GMT. Then the signer’s local date can differ from the date the Flow writes. Behind GMT, as in the Americas, an evening signature gets the next day’s date. Ahead of GMT, as in Australia or Asia, a morning signature gets the previous day’s date.

To fix it, set the guest user to your team’s time zone:

  1. In Setup, open Sites and click your signing site’s label.
  2. Click Public Access Settings, then View Users.
  3. Edit the guest user and set Time Zone to your team’s time zone, such as (GMT-06:00) Central Standard Time (America/Chicago) or (GMT+11:00) Australian Eastern Daylight Time (Australia/Sydney).

Salesforce applies daylight saving time for you, so the formula from step 6 needs no change.

Why the asynchronous path

The last signature is saved first. The asynchronous path then runs on its own, after the save.

If the opportunity update fails, for example because one of your validation rules needs a field filled in before an opportunity can be Closed Won, only the Flow fails. Salesforce emails the Flow error to your admin, and the signature is safe.

On the main path, the same failure would happen while the signature was being saved. The signer would see an error, and their signature would not be recorded.

Variations

  • Only for some opportunities. Add conditions to the Decision in step 5, such as a record type or a minimum amount.
  • Other records you send from. Source Record Id holds the Id of whatever record you sent from, such as a quote or a contract. To update one of those instead, change the object in steps 4 and 7 and set the fields that record needs.
Need a hand?
Not sure your Salesforce setup is configured correctly?

We'll audit your architecture, security, and integration posture.

Book an audit

Share this article

Jerry Huang
Written by
Jerry Huang

Jerry Huang is the Founder & CEO of Sliick. He is passionate about building apps, helping customers succeed, and starting and scaling great businesses with the Salesforce platform. Jerry has been in tech for over two decades. He has 30 Salesforce certifications, including the Salesforce Certified Technical Architect, and an approved U.S. patent.

Keep reading