Automatisation Salesforce avec n8n : enrichissement de données
Ce workflow n8n a pour objectif d'automatiser l'enrichissement des données Salesforce en intégrant des transcriptions d'appels et des informations sur les opportunités. Dans un contexte où la gestion efficace des données clients est cruciale, ce processus permet aux équipes commerciales de gagner du temps et d'améliorer la qualité des informations disponibles. En utilisant des appels API pour récupérer des données détaillées sur les appels et les opportunités, ce workflow facilite la centralisation des informations pertinentes.
- Étape 1 : Le workflow est déclenché par un événement spécifique, tel qu'un appel reçu.
- Étape 2 : Les données d'appel sont récupérées via une requête HTTP, suivie de l'extraction des transcriptions d'appels.
- Étape 3 : Les transcriptions sont ensuite jointes à d'autres données pertinentes, comme les informations sur les opportunités Salesforce.
- Étape 4 : Les données sont agrégées et enrichies pour fournir une vue complète des interactions avec les clients. Ce processus d'automatisation n8n permet non seulement de réduire les erreurs humaines, mais aussi d'améliorer la réactivité des équipes face aux besoins des clients, augmentant ainsi la satisfaction et la fidélisation.
Workflow n8n Salesforce, enrichissement de données : vue d'ensemble
Schéma des nœuds et connexions de ce workflow n8n, généré à partir du JSON n8n.
Workflow n8n Salesforce, enrichissement de données : détail des nœuds
Inscris-toi pour voir l'intégralité du workflow
Inscription gratuite
S'inscrire gratuitementBesoin d'aide ?{
"meta": {
"instanceId": "cb484ba7b742928a2048bf8829668bed5b5ad9787579adea888f05980292a4a7",
"templateCredsSetupCompleted": true
},
"nodes": [
{
"id": "e893e48c-1b69-413a-90d7-ad6ce5987e7c",
"name": "Execute Workflow Trigger",
"type": "n8n-nodes-base.executeWorkflowTrigger",
"position": [
-180,
-60
],
"parameters": {},
"typeVersion": 1
},
{
"id": "1c42e95b-705d-43ae-91ce-1029334b9e9a",
"name": "Retrieve detailed call data",
"type": "n8n-nodes-base.httpRequest",
"position": [
60,
40
],
"parameters": {
"url": "https://api.gong.io/v2/calls/extensive",
"options": {
"fullResponse": true
},
"requestMethod": "POST",
"authentication": "genericCredentialType",
"jsonParameters": true,
"genericAuthType": "httpHeaderAuth",
"bodyParametersJson": "={\n \"contentSelector\": {\n \"context\": \"Extended\",\n \"contextTiming\": [\"Now\", \"TimeOfCall\"],\n \"exposedFields\": {\n \"collaboration\": {\n \"publicComments\": true\n },\n \"content\": {\n \"pointsOfInterest\": true,\n \"structure\": true,\n \"topics\": true,\n \"trackers\": true\n },\n \"interaction\": {\n \"personInteractionStats\": true,\n \"questions\": true,\n \"speakers\": true,\n \"video\": true\n },\n \"media\": false,\n \"parties\": true\n }\n },\n \"filter\": {\n \"callIds\": [\"{{ $json['calldata[0].calls'].id }}\"]\n }\n}"
},
"credentials": {
"httpHeaderAuth": {
"id": "Bz7PHFY0lgEhLsC0",
"name": "Giulio Gong API"
}
},
"typeVersion": 2
},
{
"id": "69c9ef1a-9ef4-4c3f-ab62-a5c9b2a10a4e",
"name": "Get transcript",
"type": "n8n-nodes-base.httpRequest",
"position": [
60,
-140
],
"parameters": {
"url": "https://api.gong.io/v2/calls/transcript?callIds=1807130744801961509",
"options": {
"fullResponse": true
},
"requestMethod": "POST",
"authentication": "genericCredentialType",
"jsonParameters": true,
"genericAuthType": "httpHeaderAuth",
"bodyParametersJson": "={\"filter\":{\"callIds\":[\"{{ $json['calldata[0].calls'].id }}\"]}}"
},
"credentials": {
"httpHeaderAuth": {
"id": "Bz7PHFY0lgEhLsC0",
"name": "Giulio Gong API"
}
},
"typeVersion": 2
},
{
"id": "a9643d2c-6245-4c40-92ee-49eb667e3348",
"name": "Join Transcript to String",
"type": "n8n-nodes-base.set",
"position": [
260,
-140
],
"parameters": {
"options": {},
"assignments": {
"assignments": [
{
"id": "c9828e0c-fce4-487d-b5cb-bff625cb7c8e",
"name": "Conversation",
"type": "array",
"value": "={{ $jmespath($json.body.callTranscripts, '[].transcript[].{\"speaker\": speakerId, \"text\": sentences[].text}') }}"
}
]
}
},
"typeVersion": 3.4
},
{
"id": "ce7cce2a-95b2-4d74-865d-d1af028e16de",
"name": "Isolate Notion Data",
"type": "n8n-nodes-base.set",
"position": [
2720,
-100
],
"parameters": {
"options": {},
"assignments": {
"assignments": [
{
"id": "ee14c39a-1590-4262-b5ab-36640a6e3c31",
"name": "metaData.CompanyName",
"type": "string",
"value": "={{ $json.sfOpp[0].Name }}"
},
{
"id": "0d323985-076c-456f-bf4c-d9520b07f73d",
"name": "Attendees.internal",
"type": "array",
"value": "={{ $jmespath($json.gongData[0].parties, '[?affiliation==`Internal`].emailAddress') }}"
},
{
"id": "ee040180-fce4-4d68-a406-26a88a383c14",
"name": "metaData.title",
"type": "string",
"value": "={{ $json.gongData[0].metaData.title }}"
},
{
"id": "dea503f9-d575-4804-bbe7-0dcf7d5fbea4",
"name": "metaData.started",
"type": "string",
"value": "={{ $json.gongData[0].metaData.started }}"
},
{
"id": "91fa2545-6a02-43e6-b893-4d3133540a5c",
"name": "metaData.GongCallID",
"type": "string",
"value": "={{ $json.gongData[0].metaData.id }}"
},
{
"id": "c0cbfa8b-40d1-4838-a375-88ea8eb85170",
"name": "metaData.url",
"type": "string",
"value": "={{ $json.gongData[0].metaData.url }}"
},
{
"id": "d10a0184-f17c-4fd6-aed5-72656e15f856",
"name": "Conversation",
"type": "string",
"value": "={{ $json.gongData[0].conversationText }}"
},
{
"id": "02eb0113-7e52-4931-bd10-3f2bee87d984",
"name": "Attendees.external",
"type": "array",
"value": "={{ $jmespath($json.gongData[0].parties, '[?affiliation==`External` || affiliation==`Unknown`].emailAddress') }}"
},
{
"id": "c2183c7b-d552-4a16-bb08-c9ed247f8111",
"name": "Attendees.externalNames",
"type": "array",
"value": "={{ $jmespath($json.gongData[0].parties, '[?affiliation==`External` || affiliation==`Unknown`].name') }}"
},
{
"id": "a232bd40-ae56-4c12-8b3f-9062d4880415",
"name": "Attendees.internalNames",
"type": "array",
"value": "={{ $jmespath($json.gongData[0].parties, '[?affiliation==`Internal`].name') }}"
},
{
"id": "99f7143e-af6c-45d2-b3a1-c5169c6632eb",
"name": "metaData.Integrations",
"type": "string",
"value": "={{ $('Execute Workflow Trigger').item.json['calldata[1].integrations'] }}"
},
{
"id": "7fe14a89-5fda-4594-8b5a-6fbd8a519db9",
"name": "metaData.Competitors",
"type": "string",
"value": "={{ $('Execute Workflow Trigger').item.json['calldata[2].competitors'] }}"
},
{
"id": "29fb3dbe-071c-4b02-9dd9-afa4c3a4ad8f",
"name": "metaData.domain",
"type": "string",
"value": "={{ \n (() => {\n // List of known free email domains\n const freeEmailDomains = [\n 'gmail.com',\n 'yahoo.com',\n 'hotmail.com',\n 'outlook.com',\n 'aol.com',\n 'icloud.com',\n 'mail.com',\n 'yandex.com',\n 'protonmail.com'\n ];\n\n // Extract email addresses using JMESPath\n const emailAddresses = $jmespath($json.gongData[0].parties, '[?affiliation==`External` || affiliation==`Unknown`].emailAddress');\n\n // Function to extract the domain from an email address\n const extractDomain = (email) => email.match(/@([\\w.-]+)/)?.[1];\n\n // Filter out free email domains\n const companyDomains = emailAddresses\n .map(extractDomain)\n .filter(domain => domain && !freeEmailDomains.includes(domain.toLowerCase()));\n\n // Return the first non-free domain or \"Unknown\" if none are found\n return companyDomains[0] || 'Unknown';\n })()\n}}"
},
{
"id": "b28eb61e-6052-4022-9d31-447dbf877982",
"name": "sfOpp",
"type": "array",
"value": "={{ $json.sfOpp }}"
}
]
}
},
"typeVersion": 3.4
},
{
"id": "38574bd1-82f3-4499-9369-9241e41b35d1",
"name": "Join Affiliation",
"type": "n8n-nodes-base.code",
"position": [
740,
-120
],
"parameters": {
"jsCode": "// Retrieve input data from all items\nconst inputData = $input.all();\nconst originalJson = inputData[0].json; // Get the original JSON data\nconst conversation = originalJson.Conversation;\nconst parties = originalJson.parties;\n\n// Create a mapping of speakerId to affiliation\nconst affiliationMap = {};\nparties.forEach(party => {\n affiliationMap[party.speakerId] = party.affiliation;\n});\n\n// Replace speakerId with affiliation in the conversation data\nconst updatedConversation = conversation.map(entry => {\n const affiliation = affiliationMap[entry.speaker] || 'Unknown'; // Fallback to 'Unknown' if not found\n return {\n ...entry,\n speaker: affiliation, // Replace speakerId with affiliation\n };\n});\n\n// Return the updated conversation along with the original JSON data\nreturn [{ json: { ...originalJson, updatedConversation } }];\n"
},
"typeVersion": 2
},
{
"id": "15809205-cb1d-4d83-8c67-35ab486071b2",
"name": "Join conversation",
"type": "n8n-nodes-base.code",
"position": [
940,
-120
],
"parameters": {
"jsCode": "// Retrieve the original JSON data\nconst originalJson = $json;\nconst conversation = originalJson.updatedConversation;\n\n// Create an array to hold the formatted lines\nconst formattedLines = [];\n\n// Iterate over each entry in the conversation\nconversation.forEach(entry => {\n const speaker = entry.speaker;\n const texts = entry.text;\n\n // Iterate over each text item and format it as \"speaker: text\"\n texts.forEach(line => {\n formattedLines.push(`${speaker}: ${line}`);\n });\n});\n\n// Join the formatted lines with newline characters\nconst result = formattedLines.join('\\n');\n\n// Return the original JSON data along with the new conversationText field\nreturn [{ json: { ...originalJson, conversationText: result } }];\n"
},
"typeVersion": 2
},
{
"id": "1ac9e862-ddf2-4cd5-9339-c69061182231",
"name": "Sticky Note5",
"type": "n8n-nodes-base.stickyNote",
"position": [
-600,
-500
],
"parameters": {
"width": 340,
"height": 820,
"content": "\n## CallForge - The AI Gong Sales Call Processor\nCallForge allows you to extract important information for different departments from your Sales Gong Calls. \n\n### Transcript PreProcessor\nThis workflow preps the call transcripts to pass into the call processor. It starts by using the code node to separate the different speakers into either Internal or External speaker. It also pulls data from Salesforce to enrich the call data by pulling things such as company name. "
},
"typeVersion": 1
},
{
"id": "7d8f99e2-13c7-4bf2-becc-c7b5c663028d",
"name": "Sticky Note",
"type": "n8n-nodes-base.stickyNote",
"position": [
-240,
-340
],
"parameters": {
"color": 7,
"width": 720,
"height": 660,
"content": "## Get Gong Transcript and Call Details\nThe transcript is to pass into the AI prompt, but needs to be transformed first. The Call details provide the Prompt with metadata."
},
"typeVersion": 1
},
{
"id": "1454276d-46e6-40b2-9494-c9c380f3eaa1",
"name": "Sticky Note1",
"type": "n8n-nodes-base.stickyNote",
"position": [
500,
-340
],
"parameters": {
"color": 7,
"width": 580,
"height": 660,
"content": "## Format Call Transcript \nHere we join the call transcript together and then set the speaker as either Internal (for our sales team) or External (for our customers). "
},
"typeVersion": 1
},
{
"id": "d7fa6f56-8234-4995-b559-4809095efcb4",
"name": "Sticky Note2",
"type": "n8n-nodes-base.stickyNote",
"position": [
1100,
-340
],
"parameters": {
"color": 7,
"width": 1320,
"height": 780,
"content": "## Enrich Call Data\nHere we get the Pipedrive ID using the email domain and use that to search pipedrive for the customer. We also pass the domain into the People Data Labs api to get location data. "
},
"typeVersion": 1
},
{
"id": "b5274357-4e45-4d8b-938d-b3c66f98c82f",
"name": "Sticky Note3",
"type": "n8n-nodes-base.stickyNote",
"position": [
2440,
-340
],
"parameters": {
"color": 7,
"width": 480,
"height": 660,
"content": "## Extract Final Data Blob\nHere we merge the final outputs and get rid of anything we don't need for the final AI prompt. "
},
"typeVersion": 1
},
{
"id": "a940a941-f9e2-4449-895f-3268e2203a1e",
"name": "Extract SF Opp Data",
"type": "n8n-nodes-base.set",
"position": [
1700,
80
],
"parameters": {
"options": {},
"assignments": {
"assignments": [
{
"id": "64f7f8ec-3c1c-4743-9e5b-6bb5d385e9d2",
"name": "SFOppId",
"type": "string",
"value": "={{ $json.Id }}"
},
{
"id": "85629904-617a-4a5f-87a3-72f2349cdf99",
"name": "OppType",
"type": "string",
"value": "={{ $json.Type }}"
},
{
"id": "f6ec091d-0784-4000-ad49-3bb6ece375ca",
"name": "LeadSource",
"type": "string",
"value": "={{ $json.LeadSource }}"
},
{
"id": "a3fd520e-3577-4c2d-a09a-ad3bc76e0bd7",
"name": "IsClosed",
"type": "boolean",
"value": "={{ $json.IsClosed }}"
},
{
"id": "8a1fac85-5f1b-4ab2-86ea-586df1e2af2b",
"name": "IsWon",
"type": "boolean",
"value": "={{ $json.IsWon }}"
},
{
"id": "0f86f2a2-94bb-412a-b831-974f2528fca3",
"name": "sfStage",
"type": "string",
"value": "={{ $json.StageName }}"
},
{
"id": "f455d38b-d48a-483c-b0d9-def9514741ef",
"name": "companyAccountId",
"type": "string",
"value": "={{ $json.AccountId }}"
},
{
"id": "1eb560db-3dd8-46cb-993d-0e370e25222f",
"name": "usingn8n",
"type": "string",
"value": "={{ $json.n8n_experience__c }}"
},
{
"id": "e1d251e3-40e5-4b63-bbc3-c45e503bb108",
"name": "ForecastCategory",
"type": "string",
"value": "={{ $json.ForecastCategory }}"
}
]
}
},
"typeVersion": 3.4
},
{
"id": "0b2b5078-96b5-423c-82d1-278f013ecdff",
"name": "Extract SF Opp Data1",
"type": "n8n-nodes-base.set",
"position": [
1880,
260
],
"parameters": {
"options": {},
"assignments": {
"assignments": [
{
"id": "261c0f53-82d1-4deb-ae52-09ea342d0f88",
"name": "Employees",
"type": "string",
"value": "={{ $json.Employees_Bucket__c }}"
},
{
"id": "ca1c9890-4a7d-43c6-b7ad-bf1d522574a7",
"name": "Name",
"type": "string",
"value": "={{ $json.Name }}"
}
]
}
},
"typeVersion": 3.4
},
{
"id": "fec915a1-10ea-4be6-a15f-cea0ae837633",
"name": "Get Opp Data",
"type": "n8n-nodes-base.salesforce",
"position": [
1460,
80
],
"parameters": {
"resource": "opportunity",
"operation": "get",
"opportunityId": "={{ $('Execute Workflow Trigger').item.json[\"calldata[0].calls\"].sfOpp }}"
},
"credentials": {
"salesforceOAuth2Api": {
"id": "Ykybxuyh0jK0o3qH",
"name": "Angel SF Creds v3"
}
},
"typeVersion": 1
},
{
"id": "793127ea-d1c7-4f29-a536-c87ece9d6601",
"name": "Get account data",
"type": "n8n-nodes-base.salesforce",
"position": [
1700,
260
],
"parameters": {
"resource": "account",
"accountId": "={{ $json.AccountId }}",
"operation": "get"
},
"credentials": {
"salesforceOAuth2Api": {
"id": "Ykybxuyh0jK0o3qH",
"name": "Angel SF Creds v3"
}
},
"typeVersion": 1
},
{
"id": "249ef11d-47b3-415c-aac0-13437c1fd5c8",
"name": "Extract Call Data",
"type": "n8n-nodes-base.splitOut",
"position": [
260,
40
],
"parameters": {
"options": {},
"fieldToSplitOut": "body.calls"
},
"typeVersion": 1
},
{
"id": "a572d7e8-6613-4f46-8abf-9a254f22cfc1",
"name": "Merge call and transcript Data",
"type": "n8n-nodes-base.merge",
"position": [
540,
-120
],
"parameters": {
"mode": "combine",
"options": {},
"combineBy": "combineByPosition"
},
"typeVersion": 3
},
{
"id": "1bcbafc1-5ef5-43a4-af2a-9689888fc086",
"name": "Aggregate Gong Call Transcript",
"type": "n8n-nodes-base.aggregate",
"position": [
1720,
-120
],
"parameters": {
"options": {},
"aggregate": "aggregateAllItemData",
"destinationFieldName": "gongData"
},
"typeVersion": 1
},
{
"id": "df307a52-512d-4397-8d22-a8a51a06fe21",
"name": "Get External Attendees Emails",
"type": "n8n-nodes-base.set",
"position": [
1280,
80
],
"parameters": {
"options": {},
"assignments": {
"assignments": [
{
"id": "0a813814-2e7d-40e0-961f-ba59baf5ece5",
"name": "externalAttendees",
"type": "array",
"value": "={{ $jmespath($json.parties, '[?affiliation==`External` || affiliation==`Unknown`].emailAddress') }}"
}
]
}
},
"typeVersion": 3.4
},
{
"id": "a4c7450e-5ad6-4e2f-ab72-0f56ae1390c1",
"name": "Combine Salesforce Opp Data",
"type": "n8n-nodes-base.merge",
"position": [
2060,
100
],
"parameters": {
"mode": "combine",
"options": {},
"combineBy": "combineByPosition"
},
"typeVersion": 3
},
{
"id": "8c201ee7-16f7-4c05-8f6c-d3543c4445e0",
"name": "Aggregate Salesforce data",
"type": "n8n-nodes-base.aggregate",
"position": [
2260,
100
],
"parameters": {
"options": {},
"aggregate": "aggregateAllItemData",
"destinationFieldName": "sfOpp"
},
"typeVersion": 1
},
{
"id": "735173b9-cec1-43b3-94c5-13dc368473dd",
"name": "Merge Enriched Transcript Data",
"type": "n8n-nodes-base.merge",
"position": [
2520,
-100
],
"parameters": {
"mode": "combine",
"options": {},
"combineBy": "combineByPosition"
},
"typeVersion": 3
}
],
"pinData": {},
"connections": {
"Get Opp Data": {
"main": [
[
{
"node": "Extract SF Opp Data",
"type": "main",
"index": 0
},
{
"node": "Get account data",
"type": "main",
"index": 0
}
]
]
},
"Get transcript": {
"main": [
[
{
"node": "Join Transcript to String",
"type": "main",
"index": 0
}
]
]
},
"Get account data": {
"main": [
[
{
"node": "Extract SF Opp Data1",
"type": "main",
"index": 0
}
]
]
},
"Join Affiliation": {
"main": [
[
{
"node": "Join conversation",
"type": "main",
"index": 0
}
]
]
},
"Extract Call Data": {
"main": [
[
{
"node": "Merge call and transcript Data",
"type": "main",
"index": 1
}
]
]
},
"Join conversation": {
"main": [
[
{
"node": "Get External Attendees Emails",
"type": "main",
"index": 0
},
{
"node": "Aggregate Gong Call Transcript",
"type": "main",
"index": 0
}
]
]
},
"Extract SF Opp Data": {
"main": [
[
{
"node": "Combine Salesforce Opp Data",
"type": "main",
"index": 0
}
]
]
},
"Extract SF Opp Data1": {
"main": [
[
{
"node": "Combine Salesforce Opp Data",
"type": "main",
"index": 1
}
]
]
},
"Execute Workflow Trigger": {
"main": [
[
{
"node": "Get transcript",
"type": "main",
"index": 0
},
{
"node": "Retrieve detailed call data",
"type": "main",
"index": 0
}
]
]
},
"Aggregate Salesforce data": {
"main": [
[
{
"node": "Merge Enriched Transcript Data",
"type": "main",
"index": 1
}
]
]
},
"Join Transcript to String": {
"main": [
[
{
"node": "Merge call and transcript Data",
"type": "main",
"index": 0
}
]
]
},
"Combine Salesforce Opp Data": {
"main": [
[
{
"node": "Aggregate Salesforce data",
"type": "main",
"index": 0
}
]
]
},
"Retrieve detailed call data": {
"main": [
[
{
"node": "Extract Call Data",
"type": "main",
"index": 0
}
]
]
},
"Get External Attendees Emails": {
"main": [
[
{
"node": "Get Opp Data",
"type": "main",
"index": 0
}
]
]
},
"Aggregate Gong Call Transcript": {
"main": [
[
{
"node": "Merge Enriched Transcript Data",
"type": "main",
"index": 0
}
]
]
},
"Merge Enriched Transcript Data": {
"main": [
[
{
"node": "Isolate Notion Data",
"type": "main",
"index": 0
}
]
]
},
"Merge call and transcript Data": {
"main": [
[
{
"node": "Join Affiliation",
"type": "main",
"index": 0
}
]
]
}
}
}Workflow n8n Salesforce, enrichissement de données : pour qui est ce workflow ?
Ce workflow s'adresse aux équipes commerciales et aux responsables CRM dans les entreprises utilisant Salesforce. Il est particulièrement utile pour les organisations de taille moyenne à grande qui cherchent à optimiser la gestion de leurs données clients et à automatiser leurs processus de vente.
Workflow n8n Salesforce, enrichissement de données : problème résolu
Ce workflow résout le problème de la gestion inefficace des données clients en automatisant l'enrichissement des informations sur les opportunités. En éliminant les tâches manuelles de collecte et de mise à jour des données, il réduit les risques d'erreurs et permet aux équipes de se concentrer sur des tâches à plus forte valeur ajoutée. Les utilisateurs bénéficient d'une vue d'ensemble plus précise et à jour de leurs interactions avec les clients, ce qui améliore la prise de décision et la stratégie commerciale.
Workflow n8n Salesforce, enrichissement de données : étapes du workflow
Étape 1 : Le workflow est déclenché par un événement spécifique.
- Étape 1 : Les données d'appel sont récupérées via une requête HTTP.
- Étape 2 : Les transcriptions d'appels sont extraites et jointes à d'autres données.
- Étape 3 : Les informations sur les opportunités Salesforce sont récupérées.
- Étape 4 : Les données sont agrégées et enrichies pour fournir une vue complète.
- Étape 5 : Les informations finales sont fusionnées pour une utilisation optimale.
Workflow n8n Salesforce, enrichissement de données : guide de personnalisation
Pour personnaliser ce workflow, commencez par modifier l'URL de la requête HTTP pour qu'elle pointe vers votre API spécifique. Vous pouvez également ajuster les paramètres des nœuds pour récupérer des données spécifiques selon vos besoins. Pensez à sécuriser vos appels API en ajoutant des authentifications nécessaires. Si vous souhaitez intégrer d'autres outils, explorez les nœuds disponibles dans n8n pour des intégrations supplémentaires. Enfin, surveillez le flux en ajoutant des nœuds de journalisation pour suivre les performances et les erreurs potentielles.