Articles in this section

Configure the Concurrency ID lock template

When a connection's concurrency level is higher than 1, integrator.io can process two updates to the same record at the same time, and the one that started first doesn't always finish first. The Concurrency ID lock template on an import keeps updates to the same record in the order they arrived, while unrelated records still run in parallel. This article explains when you need the template and how to set it.

When you need a lock template

A customer updates the phone number in their profile, notices a typo, and corrects it a moment later. Both updates reach the same flow run. With a concurrency level above 1, the two updates can run in parallel, and if the first one finishes last, the record keeps the wrong phone number.

You need a lock template only when the same record can be updated more than once in quick succession. If each record is created once and never revised, raising concurrency is safe on its own. For how concurrency works, see Manage connection concurrency and rate limits.

How the lock template works

The template builds a key for each record. Records with the same key value run one at a time, in the order they arrived, so the latest update is always applied last. Records with different key values keep running in parallel.

If you don't set a template, the import uses the record's trace key.

Set the Concurrency ID lock template

Prerequisites: You have Admin or Manage all access to the account, or Manage access to the integration that contains the import.

  1. Open the import.
  2. In the Advanced section, find Concurrency ID lock template.
  3. Enter a handlebars expression, in triple braces, that returns the value to use as the key. For example, {{{record.customer_id}}} processes updates for each customer in the order they were received.
  4. Select Save.

Build the template in the editor

If one field isn't enough to identify a record, select the handlebars icon next to Concurrency ID lock template. The Build concurrency ID lock template editor opens.

  1. In Handlebars template, enter your expression.
  2. In Resources available for your handlebars template, paste or edit sample data that represents your records.
  3. Select Preview.
  4. Check that the preview pane shows the key you expect for the sample record.
  5. Select Save.