Skip to main content

Write JSON File

Controlled node

Overview​

The Write JSON File node serializes input data as formatted JSON and saves it as a .json file in the project library. It is useful for exporting structured workflow output, API responses, configuration data, extracted records, or AI-generated structured data.

Inputs​

InputTypeDescriptionDefault
RunEventTriggers the JSON file creation and upload.-
DataDataThe data to serialize as JSON.-
NameDataThe filename for the generated JSON file. If the name does not end with .json, the extension is appended automatically.-
PathDataOptional folder path in the library where the JSON file should be saved. Missing folders are created automatically. If omitted, the file is saved in the root library folder.root

Outputs​

OutputTypeDescription
DoneEventFires when the node has finished running.
FileDataThe generated library file reference. If serialization or upload fails, this output contains an error object.

Runtime Behavior and Defaults​

  • Controlled Node: The node runs only when the Run event fires.
  • Project Requirement: A runtime project ID is required so the JSON file can be uploaded to the project library.
  • Filename Handling: The node requires a non-empty Name input. .json is appended if the extension is missing.
  • Directory Creation: If Path is provided, the node creates or resolves that library folder path before uploading.
  • JSON Serialization: Data is serialized with indentation for readability.
  • Error Handling: If data, project ID, filename, JSON serialization, or upload fails, File contains an error object instead of a file reference.

Example Usage​

Export Structured Data​

  1. Connect output from AI Write Data, Dictionary, or another structured data node to Data.
  2. Set Name to "extracted-records".
  3. Optionally set Path to "exports/json".
  4. Trigger Run from a Start node or another event.

The node saves extracted-records.json to the library and outputs the generated file reference.

tip

Use Read JSON File later in another workflow to parse the saved JSON file back into data.