Save to JSON
Description
Section titled “Description”The Save to JSON module takes workflow data and saves it as a JSON file to the file system. It generates a readable (indented) file and provides both the local path and a download URL. It supports data filtering via dataKey to extract a specific subset of the data, and automatically normalizes objects with numeric keys to arrays. It is ideal for exporting processed data, generating configuration files, or preparing data for download.
Configuration
Section titled “Configuration”| Parameter | Type | Required | Description |
|---|---|---|---|
| filename | text | No | Output file name (default: output.json) |
| dataKey | text | No | Path of the attribute to export within the data (e.g.: ‘data’ or ‘data[0].items’). If empty, exports all data |
Output
Section titled “Output”{ "nextModule": "siguiente_modulo", "data": { "filename": "output.json", "filePath": "/temporal/cli_123/output.json", "urlPath": "https://engine.ejemplo.com/download/cli_123/output.json" }, "_meta_": { "jsonFilePath": "/temporal/cli_123/output.json" }}Usage Example
Section titled “Usage Example”Basic case
Section titled “Basic case”{ "filename": "productos_exportados.json"}With dataKey
Section titled “With dataKey”{ "filename": "catalogo.json", "dataKey": "data"}- The file is saved in the
temporal/cli_{client_id}/folder within the working directory - Spaces in the filename are replaced with underscores
- If the name does not end in
.json, the extension is automatically added - Objects with numeric keys (like
{"0": {...}, "1": {...}}) are automatically converted to arrays - If
dataKeyis defined, thegetDataPathfunction is used to extract data from the specified path - If data is empty after filtering, the module returns an error
- The download URL is built with the
ENGINE_HOSTenvironment variable - The directory is automatically created if it doesn’t exist
- Does not require credentials
Related Nodes
Section titled “Related Nodes”- Save to Excel - Create Excel files
- Read Excel - Read Excel files
- Key Filter - Filter data before saving