File Handling with Cloudomation

Cloudomation offers several options for working with files and file systems. This article describes the file handling functionality available to you on the Cloudomation platform, which allows you to work with files without needing a separate environment (e.g. a remote server) on which your file operations happen.

The system.file function

The file function allows you to create file objects. Arguments:
  • name – string. The name of the file. If it doesn’t exist, it will be created.

Note: file contents will be overwritten without warning if a file of the same name already exists.


  • The file object


def handler(system, this):
    # create a file object
    file_object = system.file('myfile.txt')

    # write to the file'saving some text')

    # read from the file
    text = file_object.get('content')

    return this.success('all done')

The system.files function

The system.files function lists all files in a given directory.

files = system.files(dir='flows', glob='**/*.py')


  • **filters – dictionary. Filters to limit the search results.


  • An iterator over all matched files which generates File objects.


def handler(system, this):
    # list all files on the Cloudomation platform
    all_files = system.files()
    for file in all_files:

    # List only *.zip files
    zip_files = system.files(filter={
        'field': 'name',
        'op': 'like',
        'value': '',
    for zip_file in zip_files:

    return this.success('all done')