Summary
A Make scenario catches the TruAgents webhook, checks whether the person is already a Lead, and then updates that Lead or creates a new one. Nobody writes code, and the Salesforce login stays in Make. This guide is step 2 of Send hot leads to Salesforce. Build the TruAgents workflow first.Who this is for
An ops person with a Make account and a Salesforce user who can create and edit Leads.Before you start
- A Make plan that includes the Salesforce app. Check Make’s current plans.
- A Salesforce connection in Make, using an integration user that can create and edit Leads.
TruAgentsadded to the Salesforce Lead Source picklist, or pick an existing value in step 5.
Make labels change from time to time. If a label doesn’t match exactly, look for the closest equivalent.
Build the scenario
The finished scenario looks like this:1
Catch the webhook
Create a scenario. Add Webhooks → Custom webhook, click Add, name it “TruAgents hot leads”, and save. Copy the webhook address. It looks like
https://hook.<region>.make.com/<random>.2
Teach Make the data structure
In TruAgents, open the workflow, click the Send webhook step, paste the Make address into Endpoint URL, and click Save workflow.In Make, click Run once. Then send one event: set the workflow to Active and email your TruAgents inbox a hot-lead message from a test address. You can also
POST the step’s Example payload to the Make address with curl. The Test Workflow tab never sends anything, so it can’t feed Make.Make shows “Successfully determined” on the webhook module, and the data fields become available to map.3
Look up the Lead by email
Add Salesforce → Make an API Call.
- URL: the SOQL query endpoint, for example
/v62.0/query. Check the module’s help text for the base URL it adds. - Method:
GET. - Query String: key
q, valueSELECT Id FROM Lead WHERE Email = '{{replace(data.contact.email; "/['\\]/g"; "\$&")}}' AND IsConverted = false LIMIT 1. Mapdata.contact.emailfrom the webhook. Thereplaceputs a backslash in front of any'or\in the address, so the address stays inside the quotes and cannot change the query.
Body → totalSize set to 0 or 1. The usual Search Records module returns no results when nothing matches, which stops the scenario before the Lead is created.A contact with no email, such as one who only called or texted, never matches, so the scenario always creates a new Lead for them. This scenario can’t prevent duplicates for those contacts.4
Split into create and update
Add a Router after the API call, with two routes:
- Create: filter
Body: totalSizeEqual to0. - Update: filter
Body: totalSizeGreater than0.
5
Create or update the Lead
On the Create route, add Salesforce → Create a Record, type Lead. On the Update route, add Salesforce → Update a Record, type Lead, with ID set to
Body: records[1]: Id. Map the same fields on both:Type the formulas with Make’s function picker rather than pasting, so Make recognizes them. The First Name formula removes the last word from the name, so “Mary Ann Smith” gives “Mary Ann”.
6
Answer TruAgents after Salesforce (recommended)
At the end of each route, add Webhooks → Webhook response with Status
200.Then right-click each Salesforce module, choose Add error handler, and add a Webhook response with Status 503 there.With these, Make answers TruAgents only after Salesforce has responded. If Salesforce fails, TruAgents gets 503 and tries again later. Without them, Make answers 200 straight away and Salesforce errors only show in Make.7
Turn it on
Save the scenario and turn it ON with Immediately as data arrives scheduling. Continue with Step 3: test and go live.
Failures and retries with Make
- With webhook responses (step 6): a Salesforce failure returns
503to TruAgents, which retries about every 5 to 10 minutes for up to 24 hours. TruAgents waits up to 30 seconds for an answer, which is plenty for two Salesforce calls. - Without webhook responses: Make answers
200on arrival. TruAgents shows the step as Succeeded and never retries, and errors only show in the scenario’s History. - Turn on Make’s error notifications either way.
- If the scenario is off, Make queues incoming requests and processes them once the scenario is back on, up to Make’s queue limit.
Security
- The webhook address works like a password: anyone with it can create Leads through your scenario. Share it only in the Send webhook step. If it leaks, create a new webhook in Make and update the step.
- Don’t add Salesforce credentials as headers on the Send webhook step. Make holds the Salesforce login.
- Keep the
replacein the lookup query. Without it, an address that contains'can change the query, and the scenario can update a different Lead.

