Keyboard shortcuts

Press ← or → to navigate between chapters

Press S or / to search in the book

Press ? to show this help

Press Esc to hide this help

Items

Data moves between nodes as lists of items. Understanding the item model explains most of how nodes and expressions behave.

Shape of an item

{
  "json": { "id": 42, "email": "[email protected]", "tags": ["vip"] },
  "binary": {
    "invoice": {
      "mimeType": "application/pdf",
      "fileName": "invoice-42.pdf",
      "fileExtension": "pdf",
      "fileSize": 48213
    }
  },
  "pairedItem": { "item": 0 }
}
  • json is always an object. A node that produces a bare value (a string, a number, an array) wraps it, for example as { "data": ... }. Expressions read it as $json.
  • binary maps property names to files. The file content is stored outside the item (see below); the item carries the metadata and a content reference. Expressions read it as $binary.
  • pairedItem records which input item this item was derived from. See Paired items.
  • error is set on items routed to the regular output when a node fails with onError: continueRegularOutput. See Error handling.

Ports and runs

A node receives one list of items per input port and returns one list per output port. Most nodes have one input and one output. IF has two outputs (true, false), Switch has one per rule plus an optional fallback, Merge has two or more inputs, and a node with onError: continueErrorOutput gains an error output.

The node receives the whole list at once, not item by item. Most nodes then process each item independently and emit one output item per input item. Others work on the whole list: Aggregate combines all items into one, Split Out turns one item into many, Limit keeps the first N, Sort reorders.

A node can run more than once in one execution, for example inside a loop. Each run is recorded separately with a run index, available in expressions as $runIndex.

Nodes that emit nothing

If a node outputs zero items on a port, the nodes connected to that port do not run for that branch. For example, an IF node whose condition is false for every item emits nothing on its true output, so the true branch is skipped.

Set Always output data on a node to emit a single empty item ({ "json": {} }) instead of nothing, which keeps the branch running.

Execute once

With Execute once enabled, a node processes only the first input item and ignores the rest. Use it for a step that should happen once per execution regardless of how many items arrive, such as sending one summary message.

Paired items

Every output item records the input item (or items) it came from. Tappet uses this lineage to answer the question “which item of node X corresponds to the item I am processing now?”:

Fetch orders (3 items)  ->  Filter (2 items)  ->  Send email
     o0, o1, o2              f0<-o0, f1<-o2        for f1: $('Fetch orders').item is o2
  • Nodes that map one input item to one output item set the pairing automatically.
  • Nodes that combine items (Aggregate, Merge by fields) record several parents.
  • Code nodes can set pairedItem on the items they return. If they do not, Tappet infers it when the output has the same length as the input; otherwise the lineage is missing.

$('Node').item follows this lineage. When it is ambiguous (several possible ancestors) or missing, the expression fails with a paired-item error. Use $('Node').first(), .last(), .all() or an explicit index in that case.

Binary data

Files (downloads, uploads, attachments, webhook uploads) are stored as content-addressed blobs:

  • Files up to 64 KB (TAPPET_BINARY_INLINE_MAX) are kept inline with the item.
  • Larger files are written to the blob store (${TAPPET_DATA}/blobs or S3) and streamed when a node reads or uploads them, so a 2 GB file never has to fit in memory.
  • Identical content is stored once. Blobs are reference-counted and removed when the executions that use them are pruned.

Nodes refer to a file by its binary property name (often data). Nodes that read files take a parameter naming the property; nodes that produce files let you choose the property name.

Large outputs

A node output larger than 2 MB of JSON (TAPPET_JSON_SPILL_THRESHOLD) is moved to the blob store and loaded back when a later node or the UI needs it. A single node output is limited to 1,000,000 items (TAPPET_MAX_ITEMS_PER_OUTPUT).