Skip to content

Files ​

Cloud Flow Blocks reference.

Blocks ​

Compress File ​

Block name: file_compress

Compresses an existing file into a new destination file using Tinify options, then runs the nested success or error statements when the operation finishes.

Inputs ​

InputTypeDescriptionAccepts
path/namestringThe source file path and name. This is typically provided by a text block.text
publicly accessiblebooleanWhether the source file path refers to the public area. This is typically provided by a logic_boolean block.logic_boolean
new path/namestringThe destination file path and name for the compressed output. This is typically provided by a text block.text
make publicly accessiblebooleanWhether the destination file should be stored in the public area. This is typically provided by a logic_boolean block.logic_boolean
Tinify KeystringThe Tinify API key to use for compression. This is typically provided by a text block.text
Resize optionsobjectOptional resize options object to pass to the compression operation.
Convert optionsobjectOptional convert options object to pass to the compression operation.
on successstatementsThe statements to run when the compression operation succeeds. Inside this block, file_operation_response_data provides the operation response data. Nested blocks run inside the generated callback for this block. customcode and customcodeexpr blocks inside this area can directly access the documented callback-scope variables.
on errorstatementsThe statements to run when the compression operation fails. Inside this block, file_operation_response_error provides the operation error message. Nested blocks run inside the generated callback for this block. customcode and customcodeexpr blocks inside this area can directly access the documented callback-scope variables.

Output ​

This block does not produce an output value.

Behavior ​

Generates server-side code that compresses a source file into a destination file through the ioLoop file runtime using the provided Tinify key and optional resize/convert settings. The nested blocks are emitted inside function(tvwaFsResp) { ... }, so customcode and customcodeexpr blocks inside the success and error branches can access tvwaFsResp directly.

Calls: $io.fs.compressFile

Copy File ​

Block name: file_copy

Copies an existing file into a new destination file, then runs the nested success or error statements when the operation finishes.

Inputs ​

InputTypeDescriptionAccepts
path/namestringThe source file path and name. This is typically provided by a text block.text
publicly accessiblebooleanWhether the source file path refers to the public area. This is typically provided by a logic_boolean block.logic_boolean
new path/namestringThe destination file path and name for the copied file. This is typically provided by a text block.text
make publicly accessiblebooleanWhether the destination file should be stored in the public area. This is typically provided by a logic_boolean block.logic_boolean
on successstatementsThe statements to run when the copy operation succeeds. Inside this block, file_operation_response_data provides the operation response data. Nested blocks run inside the generated callback for this block. customcode and customcodeexpr blocks inside this area can directly access the documented callback-scope variables.
on errorstatementsThe statements to run when the copy operation fails. Inside this block, file_operation_response_error provides the operation error message. Nested blocks run inside the generated callback for this block. customcode and customcodeexpr blocks inside this area can directly access the documented callback-scope variables.

Output ​

This block does not produce an output value.

Behavior ​

Generates server-side code that copies a source file into a destination file through the ioLoop file runtime. The nested blocks are emitted inside function(tvwaFsResp) { ... }, so customcode and customcodeexpr blocks inside the success and error branches can access tvwaFsResp directly.

Calls: $io.fs.copyFile

Create Compressed File ​

Block name: file_create_compress

Downloads a file from a URL, compresses it using Tinify options, creates a new file, then runs the nested success or error statements when the operation finishes.

Inputs ​

InputTypeDescriptionAccepts
URLstringThe source URL to download and compress. This is typically provided by a text block.text
path/namestringThe destination file path and name. This is typically provided by a text block.text
publicly accessiblebooleanWhether the created file should be stored in the public area. This is typically provided by a logic_boolean block.logic_boolean
Tinify KeystringThe Tinify API key to use for compression. This is typically provided by a text block.text
Resize optionsobjectOptional resize options object to pass to the compression operation.
Convert optionsobjectOptional convert options object to pass to the compression operation.
on successstatementsThe statements to run when the compressed file is created successfully. Inside this block, file_operation_response_data provides the operation response data. Nested blocks run inside the generated callback for this block. customcode and customcodeexpr blocks inside this area can directly access the documented callback-scope variables.
on errorstatementsThe statements to run when the operation fails. Inside this block, file_operation_response_error provides the operation error message. Nested blocks run inside the generated callback for this block. customcode and customcodeexpr blocks inside this area can directly access the documented callback-scope variables.

