Pipedrive automation step-by-step tutorial: assign deals based on their timezone | Pipedrive & Omni CDI deep data series

In the previous post of our Pipedrive series, we walked you through the first of 12 deep data automations included in all Pipedrive implementations with us—regardless of the package or plan. Last time we automated the bulk removal of activities tied to won deals.

Today, we’re tackling another automation. Our goal this time is to automatically assign deals to teams and reps based on their time zones.

This idea came from a client who needed an efficient way to assign deals to teams or individuals based on their time zones.

This article dives into the data pipeline behind the automation and showcases various Pipedrive features, including automatic assignments and automations in action. It’s another part of the Deep Data series, where we explore the capabilities of our custom-built analytics backend for Pipedrive, which is added to every Pipedrive account set up with us, regardless of the plan or package.

Today’s plan: A tour of the Pipedrive backend and its automations

Before we get into the configuration details, let’s first outline the steps for this multi-step automation. Here’s what we’ll build:

  1. New deal creation:
    • The deal’s address is either automatically pulled from the organization or entered manually.
  2. Data pipeline:
    • The deal is processed by a private data pipeline running on your Pipedrive account’s backend, integrated with Pipedrive’s API and webhook.
  3. Timezone enrichment:
    • The pipeline enriches the deal’s timezone based on its address and saves it in the deal’s custom field within milliseconds.
  4. Automatic deal assignment:
    • The enriched timezone triggers another automation to automatically assign the deal based on its timezone.

This tutorial is for those who want to see how things work behind the scenes, or who are considering customizing our integrations for their needs. If you set up Pipedrive accounts with us, you get it from us as a turnkey, done-for-you automation.

The implementation will take the following three phases:

Phase 1: Structuring your Pipedrive account

  • Create Pipedrive custom deal fields to capture timezone and address data.
  • Set up an automation to copy the organization address—necessary for calculating the timezone—into the deal profile upon creation.

Phase 2: Launching the Omni CDI-Pipedrive integration

  • Set up the Omni CDI private pipeline and integrate it with Pipedrive’s webhook and API.
  • Authorize and enable the timezone enrichment logic.
  • Apply the enrichment logic to update Pipedrive data.

Phase 3: Configuring Pipedrive for automated deal assignment

  • Set up enrichment to automatically assign deals to team members based on their dynamically populated timezones.

This integration does not rely on third-party automation tools like Make or Zapier. Instead, it uses a custom-built Pipedrive backend called Omni CDI, which is included with every Pipedrive implementation we set up for our cliens. All you need to do to activate this backend and the automations is set up a Pipedrive account with us.

Phase 1: Structuring your Pipedrive account

Creating timezone and address custom fields

To capture custom data points in Pipedrive, you first need to create custom fields. This step is part of setting up your account structure. If you need more details on building a comprehensive Pipedrive account structure, check out our dedicated article on Pipedrive account structure with over 3,000 words on the topic.

In this automation, we will need two custom fields to capture the deal’s timezone and address.

Let’s start with the timezone custom fields. Here’s how to set it up:

  1. Go to Company Settings.
  2. Click Data Fields.
  3. Select Lead/Deal and then click Custom Field.
  4. Name the field, e.g., Deal Timezone. Optionally, you can add it to a custom field group.
  5. Choose Text (string up to 255 characters) as the field type. You can mark it as important, which will show a yellow dot on the deal page (as outlined in our Pipedrive account structure guide).

Since this field will be automatically managed by the backend data pipeline activated when you sign up for a Pipedrive account with us—along with all the automations it enables—we recommend removing user edit permissions. For the same reason, we advise against enabling it in the deal/lead or project add views. Here’s how the final configuration of the timezone custom field should look.

As a final step, copy the field ID of the newly created field and note it somewhere convenient. Here’s how to find your field ID:

Don’t leave the Data Fields section just yet—we still need to set up the address data field. What type of data field works best here? The answer is simple: an address data field. According to our detailed Pipedrive account structure guide, the Pipedrive address field captures a complete address with Google Maps autocomplete support, allowing you to store all address components (State, City, Zip, etc.) in one field. Exactly what we need!

To set this up, click “Custom Field” again and select “Address.” This time, it’s best to leave editing permissions unchanged so users can manually update the address if needed. Let’s take a look at the configuration for the address custom field.

Just as we did it before, copy the custom field ID again. 

Are your custom fields created? Did you remember to note the custom field ID’s on the side? Perfect! Let’s move on to the next step in enabling this automation.

