/tmp
directory in Pipedream’s execution environment, you can sync these files with File Stash, making them accessible outside of Pipedream.
File Stash
When you execute an action via Connect that downloads files to the/tmp
directory, those files normally only exist within Pipedream’s execution environment. With File Stash syncing, you can now make these files available via presigned URLs that can be accessed from anywhere.
How it works
- Files created in
/tmp
during execution are synced with File Stash when you passstashId
in the action execution payload - Each file is assigned a presigned URL that remains valid for 30 minutes
- These URLs allow anyone with the link to download the file directly
When to use stashId
You should pass thestashId
parameter when the component’s stash
attribute indicates that a stashId
is "required"
or "optional"
. You can find the stash
indicator in the response from the Retrieve component or List components endpoint.
Typically, if
stash
is "required"
, then the component outputs a file to /tmp
. If stash
is "optional"
, then the component may accept as input either a local file path, in which case stashId
is required, or a remote file URL, in which cash stashId
can be omitted.stashId
:
- You’re working with actions that download or generate files in
/tmp
, such as actions with “file”, “upload”, or “download” in their name - You’re working with actions that have a
filePath
orfilename
prop - You want to make files accessible outside of Pipedream’s execution environment
- An empty string (
""
) - The string
"NEW"
- Boolean
true
stashId
value. This allows you to reference multiple files from the same stash.
Avoid passing
stashId
unnecessarily as it will slightly increase response time.API Reference
Running actions with File Stash
To enable File Stash when running an action, use thestash_id
parameter in your request:
Parameter | Type | Description |
---|---|---|
stash_id | string | (Optional) The key that identifies the external user-specific File Stash. If set to "" (or "NEW" or true ), Pipedream will generate a stash ID for you. If omitted, Pipedream will not sync files in /tmp with File Stash. |
Response
The response includes astashId
and a $filestash_uploads
export with information about the files that were downloaded to /tmp
and then synced to File Stash:
$filestash_uploads
array includes:
localPath
: The path to the file in the/tmp
directory where it was downloaded or createds3Key
: The unique key for the file in the Pipedream File Stash after being synced from/tmp
get_url
: A presigned URL that allows downloading the file for 30 minutes
Usage Examples
Reusing a stash ID
You can reuse a stash ID across multiple action runs to maintain a reference to previously downloaded files. This is particularly useful when you need to:- Process multiple files across different actions in a sequence
- Keep a reference to files for later use in your app or agent
- Build a collection of files over time
- Ensure files downloaded in one action are accessible in subsequent actions
stashId
value to subsequent action runs:
Common multi-action file workflows
A typical workflow involving files across multiple actions might look like:- Download a file from an external service to
/tmp
- Process or transform the file
- Upload the file to another service
stashId
across all actions to ensure that files downloaded or created in one action remain accessible to subsequent actions, even though each action runs in its own isolated environment.