core.base64

Base64 (core.base64)

Convert a binary payload to a base64 string and back — the bridge between file attachments and APIs that want files inline in JSON.

Parameters

ParameterTypeDefaultDescription
operationencode | decodeencodebinary → string, or string → binary.
binary_fieldproperty namedataencode: which attachment to read.
dataexpressiondecode: the base64 string, e.g. {{ $json.base64 }}. Data URIs (data:image/png;base64,…) are accepted.
file_name / mime_type / output_fieldstringfile / application/octet-stream / datadecode: metadata for the produced binary.

Behavior

Encode adds to each item's json: base64, file_name, mime_type, size — the original json fields stay. Decode turns the string back into a real binary property downstream nodes (Drive upload, Gmail attach, HTTP multipart) can use.

Encode → decode round-trips byte-for-byte. Surrounding whitespace in the input string is tolerated; a data-URI prefix is stripped automatically.

Quirks & tips

  • Encode's field name is forgiving: with exactly one attachment on the item, any binary_field value finds it. With several, a wrong name is a clean error listing what's actually there.
  • Invalid base64 on decode is a clean per-item error naming the node.
  • Base64 grows data ~33% — for large files prefer passing the binary reference itself between nodes; encode only at the API boundary that demands it.

Related

  • Create File / Extract From File — make or read the files themselves.
  • HTTP Requestbody_mode: binary sends raw bytes without base64.