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
| Parameter | Type | Default | Description |
|---|---|---|---|
operation | encode | decode | encode | binary → string, or string → binary. |
binary_field | property name | data | encode: which attachment to read. |
data | expression | — | decode: the base64 string, e.g. {{ $json.base64 }}. Data URIs (data:image/png;base64,…) are accepted. |
file_name / mime_type / output_field | string | file / application/octet-stream / data | decode: 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_fieldvalue 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 Request —
body_mode: binarysends raw bytes without base64.