Share Data Between Steps
Sometimes it is necessary to pass an execution context (for example, an access token, script run results, and so on) from one Automation step to another. Depending on the data type, you can share it using a parameter or a file.
Sharing parameters between steps
For this purpose, all steps in a job have access to a common parameter storage. To access the storage, you should use the
parameters API. The API is available only inside the
kotlinScript block: the container you use to run the step must include JRE/JDK 9 or later.
Note that you can remove parameters from the storage by using
parameters().remove(key: String), where
key is a parameter name.
Sharing files between steps
Accessing file share directly
Accessing file share in Kotlin code
File share size limit
Monthly limit on file share usage
Parallel steps and file sharing
By default, steps in a job run sequentially: the next container starts only after the previous container finishes its work. This prevents conflicts in the file share. But what if two steps (A and B) run in parallel and put the same file in the file share? This behavior is undetermined: the file share will contain the result of either A or B. Consider an example:
Both containers run in parallel: the first container writes
file.txt while the second one writes
World to the same file. When the job finishes,
file.txt will contain either
World but neither
Hello World nor
File attributes and file sharing
File attributes are preserved when a file is copied to/from the file share.
fileShare() function provides access to the file sharing API:
|Method or Property||Description|
| || (Read-only) Path to the file share (by default, |
Returns full path to the file.
Locates a file in the file share by its
Returns file path.
Deletes a file from the file share by its