In this tutorial we will connect Friendly with Pipedrive by using n8n. If you want to push someone into Pipedrive, you can do it by (Push to integration) Campaign action in Friendly.
If you would like to have your contacts updated in Pipedrive, you can add an additional webhook to Pipedrive for updating contacts.
0. Preparations
Have your pipedrive credentials ready for N8N
1. Set up a webhook trigger in N8N
Choose the webhook trigger and open the node.
Click on webhook URL to reveal the URL. Select the POST method.
2. Create the webhook in Friendly
Go to the webhooks in Friendly by clicking on the gear sign and choose webhooks.
Click on New.
Before you click on 'Send Test Payload', you have to make N8N listen. Click on the Execute Node button to start listening. Now you can Send the Payload in Friendly.
3. Search for the Pipedrive contact id
Now Friendly sends an example contact update event which will look like this:
Now close this window and add Pipedrive as the next node:
Now choose your credentials, and fill out the fields. We will do a search for a contacts.
Then click on the gears by the Term field:
Choose Add expression, and click on the unfolding links by Webhooks as follows:
You managed to grab the email address, good job.
You can see the example data, once you close this window:
Now execute the Node, and recieve back something like this:
4. Update contact
Now we can continue building our function. Let's clos this and add another Pipedrive as next step.
I suggest you rename this new Pipedrive to avoid future confusion. Fill out the settings to make an update. Then click on the gear next to the person ID.
Now we need to open the links and find our ID. Looks like this:
Now let's add more info tho the updated conact. close this and choose Add Field.
Here again we will open the links, and choose email - value. Something like this will be filled out on the right side:
{{$node["Webhook"].json["body"]["mautic.lead_post_save_update"][0]["contact"]["fields"]["core"]["email"]["value"]}}
We can add one more field, called Name. In order to get firstname and lastname, we would need to get both values separated by a space and fill out as an expression. Will look like this:
{{$node["Webhook"].json["body"]["mautic.lead_post_save_update"][0]["contact"]["fields"]["core"]["firstname"]["value"]}} {{$node["Webhook"].json["body"]["mautic.lead_post_save_update"][0]["contact"]["fields"]["core"]["lastname"]["value"]}}
Once you click on executing the node, you will get a success report on updating that person in PD.
Now activate and save your node!
Enjoy!
5. Shortcut? Code to paste into your N8N:
{
"nodes": [
{
"parameters": {
"httpMethod": "POST",
"path": "938caff1-031c-44a5-9533-9cf965d7f40c",
"options": {}
},
"name": "Webhook",
"type": "n8n-nodes-base.webhook",
"typeVersion": 1,
"position": [
570,
310
],
"webhookId": "938caff1-031c-44a5-9533-9cf965d7f40c"
},
{
"parameters": {
"resource": "person",
"operation": "search",
"term": "={{$node[\"Webhook\"].json[\"body\"][\"mautic.lead_post_save_update\"][0][\"contact\"][\"fields\"][\"core\"][\"email\"][\"value\"]}}",
"additionalFields": {}
},
"name": "Pipedrive",
"type": "n8n-nodes-base.pipedrive",
"typeVersion": 1,
"position": [
770,
310
],
"credentials": {
"pipedriveApi": ""
}
},
{
"parameters": {
"resource": "person",
"operation": "update",
"personId": "={{$node[\"Pipedrive\"].json[\"id\"]}}",
"updateFields": {
"email": [
"={{$node[\"Webhook\"].json[\"body\"][\"mautic.lead_post_save_update\"][0][\"contact\"][\"fields\"][\"core\"][\"email\"][\"value\"]}}"
],
"name": "={{$node[\"Webhook\"].json[\"body\"][\"mautic.lead_post_save_update\"][0][\"contact\"][\"fields\"][\"core\"][\"firstname\"][\"value\"]}} {{$node[\"Webhook\"].json[\"body\"][\"mautic.lead_post_save_update\"][0][\"contact\"][\"fields\"][\"core\"][\"lastname\"][\"value\"]}}"
}
},
"name": "Pipedrive Update",
"type": "n8n-nodes-base.pipedrive",
"typeVersion": 1,
"position": [
970,
310
],
"credentials": {
"pipedriveApi": ""
}
}
],
"connections": {
"Webhook": {
"main": [
[
{
"node": "Pipedrive",
"type": "main",
"index": 0
}
]
]
},
"Pipedrive": {
"main": [
[
{
"node": "Pipedrive Update",
"type": "main",
"index": 0
}
]
]
}
}
}
Do you have any questions? We are happy to help you via π§ email, βοΈ phone and π©βπ» video calls.
Click here to go back to the main help page:
Friendly Automate