This topic was automatically generated from Slack. You can find the original thread here.
i’m trying to use stash api for uploading files myself so I can use it in gmail send email with attachment tools or similar
This topic was automatically generated from Slack. You can find the original thread here.
i’m trying to use stash api for uploading files myself so I can use it in gmail send email with attachment tools or similar
Is there any docs on it? I can find docs on how to use the stash for subsequent actions but nothing about creating a stash and
i’m trying to use stash api for uploading files myself so I can use it in gmail send email with attachment tools or similar
Is there any docs on it? I can find docs on how to use the stash for subsequent actions but nothing about creating a stash and
There isn’t public documentation for a direct “Stash API” to upload files yourself outside of Pipedream Connect actions, but here’s what’s available and how it works: ## File Stash in Pipedream Connect - File Stash is a feature of Pipedream Connect that makes files created in /tmp
during an action run available via presigned URLs. - You cannot upload files directly to File Stash via an API. Instead, files are created in /tmp
during the execution of a Connect action. When you pass a stash_id
in your action execution, Pipedream will sync those files to File Stash and return presigned URLs. ### How to “create” a Stash and get file URLs 1. Run an action via Connect that writes a file to /tmp
(e.g., download a file, generate a PDF, etc.). 2. Pass a stash_id
in your request: - If you set stash_id
to ""
, "NEW"
, or true
, Pipedream will generate a new stash ID for you. - If you omit stash_id
, files are not synced to File Stash. 3. The response will include presigned URLs for the files in the $filestash_uploads
export. #### Example (Node.js): const resp = await pd.actionRun({ externalUserId: "abc-123", actionId: "google_drive-download-file", configuredProps: { googleDrive: { authProvisionId: "apn_gyhLaz3" }, fileId: { "__lv": { "label": "important files > mcp-hot.jpg", "value": "16nlbFcgtgZkxLLMT2DcnBrEeQXQSriLs" } }, filePath: "/tmp/mcp-hot.jpg" }, stashId: "" // Generate a new stash }); // The response contains file URLs in $filestash_uploads console.log(resp.exports.$filestash_uploads);
#### Example (cURL): bash curl -X POST https://api.pipedream.com/v1/connect/{project_id}/actions/run \ -H "Content-Type: application/json" \ -H "X-PD-Environment: {environment}" \ -H "Authorization: Bearer {access_token}" \ -d '{ "external_user_id": "abc-123", "id": "google_drive-download-file", "configured_props": { "googleDrive": { "authProvisionId": "apn_jyhKbx4" }, "fileId": { "__lv": { "label": "important files > mcp-hot.jpg", "value": "16nlbFcgtgZkxLLMT2DcnBrEeQXQSriLw" } }, "filePath": "/tmp/mcp.png" }, "stash_id": "" }'
### Key Points - You cannot upload arbitrary files to File Stash via an API. Files must be created in /tmp
during an action run. - To use with Gmail send email with attachment tools: You’d run an action that creates the file, get the presigned URL from $filestash_uploads
, and then use that URL as the attachment source in your Gmail action. ### Docs Reference - Pipedream Connect File Stash docs If you need to upload files from outside Pipedream (e.g., from your own server), you’d need to first get them into /tmp
in a Connect action (for example, by downloading from a URL), then use the stash mechanism above. If you need more direct upload support, please let Pipedream know your use case at Support - Pipedream.
Let me know if that helps
not quite.
So is there like a specific tool just for downloading files into stash on pipedream that I must use?
No, you pass stashId
as part of the payload when you call actions.run()
for example. So if it’s a file for example, you’d pass stashId: ""
, which will sync /tmp
with File Stash, and return the contents in the action’s response (along with a stash_id
.
What is your exact use case? Did you check out the docs?
My use case is i have external files that I want to pass when I run a pipedream action
So for example, send gmail with attachments
Those attachments are files I have that aren’t on pipedream
Ah I see
I’m jumping onto a call, will follow up with you a bit later.
Sure
Any update?
i want to know this because this is a blocker for something we are working on
Are the files accessible via URL?
Most actions that accept file inputs should accept URLs as inputs
Yes