Uniqs Actions
Uniqs actions help you prevent duplicate processing and ensure data consistency by tracking unique values. This is essential for implementing the Do-once Pattern in your workflows.
Available Operations
Uniq Actions
- Add values to a Uniq collection - Add one or more values to track them
- Check if values exist in a Uniq collection - Verify if values have been processed
- Get all Uniq values - Retrieve all tracked values from a collection
- Remove values from a Uniq collection - Remove specific values from tracking
Uniq Collection Actions
- Create a new Uniq collection - Set up a new collection for tracking
- List all Uniq collections - View all available collections
- Get Uniq collection information - Retrieve details about a specific collection
Add values to a Uniq collection
Add one or more values to a uniq collection to track them.
Add Uniq Values Configuration
| Parameter | Type | Required | Description |
|---|---|---|---|
| Uniq Name | String | Yes | Unique name for the uniq |
| Value | String | Yes | Value to add to the uniq |
| Expires In | String | No | TTL for the value (e.g., "1h", "7d") |
Add Uniq Values Example
{
"value": "ORDER_12345",
"metadata": {
"processedAt": "2024-01-01T10:00:00Z",
"status": "completed"
}
}
Add Uniq Values Response
{
"success": true,
"data": {
"id": "value123",
"value": "ORDER_12345",
"metadata": {
"processedAt": "2024-01-01T10:00:00Z",
"status": "completed"
},
"createdAt": "2024-01-01T10:00:00.000Z"
}
}
Use Cases
- Order Processing: Mark orders as processed
- Email Deduplication: Track sent emails
- File Processing: Mark files as processed
- Data Import: Track imported records
Check if values exist in a Uniq collection
Verify if one or more values exist in a uniq collection.
Check Uniq Values Configuration
| Parameter | Type | Required | Description |
|---|---|---|---|
| Uniq Name | String | Yes | Name of the uniq to check |
| Value | String | Yes | Value to check for |
Check Uniq Values Example
{
"value": "ORDER_12345"
}
Check Uniq Values Response
{
"success": true,
"data": {
"exists": true,
"value": "ORDER_12345",
"foundAt": "2024-01-01T10:00:00.000Z"
}
}
Use Cases
- Duplicate Prevention: Check before processing
- Status Verification: Verify if item was processed
- Conditional Logic: Make decisions based on existence
- Audit Trails: Track processing history
Remove values from a Uniq collection
Remove one or more values from a uniq collection.
Remove Uniq Values Configuration
| Parameter | Type | Required | Description |
|---|---|---|---|
| Uniq Name | String | Yes | Name of the uniq |
| Value | String | Yes | Value to remove |
Remove Uniq Values Example
{
"value": "ORDER_12345"
}
Remove Uniq Values Response
{
"success": true,
"data": {
"removed": true,
"value": "ORDER_12345",
"removedAt": "2024-01-01T10:00:00.000Z"
}
}
Use Cases
- Data Cleanup: Remove old entries
- Status Updates: Mark items as unprocessed
- Error Recovery: Remove failed items
- Manual Overrides: Allow reprocessing
Get all Uniq values
Retrieve all values from a uniq collection.
Get All Uniq Values Configuration
| Parameter | Type | Required | Description |
|---|---|---|---|
| Uniq Name | String | Yes | Name of the uniq |
| Limit | Number | No | Maximum number of members to return |
| Offset | Number | No | Number of members to skip |
Get All Uniq Values Example
{
"page": 1,
"limit": 100
}
Response
{
"success": true,
"data": {
"values": [
{
"id": "value123",
"value": "ORDER_12345",
"metadata": {
"processedAt": "2024-01-01T10:00:00Z"
},
"createdAt": "2024-01-01T10:00:00.000Z"
}
],
"pagination": {
"page": 1,
"limit": 100,
"totalCount": 1,
"totalPages": 1,
"hasNextPage": false,
"hasPreviousPage": false
}
}
}
Use Cases
- Audit Reports: List all processed items
- Data Analysis: Analyze processing patterns
- Cleanup Operations: Identify old entries
- Monitoring: Track uniq growth
Create a new Uniq collection
Set up a new uniq collection for tracking values.
Create Uniq Collection Configuration
| Parameter | Type | Required | Description |
|---|---|---|---|
| Collection Name | String | Yes | Unique name for the collection |
Create Uniq Collection Example
{
"name": "processed-orders",
"description": "Track processed order IDs to prevent duplicates"
}
Create Uniq Collection Response
{
"success": true,
"data": {
"id": "uniq123",
"name": "processed-orders",
"description": "Track processed order IDs to prevent duplicates",
"appId": "app123",
"createdAt": "2024-01-01T10:00:00.000Z",
"updatedAt": "2024-01-01T10:00:00.000Z"
}
}
List all Uniq collections
View all available uniq collections.
List Uniq Collections Configuration
No parameters required.
List Uniq Collections Example
{}
List Uniq Collections Response
{
"success": true,
"data": {
"items": [
{
"id": "uniq123",
"name": "processed-orders",
"description": "Track processed order IDs to prevent duplicates",
"appId": "app123",
"createdAt": "2024-01-01T10:00:00.000Z",
"updatedAt": "2024-01-01T10:00:00.000Z"
}
],
"pagination": {
"page": 1,
"limit": 20,
"offset": 0,
"totalCount": 1,
"totalPages": 1,
"hasNextPage": false,
"hasPreviousPage": false
}
}
}
Get Uniq collection information
Retrieve details about a specific uniq collection.
Get Uniq Collection Information Configuration
| Parameter | Type | Required | Description |
|---|---|---|---|
| Collection Name | String | Yes | Name of the collection |
Get Uniq Collection Information Example
{
"id": "uniq123"
}
Get Uniq Collection Information Response
{
"success": true,
"data": {
"id": "uniq123",
"name": "processed-orders",
"description": "Track processed order IDs to prevent duplicates",
"appId": "app123",
"createdAt": "2024-01-01T10:00:00.000Z",
"updatedAt": "2024-01-01T10:00:00.000Z"
}
}
Common Patterns
Do-once Pattern
Implement the do-once pattern to prevent duplicate processing:
- Check if item exists in uniq
- If not exists: Process the item
- Add item to uniq after processing
// Step 1: Check if value exists in uniq
{
"value": "{{ $json.orderId }}"
}
// Step 2: Process if not exists
// (Use IF node with condition: 8kit.data.exists equals false)
// Step 3: Add to uniq after processing
{
"value": "{{ $json.orderId }}",
"metadata": {
"processedAt": "{{ $now }}",
"status": "completed"
}
}
Batch Processing
Process multiple items efficiently:
- Get uniq members to see what's been processed
- Filter out processed items from your batch
- Process only new items
- Add processed items to uniq
Uniq Expiration
Use TTL to automatically clean up old entries:
{
"value": "ORDER_12345",
"metadata": {
"processedAt": "{{ $now }}",
"expiresIn": "7d"
}
}
Examples
Email Deduplication
Prevent sending duplicate emails:
// Check if email was sent
{
"value": "{{ $json.userId }}-{{ $json.emailType }}"
}
// If not sent, send email and add to uniq
{
"value": "{{ $json.userId }}-{{ $json.emailType }}",
"metadata": {
"sentAt": "{{ $now }}",
"emailType": "{{ $json.emailType }}"
}
}
File Processing
Ensure files are processed only once:
// Check if file was processed
{
"value": "{{ $json.filename }}-{{ $json.fileHash }}"
}
// If not processed, process file and add to uniq
{
"value": "{{ $json.filename }}-{{ $json.fileHash }}",
"metadata": {
"processedAt": "{{ $now }}",
"filename": "{{ $json.filename }}",
"fileHash": "{{ $json.fileHash }}"
}
}
Order Processing
Process orders exactly once:
// Check if order was processed
{
"value": "{{ $json.orderId }}"
}
// If not processed, process order and add to uniq
{
"value": "{{ $json.orderId }}",
"metadata": {
"processedAt": "{{ $now }}",
"orderId": "{{ $json.orderId }}",
"status": "completed"
}
}
Next Steps
Ready to explore more actions? Check out:
- Lookups Actions - Map data between systems
- Locks Actions - Coordinate resource access
- Last Updated Actions - Enable incremental polling
- App Info Actions - Monitor system health