The File Generator worker creates a new file in the Everysk format with user supplied parameters. You can either save the generated file in the platform or use it in the workflow where it was generated, to be passed to other workers that consume a file.
By clicking in the File Generator worker, a setup interface opens:
The File Generator worker must receive specific parameters in order to execute properly.
The file field has two types of operations controlled by a swap icon (highlighted below in red):
This is the default: It is used when the various parameters from the file (name, workspace, tags, content-type and data) are being provided by the Everysk API, as a File object. It will be necessary to pass the whole file to a File Generator worker as Upstream Data in order to save it in the Everysk Platform. You can check the The Worker Structure article to learn more about how to use data from the API inside a workflow.
When you need to supply all the elements from a file, one by one, you will need to press the Swap icon to open more input fields. Fields for the file's name, workspace, tags, content-type and data will be exposed:
Set the file name using Template Text or Upstream Data variants.
Select the workspace in which the generated file will be saved using Fixed Workspace variants.
Set the file tags using Fixed Tags or Upstream Data variants.
Set the file content-type, using Select or Upstream Data variants.
Set the file data using String or Upstream Data variants.
1.5.1 Data Type
When creating a text/plain file you choose wheter you will pass a Base 64 encoded string or the plain text to the worker.
When generating the new file, you can choose whether this file will be saved in the platform or not through the Storage Mode button. This button has two options: Transient and Create.
The generated file will not be saved in the platform, but will be accessible for the next workers in the workflow.
The generated file will be saved in the platform and will be accessible for the next workers in the workflow.
Once this worker finishes to execute successfully, it will return an object containing the generated file to the workflow, which can be used by downstream workers. Below you can see an example of the File Generator's result object hierarchy.
- File (file)
- ID (string)
- Name (string)
- Tags (list)
- Content-Type (string)
- Data (string)