Automate contract drafts and Salesforce opportunity updates

By integrating Salesforce with Contractbook, you can automatically generate tailored sales contracts based on your Salesforce data and update opportunities as soon as a contract is signed. This guide will walk you through setting up a seamless, two-phase automation flow to eliminate manual data entry by making your sales cycle automated.

Phase 1: Triggering a contract draft from a Salesforce opportunit

First, we will set up the automation to generate a new contract draft automatically as soon as an opportunity stage is changed in Salesforce.

Set the trigger event

  1. Navigate to the Automations tab in the top menu of Contractbook.

  2. Select My automations from the left-hand sidebar.

  3. Click the Create new button in the upper right-hand corner.

  4. Set the trigger event to Opportunity stage is changed.

  5. Select the specific stage that should initiate the flow (e.g., Contract drafted).

  6. Click Save to confirm.

Add conditions (Optional)

You can refine your automation by setting specific rules under the Only continue if automation section. This ensures the automation only runs when certain criteria are met.

  • Logic Types: Combine conditions using AND (all conditions must be met) or OR (at least one condition must be met).

  • Variables: Use the search bar to find Salesforce variables, such as the Opportunity owner's email, to limit the automation to specific owners.

  • Opportunity Contacts: You can pull from the Opportunity Contact list variables, giving you access to all opportunity contacts and their associated properties directly within the automation’s setup.

Phase 2: Configuring the contract draft action

Next, define the action that occurs when your trigger event conditions are met. Under the Then section, click the plus icon, select Create a draft, and choose the specific template you want to use.

A configuration sidebar will open with four key tabs to customize your new contract draft:

Configuration Tab

Purpose

Key Features

Details

Set the draft name and configure parties/signees.

Auto-populates template data, pulls Salesforce variables, and features a public search to instantly find company details (Denmark, Sweden, Norway).

Data

Insert specific opportunity info into the contract.

Maps your chosen Salesforce data points directly into the body of the contract draft.

Tables

Enrich the draft with dynamic tables.

Connects dynamic tables in your Contractbook template to Salesforce data sources, automatically populating columns with relevant opportunity line items.

Attachments

Add attachments to the new contract draft.

Allows you to define specific attached files that will be automatically added to the new contract draft when the automation event occurs.

Other

Customize the email sent to the draft’s recipients.

Write a personalized message combining standard text with dynamic Salesforce variables.

Document note

  • By default, the person who sets up the automation becomes the owner of the generated drafts. If you need a different setup, add a Share document action immediately after the Create draft step. 

  • This allows you to grant collaborators full edit rights and the ability to send the draft for signature on their end.

Phase 3: Updating Salesforce opportunities post-signature

With the creation phase complete, you can build a second automation to ensure your Salesforce opportunity automatically updates once the contract is fully signed.

Set the post-signature trigger event

  1. Return to the Automations tab and click Create new.

  2. Select Contract is signed as the trigger event from the dropdown options.

  3. Choose Every contract drafted from a specific template and select the exact template used in Phase 2.

  4. Decide if the automation should trigger after Every signature (each time a single signee completes their part) or only upon the Final signature (when the contract is fully signed by everyone).

  5. Click Save.

Add conditions (Optional)

Just like in Phase 1, you can use the Only continue if step in the automation setup to restrict when this automation runs. In this phase, your conditions will be based on variables pulled directly from the signed contract.

Configure the Update opportunity action

  1. Under the Then section in the automation setup, select Update opportunity in Salesforce from the drop-down options.

  2. Specify the correct opportunity ID by mapping the Deal ID from the selected template's data fields, or by typing it manually.

  3. List the specific Opportunity relationships you want to use as variables in the following automation steps, under the Opportunity relationships field (e.g.,Salesforce Opportunity Owner, Opportunity Account, Record Type, Contact, Signee from Contractbook).

  4. Select the Salesforce opportunity properties under the Salesforce data section, defining what specifically you want to update (e.g., changing the stage to Closed Won, adding the Contract URL from the Contractbook Document URL).

  5. Map the required values for each chosen Property using data fields, contract signee variables, or manual text input. 

Phase 4: Publish and run

Once you have configured your triggers, conditions, and actions for both automation phases, give your automations a clear name in the upper left corner and click Publish.

Your Contractbook and Salesforce integration is now live, ensuring a streamlined, error-free workflow from the moment an opportunity is qualified to the second the contract is signed.

Helpful guides:

Did you find this guide helpful?