Uploads files to the Writer platform.

Overview

The Add files to Writer Cloud block uploads files to the Writer cloud so you can use them in your workflows. It accepts a list of file objects as inputs.

File inputs

The Add files to Writer Cloud block accepts a list of file objects as inputs. Each file object must have the following fields:

FieldTypeDescription
namestringThe name of the file.
contentbytesThe content of the file as bytes.
typestringThe MIME type of the file.

If you upload a file with the File input interface block, the list of file objects is automatically created for you, so all you have to do is pass the list to the Add files to Writer Cloud block.

You can retrieve the file objects list from the File input interface block in two ways:

  • Connect a UI Trigger to the File input block’s wf-file-change event. Then, use the @{payload} environment variable to access the file objects. The trigger will fire when a user adds or removes files from the file input block.
  • Under Binding in the File input interface block, define a state variable that contains the list of file objects. Then reference that variable in the Add files to Writer Cloud block.

Output

Once the files are uploaded to the Writer cloud, the Add files to Writer Cloud block returns a list containing the uploaded file IDs and other information about the files. Each file object has the following fields:

FieldTypeDescription
idstringThe ID of the file.
namestringThe name of the file.
statusstringThe status of the file. Can be in_progress, completed, or failed.
created_atstringThe date and time the file was created.
graph_idsarrayThe IDs of any Knowledge Graphs that the file is associated with.
[
    {
        "id": "701118ae",
        "name": "research_paper.pdf",
        "status": "in_progress",
        "created_at": "2025-06-17T16:18:42.672407+00:00",
        "graph_ids": []
    }
]

File processing status

If the uploaded file’s status is in_progress, the file is being processed and is not ready to be used in a workflow.

Some files are processed quickly, such as PDFs and images, and are ready to be used in a workflow within seconds. Others, such as Word documents, may take a few minutes to process.

There are a few ways you can handle files that are still being processed:

  • Split the blueprint into two parts: one that uploads the files when a user adds them to the file input block, and another that uses the files when a user clicks a button in the UI. This way, you can use the files in the workflow as soon as they’re uploaded, and wait for the user to click a button to use the files in the second part of the blueprint. See an example in the Upload, parse, and summarize PDFs tutorial.
  • Add a Python block that introduces a few seconds of delay before the workflow continues.
  • Add a Tool calling block that can check the status of the file using the Writer API and wait for the file to be processed before continuing.

Fields

NameTypeControlDefaultDescriptionOptionsValidation
FilesObject-[]A list of files to be uploaded and added to the knowledge graph. You can use files uploaded via the File Input component or specify dictionaries with data, type and name.--

End states

Below are the possible end states of the block call.

NameFieldTypeDescription
Success-successFile successfully uploaded.
Error-errorIf the function raises an Exception.