Collect Runtime file

View as Markdown

Copy a file from an active Runtime workspace into durable File storage. The workspace file remains in place after collection.

Collect a File

1const result = await bctrl.tools.call("runtime.files.collect", {
2 path: "reports/result.json",
3 name: "checkout-result.json",
4}, { runtimeId: runtime.id });
5
6console.log(result.fileId, result.name, result.size);

The Runtime must be active. path is relative to the workspace root; absolute paths and .. segments are not allowed. Omit name to let the Tool derive the durable File name.

Request parameters

ParameterTypeRequiredDescription
pathstringYesWorkspace-relative source path, from 1 to 1024 characters.
namestringNoDurable File name, from 1 to 255 characters.

Response

FieldTypeAlways presentDescription
fileIdFileIdYesDurable File created from the workspace file.
namestringYesDurable File name.
sizenumberYesNumber of bytes collected.

Next