Does the /tmp Directory Temporarily Store Files and for How Long?

This topic was automatically generated from Slack. You can find the original thread here.

Does /tmp directory store files temporarily? If so, how long does it store it?

Yes, the /tmp directory stores files temporarily. The storage may be wiped or may not exist between workflow executions. The /tmp directory is stored on the virtual machine that runs your workflow, called the execution environment (“EE”). EEs can be destroyed at any time (for example, after about 10 minutes of receiving no events). This means that you should not expect to have access to files across executions. However, files may remain, so you should clean them up to make sure that doesn’t affect your workflow.

what is the default amount of time it stores the files? can i store files permanently?

The default storage duration for files in the /tmp directory is not guaranteed, as the execution environment (EE) can be destroyed at any time (for example, after about 10 minutes of receiving no events). This means that you should not expect to have access to files across executions. Files may remain, but you should clean them up to ensure they don’t affect your workflow. For permanent storage, you cannot use the /tmp directory. Instead, you can use external storage services like AWS S3, Google Cloud Storage, or any other storage service that suits your needs. You can integrate these services into your Pipedream workflow to store and retrieve files as needed.

What is execution environment?

The execution environment refers to the environment in which your Pipedream sources, workflows, and other code are executed. Each version of a source or workflow is deployed to its own virtual machine, which means your execution environment has its own RAM and disk, isolated from other users’ environments. You can read more about the virtualization and isolation mechanisms used to secure your execution environment here.