Building a simple Pipedrive workflow automation to populate deals with the address

Before we can connect Pipedrive to the backend data pipeline, we first need to ensure that the deal address is available in the deal for which we want to derive the timezone. We’ve set up all the custom fields, so now we just need to populate them with real data.

To do this, we’ll use Pipedrive’s built-in workflow automations. These differ from deep data automations in that they don’t rely on an additional data backend but are configured directly in the Pipedrive app interface. 

This automation will be simple. We want to automatically populate the deal’s address custom field with the organization’s address every time a deal is created, as mentioned earlier. The end version of this automation will look as follows.

Let’s walk through how to set this up.

Open your Pipedrive account and click “+ Automation.” You’ll see a blank automation canvas. For the trigger, select Deal Created. Click Trigger, then choose Deal, then Added, and click Apply Trigger.

Now that the trigger is in place, we need to define the condition that must be met before the automation moves to the next step. The condition is that the deal’s organization address must not be empty. Find Deal Organization Address and click Apply Condition.

Next, click the + to add the final step and choose Update Deal Fields. In the list of fields, select Deal Address and click Next.

In the final form, reference the deal object, and for the Deal Address value, choose Deal Organization Address. Click Apply Action.

Make sure this automation runs for all users on your account since it’s a universal process, not specific to any one user. Save it and test if it works.

This example only shows the scenario in which we derive the deal’s address from the organization for simplicity. We can just as easily source it from the person in Pipedrive, external data sources, or even by adding it manually, and the rest of the tutorial would still hold.

With this automation up and running, the first phase of the implementation is complete. Our Pipedrive account is now ready to be connected to the Omni Analytics private data pipeline for timezone enrichment.

Phase 2: Enriching Pipedrive deal data with timezones using Omni private data pipelines

Phase 1 focused on working within Pipedrive. In Phase 2, we’ll primarily work outside the Pipedrive interface, using its robust API and developer documentation to enhance the data.

This phase runs entirely on the Omni CDI backend—a Dockerized customer data infrastructure built by Datomni. We turn on this analytical backend for every customer at no extra cost, provided you set up your Pipedrive account with us. This backend powers 12 advanced data automations available in our Pipedrive implementation packages.

The first two steps for configuring your integration are the same as outlined in the first article of the Pipedrive deep data automation series. Head over to that first article and follow these two steps:

  1. Deploy/turn on your instance of Omni Analytics and configure the Omni Analytics endpoint.
  2. Create an Omni Analytics pipeline to capture Pipedrive events.

The next steps differ slightly and require some additional explanation, which we’ll cover here. Unlike before, we haven’t built entry schemas, but this time we will.

To ensure proper functioning of this pipeline, we need to:

  • Validate that the event includes a non-empty value in the custom field holding the deal address.
  • If a Pipedrive event arrives without this data, the dedicated Omni Analytics pipeline should reject it and stop further processing.
  • Rename the unreadable key ID of the custom field to something more intuitive for easier use.

Here’s how it works:

  • Once the specific key is detected in the payload, the event will go through all required processing steps.
  • After processing, the key will be renamed to the preferred label while preserving its value.

All of this will take just a couple of clicks in your Omni Analytics instance. Let’s implement it!

Open your deployed Omni Analytics instance. First, navigate to Platforms, select Pipedrive, and click Edit Property Names.

Remember when you noted down the IDs for the custom fields you created (one for timezone and one for address)? Now, it’s time to use that information. Add two additional rows to your Pipedrive schema. On the left, enter the custom field IDs, and on the right, add their corresponding cleaned names—for example, raw_timezone_data and raw_address_data. These keys will hold all data associated with the custom field values within your Omni Analytics instance across all Pipedrive-related pipelines. This way, if you have multiple Pipedrive event pipelines in your Omni Analytics instance, you won’t need to recreate the event property protocol each time.

Having completed the previous steps, we’re ready to begin ingesting your Pipedrive event data into your Omni Analytics pipelines. In this implementation, we want your Omni Analytics Pipedrive pipeline to capture two types of events:

  • Deal Created: This handles scenarios where the organization doesn’t have a physical address, requiring manual entry during creation.
  • Deal Updated: This captures events where the deal address is automatically updated upon deal creation or manually updated later.

Capturing these scenarios ensures we record the deal address, whether it’s added manually when creating a new deal, reused from an existing organization address, or updated manually. This guarantees we always derive the latest verified user address’s timezone.