Output ​

This block does not produce an output value.

Behavior ​

Generates server-side code that downloads a file from a URL and compresses it through the ioLoop file runtime using the provided Tinify key and optional resize/convert settings. The nested blocks are emitted inside function(tvwaFsResp) { ... }, so customcode and customcodeexpr blocks inside the success and error branches can access tvwaFsResp directly.

Calls: $io.fs.compressAndCreateFromUrl

Create File ​

Block name: file_create

Creates a file from text or from a URL, then runs the nested success or error statements when the operation finishes.

Inputs ​

InputTypeDescriptionAccepts
sourcechoiceHow the file contents should be created.
source valuestringThe text content to write, or the source URL to fetch from, depending on the selected source mode. This is typically provided by a text block.text
path/namestringThe destination file path and name. This is typically provided by a text block.text
publicly accessiblebooleanWhether the created file should be stored in the public area. This is typically provided by a logic_boolean block.logic_boolean
on successstatementsThe statements to run when the file is created successfully. Inside this block, file_operation_response_data provides the operation response data. Nested blocks run inside the generated callback for this block. customcode and customcodeexpr blocks inside this area can directly access the documented callback-scope variables.
on errorstatementsThe statements to run when the file creation fails. Inside this block, file_operation_response_error provides the operation error message. Nested blocks run inside the generated callback for this block. customcode and customcodeexpr blocks inside this area can directly access the documented callback-scope variables.

Output ​

This block does not produce an output value.

Behavior ​

Generates server-side code that creates a file either from text or from a URL through the ioLoop file runtime. The nested blocks are emitted inside function(tvwaFsResp) { ... }, so customcode and customcodeexpr blocks inside the success and error branches can access tvwaFsResp directly.

Calls: $io.fs.createFileFromText, $io.fs.createFileFromUrl

Delete File(s) ​

Block name: file_delete

Deletes one or more files, then runs the nested success or error statements when the operation finishes.

Inputs ​

InputTypeDescriptionAccepts
name or listarrayThe file path/name or list of file paths to delete. This is typically provided by a text block for a single file, but a list value can also be used.
publicly accessiblebooleanWhether the file path refers to the public area. This is typically provided by a logic_boolean block.logic_boolean
on successstatementsThe statements to run when the delete operation succeeds. Inside this block, file_operation_response_data provides the operation response data. Nested blocks run inside the generated callback for this block. customcode and customcodeexpr blocks inside this area can directly access the documented callback-scope variables.
on errorstatementsThe statements to run when the delete operation fails. Inside this block, file_operation_response_error provides the operation error message. Nested blocks run inside the generated callback for this block. customcode and customcodeexpr blocks inside this area can directly access the documented callback-scope variables.

Output ​

This block does not produce an output value.

Behavior ​

Generates server-side code that normalizes the input into an array and deletes the selected files through the ioLoop file runtime. The nested blocks are emitted inside function(tvwaFsResp) { ... }, so customcode and customcodeexpr blocks inside the success and error branches can access tvwaFsResp directly.

Calls: $io.fs.deleteFiles

File Operation Data ​

Block name: file_operation_response_data

Gets the response data for the current file operation callback.

Output ​

This block produces an output value of type String.

Behavior ​

Generates server-side code that reads the data field from the current file operation response object when one is available.

File Operation Error ​

Block name: file_operation_response_error

Gets the error message for the current file operation callback.

Output ​

This block produces an output value of type String.

Behavior ​

Generates server-side code that reads the err field from the current file operation response object when one is available.

List Files ​

