Skip to content
  • There are no suggestions because the search field is empty.

Linking people to an existing organisation in Pipedrive using N8N

Learn how to set up an N8N workflow that automatically links people records to their matching company record in Pipedrive, using either the Firmable domain or the organisation name as the lookup.

Prerequisites

Before building this workflow, make sure:
  • You are on a Small Teams or Teams Pro plan with Firmable.  
  • You have the Admin or Integration role permission on Firmable and the Admin role in Pipedrive. 

There are two common situations you may need to handle when linking contacts to companies in Pipedrive. Choose the scenario that matches how your data is set up.

Scenario 1: Contacts pushed from Firmable

Map people records to company records that have already been pushed from Firmable, using the company domain (FQDN) as the identifier.

Scenario 2: Companies already in your CRM

Map people records to organisations that already exist in Pipedrive, using the company name stored in a custom field as the lookup.

Best practice: Ideally, push the company record before pushing contacts. This way, the FQDN is already mapped on the organisation record and the lookup will reliably find a match.
 

Scenario 1: Matching by domain (Firmable-pushed companies)

This is the recommended approach. It uses the company's domain (FQDN) as a reliable, unique identifier to find the matching organisation in Pipedrive.

Workflow steps

  • Trigger on person creation: use the Pipedrive trigger node, configured to fire when a new person record is created.
  • Get the person record: retrieve the full person details using a Get a Person node.
  • Extract the domain from the email address: use a Code node to parse the email and return just the domain portion.
  • Check if the domain exists: use an If node to ensure the domain value is not empty before proceeding.
  • Search Pipedrive for the organisation: search using the custom field mapped to FQDN (or Firmable's company ID if you mapped that instead).
  • Update the person record: link the person to the matching organisation by setting the org_id field.
Pipedrive trigger
Pipedrive trigger node configuration in N8N

Configure the Pipedrive trigger to fire on person creation events.

Get a person
Get a Person node in N8N

Retrieve the full person record to access their email address for domain extraction.

Extracting the domain from the email address

This Code node extracts the domain portion from the person's email address, which is then used to search for the matching organisation in Pipedrive.

Code node
Code node extracting domain from email address

The Code node parses the person's email address and appends the domain to the item payload.

 
JavaScript
// Extract the domain from the person's email address
const items = $input.all();

const updatedItems = items.map((item) => {
const email = item?.json?.Email[0]?.value;
const domain = email?.substring(email?.indexOf("@") + 1);
item.json.domain = domain;
return item;
});

return updatedItems;
If node, check domain exists
If node checking domain is not empty

The If node checks whether a domain value exists before attempting the organisation search.

Update a person
Update a person node — linking to organisation

The Update a Person node sets the org_id field using the ID returned from the organisation search.

Scenario 2: Matching by company name (existing CRM companies)

Use this approach when company records already exist in Pipedrive and were not pushed from Firmable. The lookup is based on the organisation name stored in a custom field on the people record. 

Note: This flow can be less reliable because it matches on company name, which is not a guaranteed unique identifier. There may be better identifiers available depending on your customer's data setup , it's worth investigating before building this workflow at scale.

 

Workflow steps

  • Map the company name to the people record using a custom field before this workflow runs.
  • Trigger on person creation use the Pipedrive trigger node.
  • Search Pipedrive for an organisation using the company name from the custom field.
  • Update the person record with the matching organisation ID.
Search an organisation by name
Search organisation by name in Pipedrive

This node searches Pipedrive for an organisation matching the company name. Note: this assumes the company already exists in Pipedrive.

Update a person: link to organisation
Update a person node to link organisation

Map the organisation ID returned from the search to update the person record and create the link.

For customers with a mix of Firmable-pushed companies and existing CRM data, consider building both flows and using an If node at the start to route records based on whether a Firmable domain field is populated.

We hope this article has helped you set up people-to-organisation linking in Pipedrive. If you have any other questions, don't hesitate to contact us at support@firmable.com.