Skip to content

Save to JSON

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.

ParameterTypeRequiredDescription
filenametextNoOutput file name (default: output.json)
dataKeytextNoPath of the attribute to export within the data (e.g.: ‘data’ or ‘data[0].items’). If empty, exports all data
{
"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"
}
}
{
"filename": "productos_exportados.json"
}
{
"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 dataKey is defined, the getDataPath function 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_HOST environment variable
  • The directory is automatically created if it doesn’t exist
  • Does not require credentials