De-Dupe shape
Introduction
The de-dupe shape can be used to handle duplicate records found in incoming payloads. It can be used in three modes:
Filter. Filters out duplicated data so only new data continues through the flow.Track. Tracks new data but does not check for duplicated data.Filter & track. Filters out duplicated data and also tracks new data.
A process flow might include a single de-dupe shape set to one of these modes (e.g. filter & track), or multiple de-dupe shapes at different points in a flow, with different behaviours.
Need to know
Tracked
de-dupedata is retained for 90 days after it's added to a data pool.Tracked
de-dupedata can be interrogated via the tracked data page - by default it's available here for 15 days.By default, the
de-dupeshape is not atomic - as such we advise against multiple process flows attempting to update the same data pool at the same time. Where you can't avoid this, enable atomic on the shape.The
de-dupeshape works with incoming payloads from a connection shape, and also from a manual payload, API call, or webhook.JSON and XML payloads are supported.
How it works
The de-dupe shape is configured with a behaviour, a data pool, and a key:

Behaviour
As noted previously, the de-dupe shape can be used in three modes, which are summarised below.
Filter
Remove duplicate data from the incoming payload so only new data continues through the flow. New data is NOT tracked.
Track
Log each new key value received in the data pool.
Filter & track
Remove duplicate data from the incoming payload AND log each new key value received.
Data pools
Data pools are created in general settings and are used to organise de-dupe data. Once a data pool has been created it becomes available for selection when configuring a de-dupe shape for a process flow.
When data passes through a de-dupe shape which is set for tracked behaviour, the value associated with the key field for each new record is logged in the data pool. So, the data pool will contain all unique key field values that have passed through the shape.
You can have multiple de-dupe shapes (either in the same process flow or in different process flows) sharing the same data pool. Typically, you would create one data pool for each entity type that you are processing. For example, if you are syncing orders via an 'orders' endpoint and products via a 'products' endpoint, you'd create two data pools - one for orders and another for products.
Key field
The key field is the data field that should be used to match records. This would typically be some sort of id that uniquely identifies payload records - for example, an order id if you're processing orders, a customer id if you're processing customer data, etc.
Atomic
By default, a de-dupe shape works through the whole payload and then writes the new key values to the data pool in one go, at the end of the step. This is the fastest approach, and it's fine when a data pool is only ever written to by one process flow at a time.
It becomes a problem when two flows share a data pool and run concurrently. Between one flow reading the data pool and writing its results back, the other flow can read the same pool and see the same values as new - so the same record passes through both flows as though it had never been seen.
Enabling atomic closes that gap. Each key value is checked and recorded in the data pool at the moment it's encountered, rather than in bulk at the end of the step, so a value tracked by one flow is immediately visible to any other flow using the same data pool.
Atomic off (default)
The payload is processed, then all new key values are written to the data pool together at the end of the step.
Atomic on
Each key value is checked and written to the data pool as it's encountered.

How duplicate data is handled
When duplicate data is identified it is removed from the payload however, exactly what gets removed depends on the configured key field.
If your given key field is a top-level field for a simple payload, the entire record will be removed. However, if the payload structure is more complex and the key field is within an array, then duplicates will be removed from that array but the parent record will remain.
Let's look at a couple of examples.
More information
Last updated
Was this helpful?

