Storage Size

Storage Size

Certified

Get the size of a file in Kestra internal storage.

Reads the file attributes for the given kestra:// URI and returns its size in bytes.

yaml
type: io.kestra.plugin.core.storage.Size

Get the size of a text file generated by another task.

yaml
    id: get_file_size
    namespace: company.team

    tasks:
      - id: generate_file
        type: io.kestra.plugin.scripts.shell.Commands
        commands:
          - echo "Hello John" > name.txt
        outputFiles:
          - "name.txt"

      - id: get_size
        type: io.kestra.plugin.core.storage.Size
        uri: "{{ outputs.generate_file.outputFiles['name.txt'] }}"

      - id: log
        type: io.kestra.plugin.core.log.Log
        message: "{{ outputs.get_size.size }} bytes"
Properties

The file where size needs to be fetched

Assets this task consumes as inputs or produces as outputs, for lineage tracking and the asset graph (Enterprise Edition). A flow declaring this property on a task is rejected in the open-source edition.

Definitions
assetFailureBehaviorstring
Possible Values
IGNOREFAILWARN

Asset failure behavior

Behavior applied to the task state when a declared asset fails to render, emit, or be persisted (e.g. a lock conflict): FAIL escalates it to FAILED, WARN (default) warns it if it would otherwise succeed, IGNORE leaves the state untouched.

enableAutobooleanstring

Whether to auto-register assets referenced dynamically at runtime that are not statically declared in inputs or outputs.

inputsarray

The assets consumed as inputs.

id*string
Min length1
typestring
outputs

The assets produced as outputs.

id*string
Min length1
Max length150
type*object
descriptionstring
displayNamestring
metadataobject
Default{}
namespacestring
Min length1
Max length150
id*string
Min length1
Max length150
type*object
descriptionstring
displayNamestring
metadataobject
Default{}
namespacestring
Min length1
Max length150
id*string
Min length1
Max length150
type*object
descriptionstring
displayNamestring
metadataobject
Default{}
namespacestring
Min length1
Max length150
id*string
Min length1
Max length150
type*object
descriptionstring
displayNamestring
metadataobject
Default{}
namespacestring
Min length1
Max length150
id*string
Min length1
Max length150
type*object
descriptionstring
displayNamestring
metadataobject
Default{}
namespacestring
Min length1
Max length150
id*string
Min length1
Max length150
type*string
Min length1

Custom asset type

descriptionstring
displayNamestring
metadataobject
Default{}
namespacestring
Min length1
Max length150

The size of the file in bytes