Skip to content
Docs

Delete a File

Delete a File removes one file from a workspace file store. You find it on the node picker’s Storage shelf.

The node has one input handle and one output handle.

The file stops being readable immediately: it disappears from List Files, and its path is free to use again. Its stored contents are deleted by the next daily cleanup, not at the moment you delete. Publicus offers no way to restore a deleted file, so treat a delete as final.

Files in a store Publicus manages, such as Mail attachments, cannot be deleted one at a time. They belong to the email they arrived with and are removed by that store’s retention. The node stops with an error that says so.

In the node’s settings you pick the file to remove rather than type its reference. Type part of its path, and the field lists the matching files of every file store in your workspace as Store › path, the newest first, 50 at most. A picked file is saved as its object id. A Store name/path typed in before the field became a picker stays as it was. To remove a file another node names, click Insert a value ({x}) and write an expression.

The Delete a File node's settings form, with the fields described below
The Delete a File node's settings form, with the fields described below
FieldTypeDefaultDescription
File (reference)string ✦ (required) — The file to remove: an object id, or “Store name/path/to/file.pdf”.

Fields marked ✦ accept expressions.

Try this node — run it once against your own workspace, with your credentials, without building a flow first.

Two references are refused, each with the reason:

  • A version id. A version names one byte set inside a file’s history, not the file. Delete the file by its object id or its Store/path, or set the store’s retention policy to age versions out.
  • An email attachment id. An inbound attachment belongs to the message it arrived on and is removed with it by mail retention.
{
"deleted": {
"id": "01K2...",
"key": "invoices/2026/08/inv-1042.pdf",
"storeId": "01K1..."
}
}

Clear a working file once a flow has finished with it:

  1. File: {{ $prev->object->id }}, taken from the Store a File node that wrote it.

Addressing it by path works too, and reads better when the path is fixed: Scratch/exports/nightly.csv.

  • One file per run of the node. To clear many, list them and fan out with Parallel.
  • Deleting a file the flow is still using elsewhere in the same run is not detected.