Now that we’ve defined the necessary events, let’s configure the data flow from Pipedrive. Go to your Pipedrive account, navigate to the Tools and Apps section, click on Webhooks, then select + Webhook and choose the standard webhook.

You can choose either Webhook v1 or Webhook v2, as your Omni Analytics instance and Pipedrive event pipelines are set up to work with both versions. For this example, let’s stick with v1. Once selected, click Next.

In the webhook creation wizard, select deal as the event object, and choose update and create as the event actions. You’ll end up creating two webhooks. Both should point to the same endpoint you created in the previous Pipedrive deep data tutorial—you can simply copy the previous endpoint if needed.

This is how your Pipedrive webhook settings should look like once this step is completed.

With all webhooks set up to send authorized events to your Omni Analytics pipeline, it’s time to test data capture and processing. Enable preview mode for GTM Server in Omni Analytics (if you’re unsure how, follow the steps outlined in the first deep data tutorial article), then try sending some events to your GTM Server while in preview mode to ensure everything is working correctly.

We’re capturing enriched Pipedrive events in real time in our private GTM Server instance. As we can see, everything is working.

If you inspect the event payload reaching your GTM Server, you’ll notice it’s nearly empty. This is because we haven’t configured the outgoing event schema yet, so Omni Analytics doesn’t know how to compose your final event payload and what kind of processing to apply to various elements of the payload. Here’s why it matters:

  • Event schema defines which properties and data points should be included in the final event dispatched from Omni Analytics.
  • Intermediate processing includes data generated by validations, enrichments, and checks within the specific pipeline.

While we won’t cover the full range of Omni Analytics features here, we’ll provide a simplified mapping and event schema to meet the goals of this article.

To create your outgoing event schema, go to Mappers in your Omni Analytics, select the event consumer you want the schema applied to (here it’s GTM Server, but it can also be Segment or AWS Lambda), and then add the following event property mappings.

Under the hood, the raw_address_data property maps to the pipeline-level event validation protocol key that includes custom field ID, which then maps to the deal_address as a final event property for dispatch. This property is then read by data clients in the activation layer, managed by the GTM Server.

That’s it for configuring the Omni Analytics instance, Pipedrive webhooks, and everything else needed for the two main layers of each data pipeline we build: data collection and enrichment. Now, we move on to the stage of data activation. Let’s get started!

Using Omni Pipedrive Tag with Monitoring and Identity Resolution for data activation

Now that we have built data schemas and pipelines and begun collecting data, we are ready to start consuming it. In this example, we will use GTM Server. While Omni CDI supports both GTM Server and AWS Lambda in the activation layer, this demonstration focuses exclusively on using GTM Server. Activation with AWS is available upon request in our Pipedrive implementation package at no additional charge.

Just like in the first part of the deep data Pipedrive tutorial series, please note that this section is for illustration purposes only. In a real implementation, we would automatically import all the desired activation components into the GTM container within seconds.

GTM Server Variables

As we did in the first deep data automation tutorial, we will begin by setting up GTM Server variables.

There are two sets of GTM Server variables that need to be created. The first set consists of authorization variables, enabling requests from the GTM Server to Pipedrive and Omni CDI’s geo-enrichment and to Pipedrive API. The second set includes variables that carry deal information, such as deal address and and other key data points.

Let’s start with the authorization set. Set up your Pipedrive account domain and Pipedrive API variables in exactly the same way as in the very first tutorial.

The second authorization variable will be the API Key of the Geolocation service that enriches your Pipedrive deal events. For the API key, use the pipeline access key you’ve configured in your Omni Analytics instance. To do this, open a new variable, copy your pipeline’s Omni Analytics access key, and paste the value here.

The final authorization variable is the ID of the timezone custom field that we’re going to update upon a successful resolution of the deal’s timezone from address. For that, save your timezone custom field ID value as a constant in a dedicated GTM Server variable.

Once you’ve configured your account settings variables, you’ll need to set up a few more variables to carry important deal data.

The first is deal status, which will be dispatched with the key current_status in the event payload, according to our mapping.

Next is the actual address. As per our event property validation protocol and mapping, this value will be reported as deal_address. We need to add this as an event data variable in GTM Server.

Finally, we need to capture the deal ID in a dedicated variable.

Configuring these three values in GTM Server will ensure we capture all the essential information from the incoming request, allowing us to execute the tag properly.

By this point your GTM Server is fully ready to implement Omni Pipedrive Tag. 

GTM Omni Tag setup

