# Create Salesforce leads from new HubSpot deals recipe
This use case guides you through connecting HubSpot, Salesforce, and Workbot for Microsoft Teams to create a powerful automation.
# What does this recipe do?
This recipe monitors HubSpot for new deals. If the deal is associated with a contact in HubSpot, the recipe creates a new lead in Salesforce, and Workbot for Microsoft Teams posts a message containing details about the new Salesforce lead.
# Create your recipe
Complete the following steps to build a recipe that creates Salesforce leads from new HubSpot deals:
USE CASES ARE INTENDED AS EXAMPLES ONLY
This use case serves as an example. Modifications to triggers, actions, or conditional logic may be necessary to adapt this recipe to your workflow.
Sign in to Workato.
Select the project where you plan to create the recipe.
Create connections for HubSpot, Salesforce, and Workbot for Microsoft Teams:
Create a HubSpot connection.
Click Create > Connection.
Search for and select HubSpot
on the New connection page.
Provide a name for your connection in the Connection name field.
Connect to HubSpot
Use the Location drop-down menu to select the project where you plan to store the connection.
Optional. Expand the Advanced settings section and use the Scopes drop-down menu to select permissions to request for the connection.
Optional. Select the profile for the connection in the Custom OAuth profile drop-down menu. Alternatively, create a new profile for HubSpot.
Click Connect.
Select the HubSpot account where you plan to authorize Workato and click Choose Account.
Select an account
Create a Salesforce connection.
Click Create > Connection.
Search for and select Salesforce
on the New connection page.
Provide a name for your connection in the Connection name field.
Salesforce connection setup
Use the Location drop-down menu to select the project where you plan to store the connection.
Use the Auth type drop-down menu to select the authentication method. The default is OAuth 2.0.
Use the Sandbox drop-down menu to specify whether the Salesforce account is a sandbox account.
Optional. Expand Advanced settings to configure advanced connection options.
Optional. Use the Custom OAuth profile drop-down menu to select a custom OAuth profile for your connection.
- This custom OAuth profile ensures that the connection is restricted to the same set of scopes you selected for all users with the profile, and the authentication flow uses the client app linked to the custom profile.
Click Connect.
Enter your Salesforce account credentials and click Log In.
Log in to your Salesforce account
Create a Workbot for Microsoft Teams connection.
Note: You must add Workbot to Microsoft Teams before you can establish the connection in Workato.
Click Create > Connection.
Search for and select Workbot for Microsoft Teams
on the New connection page.
Provide a name for your connection in the Connection name field.
Image caption
Use the Location drop-down menu to select the project where you plan to store the connection.
Use the Auth type drop-down menu to select OAuth 2.0.
Optional. Expand the Advanced settings section to select permissions to request for the connection.
Optional. Select the custom OAuth profile for the connection in the Custom OAuth profile drop-down menu.
Click Sign in with Microsoft.
Go back to your project and click Create > Recipe.
Create a new recipe
Select the project where you plan to store the recipe from the Location drop-down menu.
Click Pick a starting point, then select Trigger from an app.
Set up your HubSpot New record (deal) trigger.
Search for and select the HubSpot connector.
Choose HubSpot
Select the New record trigger.
Select the New record trigger
Select Deal from the Object drop-down menu.
Select deal properties to retrieve from the Properties drop-down menu. This example selects Amount and Close Date.
Configure the New deal trigger
Step summary
This trigger monitors HubSpot for new deals and retrieves details about the amount and close date.
Click + Add step and select Action in app.
Click Add step > Action in app
Set up your HubSpot Get associations action (batch).
Search for and select the HubSpot connector.
Choose HubSpot
Select the Get associations batch action.
Select the Get associations batch action
Select Deal from the From object drop-down menu.
Select Contact from the To object drop-down menu.
Map the HubSpot ID Step 1 datapill to the From object ID field.
Configure the Get associations action
Step summary
This step retrieves the contact associated with the deal that triggered the recipe.
Click + Add step and select IF condition.
Click Add step > IF condition
How do IF conditions work?
An IF condition lets you to make decisions based on specific conditions. You can control your recipe workflow by executing different actions depending on whether a condition you specify is true or false.
Set up your IF condition.
Map the HubSpot List size Step 2 datapill (under the Results list) to Data field.
Select greater than from the Condition drop-down menu.
Enter 0
in the Value field.
Configure the IF condition
Step summary
This step checks if a contact is associated with the new HubSpot deal.
Click Select an app and action.
Set up your HubSpot Get record (contact) action.
Search for and select the HubSpot connector.
Choose HubSpot
Select the Get record action.
Select the Get record action
Select Contact from the Object drop-down menu.
Map the HubSpot To object ID Step 2 datapill to the ID field. This instructs the recipe to retrieve information about the contact associated with the new deal.
Specify the fields you plan to retrieve in the Fields to retrieve field. This example selects the following fields:
- Company Name
- Last Name
- Annual Revenue
- City
- Country/Region
- First Name
- Phone Number
- State/Province
- Job Title
You can select additional fields as required by your use case, or that you plan to sync when creating the lead in Salesforce.
Configure the Get contact action
Step summary
This step retrieves information about the contact associated with the deal from HubSpot.
Click + Add step and select Action in app.
Click Add step > Action in app
Set up your Salesforce Create record (lead) action.
Search for and select the Salesforce connector.
Choose Salesforce
Select the Create record action.
Select the Create record action
Select Lead from the Object drop-down menu.
Map datapills from the HubSpot Get contact action to the fields you plan to sync to the Salesforce lead. The Company and Last Name fields are required.
For example, this recipe maps the following HubSpot datapills to their respective Salesforce fields:
- Company Name Step 4 to the Company field.
- Last Name Step 4 to the Last Name field.
- Annual Revenue Step 4 to the Annual Revenue field.
- City Step 4 to the City field.
- Country/Region Step 4 to the Country field.
- Email Step 4 to the Email field.
- First Name Step 4 to the First Name field.
- Phone Number Step 4 to the Phone field.
- Company Name Step 4 to the Company field.
- State/Region Step 4 to the State/Province field.
- Job Title Step 4 to the Title field.
Step summary
This step creates the lead in Salesforce using information about the contact from HubSpot.
Click + Add step and select Action in app.
Set up your Salesforce Get record details by ID action.
Search for and select the Salesforce connector.
Choose Salesforce
Select the Get record details by ID action.
Select the Get record details by ID action
Select Lead from the Object drop-down menu.
Map the Salesforce Object ID Step 5 datapill to the Object ID field.
Configure the Get lead details by ID action
Step summary
This step retrieves details about the new lead created in Salesforce.
Click + Add step and select Action in app.
Set up your Workbot for Microsoft Teams Post message action.
Search for and select the Workbot for Microsoft Teams connector.
Choose Workbot for Microsoft Teams
Select the Post message action.
Select the Post message action
Select the channel where you plan to send the message from the Message recipient drop-down menu.
Locate the Message field and click Add block.
Fill out the following fields in the first block:
- Type: Select Text block.
- Block text: Enter
🔔 New Salesforce Lead Created!
. - Text type: Select Header.
Click Add block.
Fill out the following fields in the second block:
- Type: Select Text block.
- Block text: Enter
📌 Lead Name:
and map the Salesforce Full Name Step 6 datapill. - Text type: Select Body text.
Click Add block.
Fill out the following fields in the third block:
- Type: Select Text block.
- Block text: Enter
🏢 Company:
and map the Salesforce Company Step 6 datapill. - Text type: Select Body text.
Click Add block.
Fill out the following fields in the fourth block:
- Type: Select Text block.
- Block text: Switch this field to formula mode, enter
'📞 Phone: ' +
, map the Salesforce Phone Step 6 datapill, and append the.to_phone(area_code: true)
formula. - Text type: Select Body text.
Configure the phone block
Click Add block.
Fill out the following fields in the fifth block:
- Type: Select Text block.
- Block text: Enter
✉️ Email:
and map the Salesforce Email Step 6 datapill. - Text type: Select Body text.
Click Add block.
Fill out the following fields in the sixth block:
- Type: Select Text block.
- Block text: Switch this field to formula mode, enter
'💰 Deal Amount: ' +
, map the HubSpot Amount Step 1 datapill, and append the.to_i.to_currency
formula. - Text type: Select Body text.
Configure the deal amount block
Click Add block.
Fill out the following fields in the seventh block:
- Type: Select Text block.
- Block text: Switch this field to formula mode, enter
'📆 Close Date: ' +
, map the HubSpot Close Date Step 1 datapill, and append the.strftime("%m/%d/%Y")
formula. - Text type: Select Body text.
Configure the close date block
Click Add block.
Fill out the following fields in the eighth and final block:
- Type: Select Text block.
- Block text: Enter
🎯 Lead Source: HubSpot
. - Text type: Select Body text.
Step summary
This step posts a message in Microsoft Teams containing details about the new Salesforce lead.
Example message containing Salesforce lead details
Click Save.
Your Create Salesforce leads from new HubSpot deal recipe is ready to test and implement.
Example recipe configuration.
Create Salesforce leads from new HubSpot deal recipe
Last updated: 3/17/2025, 5:46:02 PM