Skip to main content

Complete Lookup-Uniq

Complete Lookup-Uniq adds an ID mapping to a lookup and marks a value as processed in a Uniq collection in one step. It is the operation behind the Data Mapping Pattern when you also need the Do-Once Pattern: the moment a record is created in the target system, you record both "this source ID maps to this target ID" and "this record has been handled".

In n8n it lives under the Advanced resource.

When to use it

Use it at the end of a sync branch, right after the target system has returned the new ID. One node call replaces two (Add ID mappings to a lookup, then Add value to a Uniq), and the two writes happen together, so a workflow that stops between them cannot leave a mapping without its processed marker.

Configuration

ParameterTypeRequiredDescription
Lookup Collection NameStringYesLookup to add the mapping to. Letters, numbers, hyphens and underscores, up to 100 characters.
Left ValueStringYesThe ID or key from the first system.
Right ValueStringYesThe matching ID or key from the second system.
Uniq Collection NameStringYesUniq collection that tracks processed values. Same naming rules as above.
Uniq ValueStringYesThe value to mark as processed, up to 255 characters (an order number, an email, a record ID).
MetadataJSONNoUnder Advanced Settings. Stored with the Uniq value.

Both collections must exist. Create them with Create a new lookup collection and Create a new Uniq collection, or from the dashboard.

Example

An order arrives from Shopify, is created in the ERP, and the ERP returns SO/1042:

ParameterValue
Lookup Collection Nameorders
Left Value{{ $json.shopifyOrderId }}
Right Value{{ $json.erpOrderNumber }}
Uniq Collection Nameorders-synced
Uniq Value{{ $json.shopifyOrderId }}

Response

{
"success": true,
"lookupResult": {
"id": "lookup_value123",
"left": "5678901234",
"right": "SO/1042",
"createdAt": "2024-01-01T10:00:00.000Z"
},
"uniqResult": {
"id": "uniq_value456",
"value": "5678901234",
"metadata": {},
"createdAt": "2024-01-01T10:00:00.000Z"
}
}

Errors

If either write fails the node raises an error with the HTTP status from the server, for example 409 when the lookup already holds that left value and the collection does not allow duplicates, or 402 when the licence limit is reached (the message includes the renewal link). With Continue on Fail enabled the item carries an error object with status, message, code and details instead of stopping the workflow.