With the variables set up, we can now finish configuring the tag. Just a few settings here. Your Omni Tag should already be added to the GTM Server workspace—simply configure it as shown below. If it’s not added follow the steps to import it outlined in another Pipedrive deep data automation article series.

Now, let’s review the tag settings we’ve implemented. For the tag event type, select Update, and for the Tag Object, choose Deal. This script will update deal fields and settings. Next, we’ll configure the Pipedrive API settings. Start by setting up the Pipedrive account domain using the variable you created earlier. Then, enter your Pipedrive API token. Let’s take a look at the initial settings.

When you select the deal update function, you’ll be prompted to enter the variable containing the deal ID. There is nothing else to modify in the main deal payload. Finally, configure timezone enrichment by navigating to the computed custom properties section and locating the timezone enrichment option. Fill in the Geoenrichment API key and the timezone enrichment custom field ID using the variables you’ve created—both are essential for completing this integration.

GTM Omni Tag trigger configuration

We want this script to fire in two scenarios: first, when a deal is created with a non-empty address, meaning the deal’s address is entered during creation. The second scenario occurs when a deal is updated and the address field changes, specifically from empty to filled.

In both cases, we capture the non-null address field and only fire this tag if a valid address is added to the deal data. The Omni script has a built-in address validation mechanism, ensuring it will only execute and trigger timezone enrichment when a valid input is present.

To achieve this, we’ll set up two triggers: Deal Updated with Non-empty Address and Deal Created with Non-Empty Address.

Here’s the final configuration of our Omni tag triggers.

Phase 3: Automated deal assignment based on the Omni CDI deep data enrichment

To recap how far we’ve come, deals are first enriched with an address through Pipedrive automation. This triggers a private data pipeline that assigns a timezone based on the address.

The final step is to use this data for automating deal assignments by setting up distribution rules based on timezone custom fields.

For this example, let’s assume we have two sales teams: APAC (Asia-Pacific) and EMEA (Europe, the Middle East, and Africa). We use the Region/City TZ format (IANA Time Zone Format), but this format can be easily changed for your implementation.

The classification logic is as follows:

  • The APAC team receives deals with the following timezone regions: Asia, Australia, Indian, and Pacific.
  • The EMEA team receives deals with timezones in Africa, Europe.

To configure deal routing, we’ll use Pipedrive’s automatic assignment feature, which is well-suited for this task. Proper deal routing is a cornerstone of our Pipedrive implementations, ensuring maximum efficiency. Automatic assignments can be configured with any custom or standard fields you’ve set up, and the key to maximizing their value lies in having a well-structured Pipedrive account setup.

Let’s dive into the implementation:

  • Go to the three-dot menu, click Automatic assignment, and then select Rule to create an assignment rule.
  • We want this assignment to trigger for deal updates only. The rule will activate whenever a deal reaches the Allocation stage in the pipeline, provided certain conditions are met.
  • For assignment conditions, we’ll select the deal’s timezone.

Now, we need to implement the logic that ensures deals are routed to the appropriate owners. Here’s the final way we’ve configured the deal assignment feature for the EMEA team.

This step completes the setup!

Automate timezone assignment in Pipedrive: video walkthrough

The videos below demonstrate the entire pipeline executed instantly in the Pipedrive account backend.

Here’s what happens in the background of your Pipedrive account:

  1. A new deal is added in Pipedrive.
  2. Pipedrive’s workflow automation populates the deal’s custom field with the organization’s address.
  3. Changes to the deal data trigger a Pipedrive webhook, sending an event to Omni Analytics.
  4. Omni Analytics captures, authorizes, validates, enriches, structures, and dispatches the event to Omni Activation.
  5. Omni Activation responds to specific triggers, executing the Omni Pipedrive Tag, which enriches the clean event data, including deriving the timezone.
  6. The deal is updated via the Pipedrive API.
  7. Once updated, Pipedrive’s automated assignment routes the deal to the appropriate owner for processing.

This powerful automation saves your sales team tens of hours annually by eliminating manual deal management and reducing errors. It is available for free in our Pipedrive implementation package—all you need to do is set up your account with us.

Ready to enable this automation for you Pipedrive account? Schedule a call with us.

This pipeline and automation is just one example of the Pipedrive data-driven implementation in action. We set up and initiate this backend for every Pipedrive account set up through us, enabling you to have an advanced Pipedrive setup without the high implementation or running costs or external third party tools. Reclaim the time and efficiency lost on mundane tasks like this—contact us today to enable this automation!

Photo by Pawel Czerwinski on Unsplash