Now inviting automation leaders: publish your playbook as a skill, under your own name. Publish yours →
Automation Skills
All skills/n8n data tables official/DEDUP_PATTERNS
Reference · n8n data tables official

DEDUP_PATTERNS

Part of n8n data tables official. Install the skill and your agent reads this page when it needs the depth.

Dedup patterns

"Have we processed this before?" is one of the most common workflow needs, and most of the time the answer doesn't need a Data Table. The Remove Duplicates node has a built-in mode for it: a one-node solution with an internal store. Data Tables earn the slot only when the dedup state needs to do more than answer "seen / not seen."

Default: Remove Duplicates node

For plain "seen this exact value before?" with no associated data:

{
    type: 'n8n-nodes-base.removeDuplicates',
    parameters: {
        operation: 'removeItemsSeenInPreviousExecutions',
        dedupeValue: '={{ $json.entryId }}',
        options: {
            historySize: 10000,
        },
    },
}

Fits when:

When Data Tables earn the slot

Reach for a Data Table when you need any of:

When that bar is met, pick one of three Data-Table patterns by the branch behavior you want.

Pattern 1: upsert (cleanest)

For "first time → insert, subsequent → update" with no branching:

[Source: { arxivId, ... }]
   ↓
[Data Table Upsert: matchType allConditions, filter arxivId eq <id>, columns ...]
   ↓
[Continue with the inserted/updated row's id]

Upsert returns id, createdAt, updatedAt whether insert or update, so downstream doesn't need to know which.

When wrong:

Pattern 2: rowNotExists + Insert (skip duplicates)

To skip processing for existing rows:

[Source: { arxivId, ... }]
   ↓
[Data Table rowNotExists: filter arxivId eq <id>]
   ↓ (only new items pass through)
[Process: download, summarize, etc.]
   ↓
[Data Table Insert: { arxivId, ... }]

rowNotExists filters input, and existing rows drop silently.

When wrong:

Pattern 3: Get + IF (full control)

For both branches, "process new" AND "return existing":

[Source: { arxivId, ... }]
   ↓
[Data Table Get: filter arxivId eq <id>, limit 1, alwaysOutputData=true]
   ↓
[IF: $json.id exists?]
   ├── Yes (already processed) → [Return existing row's data]
   └── No (new) → [Process] → [Data Table Insert] → [Return new row's data]

Two notes:

Pattern decision tree

Need to dedup?
├── Plain "seen this value?" with no metadata, no TTL, fits in ~10k history?
│   └── Default: Remove Duplicates node, no Data Table
│
└── Need queryable state, row-level logic, TTL, or per-tenant namespacing?
    ├── Want "skip duplicates" (no work on existing)?     → Pattern 2: rowNotExists + Insert
    ├── Want "first-time insert, subsequent update"?      → Pattern 1: upsert
    └── Want both branches (process new, return cached)?  → Pattern 3: Get + IF + same-shape branches

Idempotency keys

For webhook workflows safe under retries:

[Webhook receives X-Request-Id header]
   ↓
[Data Table Get: filter requestId eq <id>, limit 1, alwaysOutputData=true]
   ↓
[IF: row exists?]
   ├── Yes → [Respond with cached response stored on the row]
   └── No  → [Process]
              ↓
            [Data Table Insert: { requestId, responseBody, ... }]
              ↓
            [Respond with the response]

Two design choices:

  1. Store response or just marker? Storing lets you serve the same answer on retry (full idempotency). Marker-only suffices when clients retry only to confirm receipt.
  2. TTL? Markers shouldn't live forever. Run a daily cleanup deleting rows where createdAt < now - <retry window>.

Volume notes

Cross-references

Publish your skill

Copy this prompt into Claude Code, Codex or any agent. It walks you through your first skill in about 20 minutes, with you as the author.

Click to copy.