Automating contract creation from Salesforce

Integrating Contractbook with Salesforce empowers your commercial operations (Sales Representatives, Account Executives, etc.) to generate and monitor contracts directly from your CRM system. This workflow is powered by the "Flow is completed" trigger in Contractbook when creating your automations.

This process involves two distinct roles:

  1. The Salesforce admin: Responsible for connecting the platforms, installing the package, and mapping the data flow.

  2. The primary Salesforce user: The end-user who actively triggers the contract creation process during their day-to-day work.

Here is the complete guide on how administrators can build and configure this automated workflow.

Admin setup: the three high-level steps

Before building the automation, a Salesforce administrator must complete the foundational setup:

Step

Action

Description

1. Connect via OAuth

Authorize Contractbook

Link your Contractbook account to your Salesforce instance to allow API requests.

2. Install the Package

Add components

Install the "Contractbook app" package in your Salesforce organization so users can see the contract creation buttons.

3. Build Automations

Map data

Use the Automation Builder to define how Salesforce data populates Contractbook templates.

Configuring the "Flow is Completed" Trigger

Once the app is installed, open the Automations tab from the main navigation menu, click on the blue Create new button at the upper right hand corner, and select the "Flow is completed" trigger from the dropdown menu of options.

Select your object type:

You must choose the Salesforce object that will trigger the contract. Standard supported objects include:

  • Opportunity

  • Account

  • Contact

  • Order

  • Quote

  • Quote CPQ (for organizations using the CPQ Salesforce extension)

Include relationship data

You are not limited to the main object's data. You can select specific object relationships to make their properties available as variables during the data mapping step.

Using record types for conditional automation

By default, an automation is available for all records under the chosen Object type. However, you can optionally filter this by Record types to ensure users only see the automations relevant to their specific deals.

Example Scenario: Regional Master Service Agreements (MSAs)

Imagine your organization operates in Finland and Sweden, and each country requires a localized MSA. To prevent sales reps from selecting the wrong contract, you can build two separate automations attached to the "Opportunity" Salesforce object:

  • Automation A: "MSA for the Finnish Market" (Filtered by the "Finland" record type).

  • Automation B: "MSA for the Swedish Market" (Filtered by the "Sweden" record type).

When a sales rep works on a Finnish opportunity in Salesforce, the "Create contract in Contractbook" picklist will only display the Finnish MSA, minimizing human error.

Mapping data and creating drafts

After your trigger is configured, you need to tell the system what to do with the Salesforce data.

  • "Create a draft" automation action:

Select the Create a draft action step. This is mandatory for fetching the mapped data from Salesforce.

  • Choose the Contractbook template you wish to use for the automated draft’s creation.

  • Configure the contract details using Salesforce variables (found under the "Flow is completed" trigger options) to populate the draft name, parties, signees, data fields, and message to recipients.

  • Adding attachments:

To automatically include files with your contract draft, use the Files selected in the flow Salesforce variable. Place this in the "Attachments" section of your "Create draft" action. You can choose to append specific files, apply filters to identify or include "All files" pulled from the flow.

Extending your workflow

You can chain as many action steps as your organization requires. For example, after the "Create a draft" step, you can add an action to send an automated Slack notification to your company channel announcing the newly drafted sales proposal.

Frequently asked questions

  • Who needs to set up the Salesforce integration? 

A Salesforce Administrator must handle the initial configuration. This includes connecting Contractbook via OAuth, installing the Contractbook package in Salesforce, and building the initial automations mapping the data.

  • Can I limit which contracts my sales operation can generate? 

Yes. You can use Salesforce "Record types" in the Automation Builder to filter which automations appear for specific records. This ensures your company users only see the contracts relevant to the specific market or product they are working with.

  • How do I include attachments in the generated contract? 

You can use the "Files selected in the flow" variable within the "Create draft" action in the automation configuration. You can opt to attach specific files, apply filters or include all files from the flow.

  • Can I trigger other actions after the contract is created? 

Yes. Contractbook's Automation Builder allows you to add multiple action steps following the "Create a draft" action, such as sending automated Slack messages or emails.

Helpful guides:

Did you find this guide helpful?