Convert Base64 To File - Synthreo Builder
Convert Base64 To File node for Builder - decode Base64-encoded strings back into binary files (images, PDFs, documents) for storage, download, or further processing in a workflow.
Purpose
Section titled “Purpose”The ConvertBase64ToFile node transforms Base64-encoded strings into actual binary files such as images, PDFs, and documents.
This is especially useful when working with APIs, databases, or upload handlers that return file data as Base64 text. The node supports saving files to organized folder paths and passing file references downstream in your workflow for further processing, storage, or delivery.
Parameters
Section titled “Parameters”Data Source
Section titled “Data Source”| Name | Type | Required | Default | Description |
|---|---|---|---|---|
| Base64 Value Expression | Text (dynamic) | Required | Empty | Path to the field in the incoming data that contains the Base64-encoded string. Supports dynamic expressions referencing upstream node output. |
| File Extension Property Path | Text (dynamic) | Required | Empty | Path to the field containing the target file extension (e.g., pdf, jpg, png). Used to determine the output file format. |
Processing
Section titled “Processing”| Name | Type | Required | Default | Description |
|---|---|---|---|---|
| Save File | Toggle (On/Off) | Optional | Off | When enabled, the converted file is written to storage at the location defined by Folder Path. When disabled, the file data is passed forward in memory without being persisted to disk. |
| Folder Path | Text (dynamic) | Optional | "base64_decoder" | The folder path where converted files are saved. Only applies when Save File is enabled. Supports dynamic expressions such as client_documents/{{client_id}}. |
Output
Section titled “Output”| Name | Type | Required | Default | Description |
|---|---|---|---|---|
| Option | Dropdown | Optional | Original with appended result column | Controls how the output record is structured. Original with appended result column retains all incoming fields and adds the file reference as a new column. Return result column only outputs only the file reference field, discarding the original input fields. |
| Result Property Name | Text | Optional | "file_result" | The name of the output column that holds the converted file reference or file path. |
How It Works
Section titled “How It Works”When the node executes, it reads the Base64 string from the field identified by Base64 Value Expression and decodes it into raw binary data. The File Extension Property Path tells the node what format to produce. If Save File is on, the binary data is written as a file to the specified Folder Path. The resulting file reference is then placed into the output column defined by Result Property Name, and the full record is passed to the next node according to the selected Option.
Example Usage
Section titled “Example Usage”Document Processing Pipeline
Section titled “Document Processing Pipeline”A workflow receives PDF documents from an external API that encodes files as Base64 strings. The node decodes each string and saves the file to a structured folder for downstream review.
Configuration:
Base64 Value Expression:api_response.file_dataFile Extension Property Path:api_response.file_typeSave File: OnFolder Path:client_documents/incoming/{{client_id}}Option: Original with appended result columnResult Property Name:processed_document
Outcome: Base64 strings are decoded into PDFs, saved under client-specific folders, and the output record includes the file path alongside all original API response fields.
In-Memory Image Handling
Section titled “In-Memory Image Handling”A workflow processes Base64-encoded images retrieved from a database and passes them to an image analysis node without writing to disk.
Configuration:
Base64 Value Expression:db_record.thumbnail_base64File Extension Property Path:db_record.image_formatSave File: OffOption: Return result column onlyResult Property Name:decoded_image
Outcome: The decoded image binary is passed to the next node without any files being saved to storage.
Best Practices
Section titled “Best Practices”- File organization: Use dynamic expressions in Folder Path to create structured directories, such as
uploads/{{year}}/{{client_id}}/files. This prevents flat folder accumulation at scale. - Extension validation: Confirm that the File Extension Property Path field contains a clean extension value (e.g.,
pdf, not.pdforapplication/pdf). Wrong or malformed extensions can produce files that cannot be opened. - Data validation: Verify that the Base64 string is complete and valid before this node runs. Truncated or corrupted Base64 data will produce an unusable file.
- Performance: When processing large batches or large individual files, run a sample test first. Base64-encoded files are approximately 33% larger than their binary counterparts, which affects memory and I/O.
- Security: When saving files to shared storage, apply appropriate access controls, retention policies, and encryption at rest to protect sensitive file content.
- Downstream compatibility: When passing file references to other nodes (such as email attachment or storage nodes), ensure those nodes expect the output format produced by the selected Option.
Troubleshooting
Section titled “Troubleshooting”Converted file cannot be opened
Section titled “Converted file cannot be opened”The most common cause is an incorrect or mismatched file extension. Verify that the value resolved by File Extension Property Path matches the actual format of the Base64 data. For example, if the API returns a PNG image encoded as Base64 but the extension field contains jpg, the resulting file will have the wrong format header.
No file is saved despite Save File being enabled
Section titled “No file is saved despite Save File being enabled”Check that the Folder Path resolves to a valid, writable directory. If the path contains dynamic expressions, confirm the referenced fields are populated in the incoming data. An unresolvable expression may silently fall back to the default path or produce an error.
Output column is missing downstream
Section titled “Output column is missing downstream”Ensure Result Property Name is set to a unique, non-colliding column name. If the name matches an existing field in the incoming data, the behavior depends on node configuration. Using a clearly distinct name such as converted_pdf avoids ambiguity.
Base64 decoding error
Section titled “Base64 decoding error”This occurs when the input string is not valid Base64. Common causes include extra whitespace, incomplete strings from truncated API responses, or strings that include a data URI prefix (e.g., data:application/pdf;base64,). Strip the prefix before passing the value to this node if your source includes it.
Test Cases
Section titled “Test Cases”- Given: Valid Base64 string of a PDF with
File Extension Property Path = "pdf",Save File = On- Expected: Valid PDF file created at the specified folder path; output column contains the file reference. - Given: Valid Base64 string of a PNG with
Save File = Off- Expected: Decoded image binary available in output column; no file written to disk. - Given: Malformed or truncated Base64 string - Expected: Error indicating invalid Base64 input; no partial file written.
- Given:
File Extension Property Pathresolves to an empty string - Expected: Error or fallback behavior; review extension field mapping.
Industry Applications
Section titled “Industry Applications”| Industry | Challenge | How Node Helps | Outcome |
|---|---|---|---|
| Healthcare | Medical imaging systems export scans as Base64 data | Converts scans into standard formats, stores securely with patient IDs | Reduces processing time, ensures compliant record storage |
| Financial Services | Mobile apps send signatures and documents as Base64 | Converts into proper file formats, saves in secure folder structures | Improves processing efficiency, maintains compliance |
| Marketing Agencies | Client assets arrive as Base64 strings from varied sources | Converts to usable working files, organizes by campaign and client | Cuts asset preparation time, improves creative workflow productivity |
Related Nodes
Section titled “Related Nodes”- ConvertFileToBase64 - Encodes binary files into Base64 strings, the inverse of this node.
- FileToText - Extracts readable text from files produced by this node.
- Send Email - Can use file references produced by this node as email attachments.