Block name: file_list

Lists files whose path or name starts with the provided prefix, then runs the nested success or error statements when the operation finishes.

Inputs ​

InputTypeDescriptionAccepts
path/name starting withstringThe file path or prefix to list from. This is typically provided by a text block.text
publicly accessiblebooleanWhether the path prefix refers to the public area. This is typically provided by a logic_boolean block.logic_boolean
on successstatementsThe statements to run when the list operation succeeds. Inside this block, file_operation_response_data provides the returned file list data. Nested blocks run inside the generated callback for this block. customcode and customcodeexpr blocks inside this area can directly access the documented callback-scope variables.
on errorstatementsThe statements to run when the list operation fails. Inside this block, file_operation_response_error provides the operation error message. Nested blocks run inside the generated callback for this block. customcode and customcodeexpr blocks inside this area can directly access the documented callback-scope variables.

Output ​

This block does not produce an output value.

Behavior ​

Generates server-side code that lists files through the ioLoop file runtime. The nested blocks are emitted inside function(tvwaFsResp) { ... }, so customcode and customcodeexpr blocks inside the success and error branches can access tvwaFsResp directly.

Calls: $io.fs.listFiles

Lookup File ​

Block name: file_lookup

Looks up a file by path and name, then runs the nested success or error statements when the operation finishes.

Inputs ​

InputTypeDescriptionAccepts
path/namestringThe file path and name to look up. This is typically provided by a text block.text
publicly accessiblebooleanWhether the file path refers to the public area. This is typically provided by a logic_boolean block.logic_boolean
on successstatementsThe statements to run when the file lookup succeeds. Inside this block, file_operation_response_data provides the returned file information. Nested blocks run inside the generated callback for this block. customcode and customcodeexpr blocks inside this area can directly access the documented callback-scope variables.
on errorstatementsThe statements to run when the file lookup fails. Inside this block, file_operation_response_error provides the operation error message. Nested blocks run inside the generated callback for this block. customcode and customcodeexpr blocks inside this area can directly access the documented callback-scope variables.

Output ​

This block does not produce an output value.

Behavior ​

Generates server-side code that looks up a file through the ioLoop file runtime. The nested blocks are emitted inside function(tvwaFsResp) { ... }, so customcode and customcodeexpr blocks inside the success and error branches can access tvwaFsResp directly.

Calls: $io.fs.lookupFile

Read File ​

Block name: file_read_text

Reads a file as text, then runs the nested success or error statements when the operation finishes.

Inputs ​

InputTypeDescriptionAccepts
path/namestringThe file path and name to read. This is typically provided by a text block.text
publicly accessiblebooleanWhether the file path refers to the public area. This is typically provided by a logic_boolean block.logic_boolean
on successstatementsThe statements to run when the file is read successfully. Inside this block, file_operation_response_data provides the returned file text. Nested blocks run inside the generated callback for this block. customcode and customcodeexpr blocks inside this area can directly access the documented callback-scope variables.
on errorstatementsThe statements to run when the read operation fails. Inside this block, file_operation_response_error provides the operation error message. Nested blocks run inside the generated callback for this block. customcode and customcodeexpr blocks inside this area can directly access the documented callback-scope variables.

Output ​

This block does not produce an output value.

Behavior ​

Generates server-side code that reads a file as text through the ioLoop file runtime. The nested blocks are emitted inside function(tvwaFsResp) { ... }, so customcode and customcodeexpr blocks inside the success and error branches can access tvwaFsResp directly.

Calls: $io.fs.readFileAsText

URL of File (Public) ​

Block name: file_public_url

Gets the public download URL for a file path in the public area.

Inputs ​

InputTypeDescriptionAccepts
path/namestringThe public file path and name. This is typically provided by a text block.text

Output ​

This block produces an output value of type String.

Behavior ​

Generates server-side code that builds the public download URL for a file path through the ioLoop file runtime.

Calls: $io.fs.getPublicFileDownloadUrl