From d085d4928f3c3ab42e2ddea7988394abf3f03950 Mon Sep 17 00:00:00 2001 From: Danny Roosevelt Date: Fri, 6 Jun 2025 16:27:39 -0700 Subject: [PATCH 1/8] File Stash docs --- .../actions/create-page/create-page.mjs | 6 +- .../send-message-to-channel.mjs | 6 +- docs-v2/pages/connect/_meta.tsx | 2 +- docs-v2/pages/connect/api.mdx | 28 ++- docs-v2/pages/connect/components/_meta.tsx | 4 + docs-v2/pages/connect/components/files.mdx | 193 ++++++++++++++++++ .../{components.mdx => components/index.mdx} | 5 +- 7 files changed, 228 insertions(+), 16 deletions(-) create mode 100644 docs-v2/pages/connect/components/_meta.tsx create mode 100644 docs-v2/pages/connect/components/files.mdx rename docs-v2/pages/connect/{components.mdx => components/index.mdx} (99%) diff --git a/components/notion/actions/create-page/create-page.mjs b/components/notion/actions/create-page/create-page.mjs index 9a625e62feb19..d049e712d8fab 100644 --- a/components/notion/actions/create-page/create-page.mjs +++ b/components/notion/actions/create-page/create-page.mjs @@ -4,10 +4,10 @@ import base from "../common/base-page-builder.mjs"; export default { ...base, - key: "notion-create-page", - name: "Create Page", + key: "DANNY-notion-create-page", + name: "DANNY Create Page", description: "Create a page from a parent page. [See the documentation](https://developers.notion.com/reference/post-page)", - version: "0.2.16", + version: "0.2.{{ts}}", type: "action", props: { notion, diff --git a/components/slack/actions/send-message-to-channel/send-message-to-channel.mjs b/components/slack/actions/send-message-to-channel/send-message-to-channel.mjs index c5dd32cf4ca32..15489efd8dbb7 100644 --- a/components/slack/actions/send-message-to-channel/send-message-to-channel.mjs +++ b/components/slack/actions/send-message-to-channel/send-message-to-channel.mjs @@ -3,10 +3,10 @@ import constants from "../../common/constants.mjs"; export default { ...common, - key: "slack-send-message-to-channel", - name: "Send Message to Channel", + key: "slack-send-message-to-channel-DANNY", + name: "DANNY Send Message to Channel", description: "Send a message to a public or private channel. [See the documentation](https://api.slack.com/methods/chat.postMessage)", - version: "0.0.4", + version: "0.0.{{ts}}", type: "action", props: { slack: common.props.slack, diff --git a/docs-v2/pages/connect/_meta.tsx b/docs-v2/pages/connect/_meta.tsx index c1c827301f8d9..e48092a4f3d18 100644 --- a/docs-v2/pages/connect/_meta.tsx +++ b/docs-v2/pages/connect/_meta.tsx @@ -2,7 +2,7 @@ export default { "index": "Overview", "use-cases": "Use cases", "managed-auth": "Managed auth", - "components": "Tool calling", + "components": "Tool Use", "mcp": "MCP", "api-proxy": "API proxy", "workflows": "Workflows", diff --git a/docs-v2/pages/connect/api.mdx b/docs-v2/pages/connect/api.mdx index af34f5a759d30..28fbf110081c6 100644 --- a/docs-v2/pages/connect/api.mdx +++ b/docs-v2/pages/connect/api.mdx @@ -225,7 +225,8 @@ curl -X POST "https://api.pipedream.com/v1/connect/{your_project_id}/actions/run }, "projectId": 45672541, "refName": "main" - } + }, + "stash_id": "" }' ``` @@ -1847,6 +1848,20 @@ which you want to execute the action. The ID of the last prop reconfiguration (if applicable). +--- + +`stash_id` **string|boolean** (_optional_) + +When passed, this parameter enables [File Stash](/connect/components/files), which syncs files from the `/tmp` directory with a Pipedream File Store. This makes files accessible outside of the execution environment via presigned URLs. + +You can pass one of the following values: +- An empty string (`""`) to generate a new stash ID +- `"NEW"` to generate a new stash ID +- `true` to generate a new stash ID +- A previously created stash ID to reference existing files + +See the [File Stash docs](/connect/components/files) for more details. + ##### Examples @@ -1882,6 +1897,7 @@ const requestOpts: RunActionOpts = { refName: "main" }, externalUserId: "jverce", + stashId: "", // Optional: Pass an empty string to generate a new stash ID, "NEW", true, or a previously created stash ID }; const response: RunActionResponse = await pd.runAction(requestOpts); @@ -1925,6 +1941,7 @@ const { refName: "main" }, externalUserId: "jverce", + stash_id: "", // Optional: Pass an empty string to generate a new stash ID, "NEW", true, or a previously created stash ID }); // Parse and return the data you need @@ -1950,11 +1967,12 @@ echo '{ "id": "gitlab-list-commits", "configured_props": { "gitlab": { - "authProvisionId": "apn_kVh9AoD" + "auth_provision_id": "apn_kVh9AoD" }, - "projectId": 45672541, - "refName": "main" - } + "project_id": 45672541, + "ref_name": "main" + }, + "stash_id": "" }' > data.json curl -X POST "https://api.pipedream.com/v1/connect/{your_project_id}/actions/run" \ diff --git a/docs-v2/pages/connect/components/_meta.tsx b/docs-v2/pages/connect/components/_meta.tsx new file mode 100644 index 0000000000000..8b05a38f5c89b --- /dev/null +++ b/docs-v2/pages/connect/components/_meta.tsx @@ -0,0 +1,4 @@ +export default { + "index": "Overview", + "files": "Working with Files", +} as const diff --git a/docs-v2/pages/connect/components/files.mdx b/docs-v2/pages/connect/components/files.mdx new file mode 100644 index 0000000000000..54862c0d7f8b5 --- /dev/null +++ b/docs-v2/pages/connect/components/files.mdx @@ -0,0 +1,193 @@ +import { Tabs } from "nextra/components"; +import Callout from '@/components/Callout'; + +# Working with Files + +Pipedream provides a file storage system that allows you to store and retrieve files from tool executions via Connect. When a trigger or action downloads files to the `/tmp` directory in Pipedream's execution environment, you can sync these files with a Pipedream File Store, 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 + +1. Files created in `/tmp` during execution are synced with a Pipedream File Store when you pass `stashId` in the action execution payload +2. Each file is assigned a presigned URL that remains valid for 30 minutes +3. These URLs allow anyone with the link to download the file directly + +## When to use stashId + +You should pass the `stashId` parameter when: + +1. You're working with actions that download or generate files in `/tmp`, such as actions with "file", "upload", or "download" in their name +2. You're working with actions that have a `filePath` or `filename` prop +3. You want to make files accessible outside of Pipedream's execution environment + +To generate a new stash ID, you can pass: +- An empty string (`""`) +- The string `"NEW"` +- Boolean `true` + +To reuse an existing stash ID (valid for 24 hours), pass the previously returned `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 the `stash_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. | + + + +```javascript +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: "" // An empty string will generate a new stash ID +}); + +// The response contains file URLs in $filestash_uploads +console.log(resp.exports.$filestash_uploads); +``` + + +```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": "" + }' +``` + + + +### Response + +The response includes a `stashId` and a `$filestash_uploads` export with information about the uploaded files: + +```json +{ + "exports": { + "$summary": "Successfully downloaded the file, \"mcp.png\"", + "$filestash_uploads": [ + { + "localPath": "/tmp/mcp.png", + "s3Key": "1day/proj_lgsqAAJ/exu_x1iK86/d4ffb5b1081d3aacd2929f23f270268c/u/mcp.png", + "get_url": "https://pipedream-file-stash-production.s3.us-east-1.amazonaws.com/1day/proj_lgsqAAJ/exu_x1iK86/d4ffb5b1081d3aacd2929f23f270267d/u/mcp.png?X-Amz-Algorithm=AWS4-HMAC-SHA256&X-Amz-Credential=ASIA5F5AGIEAUKI2SRTS%2F20250606%2Fus-east-1%2Fs3%2Faws4_request&X-Amz-Date=20250606T204541Z&X-Amz-Expires=1800&X-Amz-SignedHeaders=host&X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rabrgxnAHgqR0xB%2B3rNI5b62zaMrUZCm7T28Fec%2BA2x16PFLw4yUUv8UksV3r0H3J9dO6%2FrORTxYz0UYq8aiARGvg8kcjOGJ72Q5wv%2B48Up8r39coHlyACOQdd6Lg4HsohStWgeDJV0LKXru6RkNmM3FJWcWUqOy8oZxgaWe%2F%2BBAo%3D&X-Amz-Signature=a7fb66bdf5de28bf3848c25eacbc417e3a1493ed55d38a7eb68b22bef873413d" + } + ] + }, + "os": [], + "ret": { + "fileMetadata": { + "name": "mcp.png", + "mimeType": "image/png" + }, + "filePath": "/tmp/mcp.png" + }, + "stashId": "d4ffb5b1081d3aacd2929f23f270237d" +} +``` + +Each file in the `$filestash_uploads` array includes: + +- `localPath`: The path to the file in the `/tmp` directory +- `s3Key`: The unique key for the file in the Pipedream File Store +- `get_url`: A presigned URL that allows downloading the file for 30 minutes + +## Usage Examples + +### Reusing a stash ID + +To add more files to an existing stash, provide the same `stash_id` in subsequent action runs: + + + +```javascript +// First run generates a stash ID +const firstRun = await pd.actionRun({ + externalUserId: "abc-123", + actionId: "download-file-1", + configuredProps: { /* ... */ }, + stashId: "NEW" +}); + +// Save the stash ID +const savedStashId = firstRun.stashId; + +// Later, add more files to the same stash +const secondRun = await pd.actionRun({ + externalUserId: "abc-123", + actionId: "download-file-2", + configuredProps: { /* ... */ }, + stashId: savedStashId // Reuse the existing stash ID +}); +``` + + +```bash +# First request with new stash +curl -X POST https://api.pipedream.com/v1/connect/{project_id}/actions/run \ + -H "Content-Type: application/json" \ + -H "Authorization: Bearer {access_token}" \ + -d '{ + "external_user_id": "abc-123", + "id": "download-file-1", + "configured_props": { /* ... */ }, + "stash_id": "NEW" + }' + +# Get the stash_id from the response + +# Second request using the same stash +curl -X POST https://api.pipedream.com/v1/connect/{project_id}/actions/run \ + -H "Content-Type: application/json" \ + -H "Authorization: Bearer {access_token}" \ + -d '{ + "external_user_id": "abc-123", + "id": "download-file-2", + "configured_props": { /* ... */ }, + "stash_id": "d4ffb5b1081d3aacd2929f23f270237d" + }' +``` + + + +## File Storage Duration + +Files in the File Stash are automatically deleted after 24 hours. The presigned URLs remain valid for 30 minutes from the time they are generated. diff --git a/docs-v2/pages/connect/components.mdx b/docs-v2/pages/connect/components/index.mdx similarity index 99% rename from docs-v2/pages/connect/components.mdx rename to docs-v2/pages/connect/components/index.mdx index 7045735a2732a..ec1390f9cc02f 100644 --- a/docs-v2/pages/connect/components.mdx +++ b/docs-v2/pages/connect/components/index.mdx @@ -647,6 +647,7 @@ following fields: [`$.export` in a Node.js](/workflows/building-workflows/code/nodejs/#using-export) component. 2. `os`: a list of observations produced by the action (e.g. logs, errors, etc). 3. `ret`: the return value of the action, if any. +4. When using [File Stash](/connect/components/files) to sync local files, the response will also include a `stash` property with file information. The following (abbreviated) example shows the output of running the action above: @@ -1036,10 +1037,6 @@ This prop type is used by these database actions: - `azure_sql-execute-raw-query` - `turso-execute-query` - -The `sql` prop is only supported in the Pipedream server SDK and REST API, and is not currently supported in `connect-react`. - - #### Configuration When configuring these actions, you'll need to provide: From 61c1fcdd38f9c8212ee30e80e7fafe3eec5299ea Mon Sep 17 00:00:00 2001 From: Danny Roosevelt Date: Fri, 6 Jun 2025 16:31:19 -0700 Subject: [PATCH 2/8] Update send-message-to-channel.mjs --- .../send-message-to-channel/send-message-to-channel.mjs | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/components/slack/actions/send-message-to-channel/send-message-to-channel.mjs b/components/slack/actions/send-message-to-channel/send-message-to-channel.mjs index 15489efd8dbb7..c5dd32cf4ca32 100644 --- a/components/slack/actions/send-message-to-channel/send-message-to-channel.mjs +++ b/components/slack/actions/send-message-to-channel/send-message-to-channel.mjs @@ -3,10 +3,10 @@ import constants from "../../common/constants.mjs"; export default { ...common, - key: "slack-send-message-to-channel-DANNY", - name: "DANNY Send Message to Channel", + key: "slack-send-message-to-channel", + name: "Send Message to Channel", description: "Send a message to a public or private channel. [See the documentation](https://api.slack.com/methods/chat.postMessage)", - version: "0.0.{{ts}}", + version: "0.0.4", type: "action", props: { slack: common.props.slack, From c58167cd5d607acf74441dfcb9e5666a22bf8d7d Mon Sep 17 00:00:00 2001 From: Danny Roosevelt Date: Fri, 6 Jun 2025 16:40:59 -0700 Subject: [PATCH 3/8] Typos --- components/notion/actions/create-page/create-page.mjs | 6 +++--- docs-v2/pages/connect/components/index.mdx | 2 +- 2 files changed, 4 insertions(+), 4 deletions(-) diff --git a/components/notion/actions/create-page/create-page.mjs b/components/notion/actions/create-page/create-page.mjs index d049e712d8fab..9a625e62feb19 100644 --- a/components/notion/actions/create-page/create-page.mjs +++ b/components/notion/actions/create-page/create-page.mjs @@ -4,10 +4,10 @@ import base from "../common/base-page-builder.mjs"; export default { ...base, - key: "DANNY-notion-create-page", - name: "DANNY Create Page", + key: "notion-create-page", + name: "Create Page", description: "Create a page from a parent page. [See the documentation](https://developers.notion.com/reference/post-page)", - version: "0.2.{{ts}}", + version: "0.2.16", type: "action", props: { notion, diff --git a/docs-v2/pages/connect/components/index.mdx b/docs-v2/pages/connect/components/index.mdx index ec1390f9cc02f..c49b22d4c6e1f 100644 --- a/docs-v2/pages/connect/components/index.mdx +++ b/docs-v2/pages/connect/components/index.mdx @@ -322,7 +322,7 @@ The payload for the configuration API call must contain the following fields: 4. `configured_props`: an object containing the props that have already been configured. The initial configuration call must contain the ID of the account (aka `authProvisionId`) that your user has connected to the target app (see - [this section](workflows#configure-accounts-to-use-your-end-users-auth) for + [this section](/connect/managed-auth/quickstart) for more details on how to create these accounts). We'll use the [**List Commits** component for From 0895dae009f341405bfd09e1465567e093abc885 Mon Sep 17 00:00:00 2001 From: Danny Roosevelt Date: Fri, 6 Jun 2025 16:47:16 -0700 Subject: [PATCH 4/8] Fixing some refs --- docs-v2/pages/connect/api.mdx | 2 +- docs-v2/pages/connect/components/files.mdx | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/docs-v2/pages/connect/api.mdx b/docs-v2/pages/connect/api.mdx index 28fbf110081c6..982ce62ae666a 100644 --- a/docs-v2/pages/connect/api.mdx +++ b/docs-v2/pages/connect/api.mdx @@ -1941,7 +1941,7 @@ const { refName: "main" }, externalUserId: "jverce", - stash_id: "", // Optional: Pass an empty string to generate a new stash ID, "NEW", true, or a previously created stash ID + stashId: "", // Optional: Pass an empty string to generate a new stash ID, "NEW", true, or a previously created stash ID }); // Parse and return the data you need diff --git a/docs-v2/pages/connect/components/files.mdx b/docs-v2/pages/connect/components/files.mdx index 54862c0d7f8b5..f863e24121ced 100644 --- a/docs-v2/pages/connect/components/files.mdx +++ b/docs-v2/pages/connect/components/files.mdx @@ -108,7 +108,7 @@ The response includes a `stashId` and a `$filestash_uploads` export with informa { "localPath": "/tmp/mcp.png", "s3Key": "1day/proj_lgsqAAJ/exu_x1iK86/d4ffb5b1081d3aacd2929f23f270268c/u/mcp.png", - "get_url": "https://pipedream-file-stash-production.s3.us-east-1.amazonaws.com/1day/proj_lgsqAAJ/exu_x1iK86/d4ffb5b1081d3aacd2929f23f270267d/u/mcp.png?X-Amz-Algorithm=AWS4-HMAC-SHA256&X-Amz-Credential=ASIA5F5AGIEAUKI2SRTS%2F20250606%2Fus-east-1%2Fs3%2Faws4_request&X-Amz-Date=20250606T204541Z&X-Amz-Expires=1800&X-Amz-SignedHeaders=host&X-Amz-Security-Token=IQoJb3JpZ2luY3VjEI3%2F%2F%2F%2F%2F%2F%2F%2F%2F%2FwEaCXVzLWVhc3QtMSJIMEYCIQD2OIYvdeYa%2Fo5sVMU7IIsYWF3%2FD%2BNQqEybkjaOsj5hCwIhAOxElK8xyskFD9Ta3PELIyKe1km1%2B2BXt3q%2FkGrmhjkhKr8ECGYQAxoMOTA2MDM3MTgyNzIxIgyGEDixxP3rrPl3d4IqnATAHC5Hoed80bn5mNhA07bRrqqBh3FxkWV5rdtiGI9TluRqrZfC%2FIzxnhqMMXcW0ovj8ZmIjBEDFTQRy50COfYeXFriHB5iLVC5dr%2FumYt2y%2FJEIwIaCVlDJTSkmzOOZcyzFwzGNgqKarSD1P63vySsH7LfsocM4GQKfH1KbHYKkX4GIIEAcL9T9JYU7j3zQcOE2uNpF%2BZ1fVQ8Yg0stYhMIUzSy1fLNS1CRHvejU793PSgJoKrZq8zICQFz3yL5ZxWqfrT%2BxGSZKsSH0iEOKVKq7MK0cdxrVJJsgyzl6ixiIsDKhwgmA0PhT6kvZOof0XyozdJjPAN33v2XSx%2F4BD3MrDonk4d%2F8vweQubfrOwangOPG8USZo31PXvdf8AXnx5rqVmFUL3etUsdPO2NzF6K%2B8bXNHfwgROMVG54tVGhxAX80OuflLN9lhPq%2B0%2BKS0cIC%2BpG9RNk4iToz1IFP9OWQaJPgOjOf90cPQgYfOV%2F%2FqIR9133NtKBzksB%2F%2F%2Bu1M6HS8MAfhF%2BAf9vpT%2FjvTlJhcvtiqyCzGz4TqJzxzIlFRv1dSyS08U82C7rVgOKpNWwDDqB1IjqeAZFap6tFP3s5apixPvipUERd8c8%2F9izz4%2Bz%2BD0f3Gn%2BQIRuToKQpPp%2FKfJZ15g4Mu6H4s7s7Nsr4znzdT2SOlWGi%2Bw%2FrIKi47vJfA4MKwTlW9K8e%2FsmhzHkB9LEqU7Km%2Fk36Qw8KaNwgY6nAFw%2BP4e8vTHE2MyMAZ2GiwvdlE4%2BNPtJAX4L%2BrabrgxnAHgqR0xB%2B3rNI5b62zaMrUZCm7T28Fec%2BA2x16PFLw4yUUv8UksV3r0H3J9dO6%2FrORTxYz0UYq8aiARGvg8kcjOGJ72Q5wv%2B48Up8r39coHlyACOQdd6Lg4HsohStWgeDJV0LKXru6RkNmM3FJWcWUqOy8oZxgaWe%2F%2BBAo%3D&X-Amz-Signature=a7fb66bdf5de28bf3848c25eacbc417e3a1493ed55d38a7eb68b22bef873413d" + "get_url": "https://pipedream-file-stash-production.s3.us-east-1.amazonaws.com/1day/proj_lgsqAAJ/exu_x1iK86/d4ffb5b1081d3aacd2929f23f270267d/u/mcp.png?X-Amz-Algorithm=AWS4-HMAC-SHA256&X-Amz-Credential=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i47vJfA4MKwTlW9K8e%2FsmhzHkB9LEqU7Km%2Fk36Qw8KaNwgY6nAFw%2BP4e8vTHE2MyMAZ2GiwvdlE4%2BNPtJAX4L%2BrabrgxnAHgqR0xB%2B3rNI5b62zaMrUZCm7T28Fec%2BA2x16PFLw4yUUv8UksV3r0H3J9dO6%2FrORTxYz0UYq8aiARGvg8kcjOGJ72Q5wv%2B48Up8r39coHlyACOQdd6Lg4HsohStWgeDJV0LKXru6RkNmM3FJWcWUqOy8oZxgaWe%2F%2BBAo%3D&X-Amz-Signature=c9hd88df7hfg40dh5060e47gcde639h5c3615gf77f60e9bgc90d44dh095636f" } ] }, From 396ab1b2b230626a9e2e51b15101b440a4e3a9e8 Mon Sep 17 00:00:00 2001 From: Danny Roosevelt Date: Fri, 6 Jun 2025 17:12:48 -0700 Subject: [PATCH 5/8] Expanding on file stash reuse --- docs-v2/pages/connect/components/files.mdx | 90 ++++++++++++++++------ 1 file changed, 67 insertions(+), 23 deletions(-) diff --git a/docs-v2/pages/connect/components/files.mdx b/docs-v2/pages/connect/components/files.mdx index f863e24121ced..be15e50a9a157 100644 --- a/docs-v2/pages/connect/components/files.mdx +++ b/docs-v2/pages/connect/components/files.mdx @@ -98,7 +98,7 @@ curl -X POST https://api.pipedream.com/v1/connect/{project_id}/actions/run \ ### Response -The response includes a `stashId` and a `$filestash_uploads` export with information about the uploaded files: +The response includes a `stashId` and a `$filestash_uploads` export with information about the files that were downloaded to `/tmp` and then synced to File Stash: ```json { @@ -126,37 +126,58 @@ The response includes a `stashId` and a `$filestash_uploads` export with informa Each file in the `$filestash_uploads` array includes: -- `localPath`: The path to the file in the `/tmp` directory -- `s3Key`: The unique key for the file in the Pipedream File Store +- `localPath`: The path to the file in the `/tmp` directory where it was downloaded or created +- `s3Key`: The unique key for the file in the Pipedream File Store after being synced from `/tmp` - `get_url`: A presigned URL that allows downloading the file for 30 minutes ## Usage Examples ### Reusing a stash ID -To add more files to an existing stash, provide the same `stash_id` in subsequent action runs: +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 + +To reuse a stash ID, simply pass the same `stashId` value to subsequent action runs: ```javascript -// First run generates a stash ID -const firstRun = await pd.actionRun({ +// First action run - download a file from Google Drive +const firstResponse = await pd.actionRun({ externalUserId: "abc-123", - actionId: "download-file-1", - configuredProps: { /* ... */ }, - stashId: "NEW" + actionId: "google_drive-download-file", + configuredProps: { + googleDrive: { + authProvisionId: "apn_gyhLaz3" + }, + fileId: "1xyz123", + filePath: "/tmp/report1.pdf" + }, + stashId: "" // Generate a new stash ID }); -// Save the stash ID -const savedStashId = firstRun.stashId; +const stashId = firstResponse.stashId; -// Later, add more files to the same stash -const secondRun = await pd.actionRun({ - externalUserId: "abc-123", - actionId: "download-file-2", - configuredProps: { /* ... */ }, - stashId: savedStashId // Reuse the existing stash ID +// Second action run - use the same file in another action (e.g., upload to Dropbox) +const secondResponse = await pd.actionRun({ + externalUserId: "abc-123", + actionId: "dropbox-upload-file", + configuredProps: { + dropbox: { + authProvisionId: "apn_mmhHPgj" + }, + path: "/", + name: "uploaded-report.pdf", + filePath: "/tmp/report1.pdf" // Same file path as in the first action + }, + stashId: stashId // Reuse the stash ID to maintain access to the file }); + +// The file downloaded in the first action is available to the second action ``` @@ -167,12 +188,18 @@ curl -X POST https://api.pipedream.com/v1/connect/{project_id}/actions/run \ -H "Authorization: Bearer {access_token}" \ -d '{ "external_user_id": "abc-123", - "id": "download-file-1", - "configured_props": { /* ... */ }, + "id": "google_drive-download-file", + "configured_props": { + "googleDrive": { + "authProvisionId": "apn_gyhLaz3" + }, + "fileId": "1W6ZssXLvVE-YN8rRbQlqggCpdIF-gdh1", + "filePath": "/tmp/myfile.txt" + }, "stash_id": "NEW" }' -# Get the stash_id from the response +# Get the stash_id from the response (e.g., "abcd1234") # Second request using the same stash curl -X POST https://api.pipedream.com/v1/connect/{project_id}/actions/run \ @@ -180,14 +207,31 @@ curl -X POST https://api.pipedream.com/v1/connect/{project_id}/actions/run \ -H "Authorization: Bearer {access_token}" \ -d '{ "external_user_id": "abc-123", - "id": "download-file-2", - "configured_props": { /* ... */ }, - "stash_id": "d4ffb5b1081d3aacd2929f23f270237d" + "id": "dropbox-upload-file", + "configured_props": { + "dropbox": { + "authProvisionId": "apn_mmhHPgj" + }, + "path": "/", + "name": "my-upload.txt", + "filePath": "/tmp/myfile.txt" + }, + "stash_id": "abcd1234" }' ``` +### Common multi-action file workflows + +A typical workflow involving files across multiple actions might look like: + +1. Download a file from an external service to `/tmp` +2. Process or transform the file +3. Upload the file to another service + +For this to work reliably, you need to use the same `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. + ## File Storage Duration Files in the File Stash are automatically deleted after 24 hours. The presigned URLs remain valid for 30 minutes from the time they are generated. From b7b5f7cc490a9fc822014f4d355a41c8959272f1 Mon Sep 17 00:00:00 2001 From: Danny Roosevelt Date: Fri, 6 Jun 2025 17:13:29 -0700 Subject: [PATCH 6/8] Update pnpm-lock.yaml --- pnpm-lock.yaml | 10 +++++----- 1 file changed, 5 insertions(+), 5 deletions(-) diff --git a/pnpm-lock.yaml b/pnpm-lock.yaml index 2d2418143e493..90c91502acfe7 100644 --- a/pnpm-lock.yaml +++ b/pnpm-lock.yaml @@ -15775,7 +15775,7 @@ importers: version: 3.1.7 ts-jest: specifier: ^29.2.5 - version: 29.2.5(@babel/core@7.26.0)(@jest/transform@29.7.0)(@jest/types@29.6.3)(babel-jest@29.7.0(@babel/core@7.26.0))(jest@29.7.0(@types/node@20.17.30)(babel-plugin-macros@3.1.0))(typescript@5.7.2) + version: 29.2.5(@babel/core@8.0.0-alpha.13)(@jest/transform@29.7.0)(@jest/types@29.6.3)(babel-jest@29.7.0(@babel/core@8.0.0-alpha.13))(jest@29.7.0(@types/node@20.17.30)(babel-plugin-macros@3.1.0))(typescript@5.7.2) tsup: specifier: ^8.3.6 version: 8.3.6(@microsoft/api-extractor@7.47.12(@types/node@20.17.30))(jiti@1.21.6)(postcss@8.4.49)(tsx@4.19.4)(typescript@5.7.2)(yaml@2.6.1) @@ -15818,7 +15818,7 @@ importers: version: 3.1.0 jest: specifier: ^29.1.2 - version: 29.7.0(@types/node@20.17.6)(babel-plugin-macros@3.1.0) + version: 29.7.0(@types/node@20.17.30)(babel-plugin-macros@3.1.0) type-fest: specifier: ^4.15.0 version: 4.27.0 @@ -49699,7 +49699,7 @@ snapshots: ts-interface-checker@0.1.13: {} - ts-jest@29.2.5(@babel/core@7.26.0)(@jest/transform@29.7.0)(@jest/types@29.6.3)(babel-jest@29.7.0(@babel/core@7.26.0))(jest@29.7.0(@types/node@20.17.30)(babel-plugin-macros@3.1.0))(typescript@5.7.2): + ts-jest@29.2.5(@babel/core@8.0.0-alpha.13)(@jest/transform@29.7.0)(@jest/types@29.6.3)(babel-jest@29.7.0(@babel/core@8.0.0-alpha.13))(jest@29.7.0(@types/node@20.17.30)(babel-plugin-macros@3.1.0))(typescript@5.7.2): dependencies: bs-logger: 0.2.6 ejs: 3.1.10 @@ -49713,10 +49713,10 @@ snapshots: typescript: 5.7.2 yargs-parser: 21.1.1 optionalDependencies: - '@babel/core': 7.26.0 + '@babel/core': 8.0.0-alpha.13 '@jest/transform': 29.7.0 '@jest/types': 29.6.3 - babel-jest: 29.7.0(@babel/core@7.26.0) + babel-jest: 29.7.0(@babel/core@8.0.0-alpha.13) ts-jest@29.2.5(@babel/core@8.0.0-alpha.13)(@jest/transform@29.7.0)(@jest/types@29.6.3)(babel-jest@29.7.0(@babel/core@8.0.0-alpha.13))(jest@29.7.0(@types/node@20.17.6)(babel-plugin-macros@3.1.0))(typescript@5.6.3): dependencies: From f1ba6d8a7e31d145cc255add412f62bfc8decbd6 Mon Sep 17 00:00:00 2001 From: Danny Roosevelt Date: Fri, 6 Jun 2025 17:13:50 -0700 Subject: [PATCH 7/8] Update pnpm-lock.yaml --- pnpm-lock.yaml | 10 +++++----- 1 file changed, 5 insertions(+), 5 deletions(-) diff --git a/pnpm-lock.yaml b/pnpm-lock.yaml index 90c91502acfe7..2d2418143e493 100644 --- a/pnpm-lock.yaml +++ b/pnpm-lock.yaml @@ -15775,7 +15775,7 @@ importers: version: 3.1.7 ts-jest: specifier: ^29.2.5 - version: 29.2.5(@babel/core@8.0.0-alpha.13)(@jest/transform@29.7.0)(@jest/types@29.6.3)(babel-jest@29.7.0(@babel/core@8.0.0-alpha.13))(jest@29.7.0(@types/node@20.17.30)(babel-plugin-macros@3.1.0))(typescript@5.7.2) + version: 29.2.5(@babel/core@7.26.0)(@jest/transform@29.7.0)(@jest/types@29.6.3)(babel-jest@29.7.0(@babel/core@7.26.0))(jest@29.7.0(@types/node@20.17.30)(babel-plugin-macros@3.1.0))(typescript@5.7.2) tsup: specifier: ^8.3.6 version: 8.3.6(@microsoft/api-extractor@7.47.12(@types/node@20.17.30))(jiti@1.21.6)(postcss@8.4.49)(tsx@4.19.4)(typescript@5.7.2)(yaml@2.6.1) @@ -15818,7 +15818,7 @@ importers: version: 3.1.0 jest: specifier: ^29.1.2 - version: 29.7.0(@types/node@20.17.30)(babel-plugin-macros@3.1.0) + version: 29.7.0(@types/node@20.17.6)(babel-plugin-macros@3.1.0) type-fest: specifier: ^4.15.0 version: 4.27.0 @@ -49699,7 +49699,7 @@ snapshots: ts-interface-checker@0.1.13: {} - ts-jest@29.2.5(@babel/core@8.0.0-alpha.13)(@jest/transform@29.7.0)(@jest/types@29.6.3)(babel-jest@29.7.0(@babel/core@8.0.0-alpha.13))(jest@29.7.0(@types/node@20.17.30)(babel-plugin-macros@3.1.0))(typescript@5.7.2): + ts-jest@29.2.5(@babel/core@7.26.0)(@jest/transform@29.7.0)(@jest/types@29.6.3)(babel-jest@29.7.0(@babel/core@7.26.0))(jest@29.7.0(@types/node@20.17.30)(babel-plugin-macros@3.1.0))(typescript@5.7.2): dependencies: bs-logger: 0.2.6 ejs: 3.1.10 @@ -49713,10 +49713,10 @@ snapshots: typescript: 5.7.2 yargs-parser: 21.1.1 optionalDependencies: - '@babel/core': 8.0.0-alpha.13 + '@babel/core': 7.26.0 '@jest/transform': 29.7.0 '@jest/types': 29.6.3 - babel-jest: 29.7.0(@babel/core@8.0.0-alpha.13) + babel-jest: 29.7.0(@babel/core@7.26.0) ts-jest@29.2.5(@babel/core@8.0.0-alpha.13)(@jest/transform@29.7.0)(@jest/types@29.6.3)(babel-jest@29.7.0(@babel/core@8.0.0-alpha.13))(jest@29.7.0(@types/node@20.17.6)(babel-plugin-macros@3.1.0))(typescript@5.6.3): dependencies: From 05596c70e6e1a8b4f2aed1cbad7742de07d37b73 Mon Sep 17 00:00:00 2001 From: Danny Roosevelt Date: Fri, 6 Jun 2025 17:16:11 -0700 Subject: [PATCH 8/8] pnpm-lock and page titles --- docs-v2/pages/connect/_meta.tsx | 8 ++++---- pnpm-lock.yaml | 16 ++++++++++++---- 2 files changed, 16 insertions(+), 8 deletions(-) diff --git a/docs-v2/pages/connect/_meta.tsx b/docs-v2/pages/connect/_meta.tsx index e48092a4f3d18..a2ee66af99dc2 100644 --- a/docs-v2/pages/connect/_meta.tsx +++ b/docs-v2/pages/connect/_meta.tsx @@ -1,12 +1,12 @@ export default { "index": "Overview", - "use-cases": "Use cases", - "managed-auth": "Managed auth", + "use-cases": "Use Cases", + "managed-auth": "Managed Auth", "components": "Tool Use", "mcp": "MCP", - "api-proxy": "API proxy", + "api-proxy": "API Proxy", "workflows": "Workflows", - "api": "API & SDK reference", + "api": "API & SDK Reference", "migrating-from-project-keys-to-oauth": { "display": "hidden", }, diff --git a/pnpm-lock.yaml b/pnpm-lock.yaml index 57f34e1807ac1..276a66d7b12ca 100644 --- a/pnpm-lock.yaml +++ b/pnpm-lock.yaml @@ -15633,6 +15633,14 @@ importers: specifier: ^6.0.0 version: 6.2.0 + modelcontextprotocol/node_modules2/@modelcontextprotocol/sdk/dist/cjs: {} + + modelcontextprotocol/node_modules2/@modelcontextprotocol/sdk/dist/esm: {} + + modelcontextprotocol/node_modules2/zod-to-json-schema/dist/cjs: {} + + modelcontextprotocol/node_modules2/zod-to-json-schema/dist/esm: {} + packages/ai: dependencies: '@pipedream/sdk': @@ -29182,22 +29190,22 @@ packages: superagent@3.8.1: resolution: {integrity: sha512-VMBFLYgFuRdfeNQSMLbxGSLfmXL/xc+OO+BZp41Za/NRDBet/BNbkRJrYzCUu0u4GU0i/ml2dtT8b9qgkw9z6Q==} engines: {node: '>= 4.0'} - deprecated: Please upgrade to v7.0.2+ of superagent. We have fixed numerous issues with streams, form-data, attach(), filesystem errors not bubbling up (ENOENT on attach()), and all tests are now passing. See the releases tab for more information at . + deprecated: Please upgrade to v9.0.0+ as we have fixed a public vulnerability with formidable dependency. Note that v9.0.0+ requires Node.js v14.18.0+. See https://github.com/ladjs/superagent/pull/1800 for insight. This project is supported and maintained by the team at Forward Email @ https://forwardemail.net superagent@4.1.0: resolution: {integrity: sha512-FT3QLMasz0YyCd4uIi5HNe+3t/onxMyEho7C3PSqmti3Twgy2rXT4fmkTz6wRL6bTF4uzPcfkUCa8u4JWHw8Ag==} engines: {node: '>= 6.0'} - deprecated: Please upgrade to v7.0.2+ of superagent. We have fixed numerous issues with streams, form-data, attach(), filesystem errors not bubbling up (ENOENT on attach()), and all tests are now passing. See the releases tab for more information at . + deprecated: Please upgrade to v9.0.0+ as we have fixed a public vulnerability with formidable dependency. Note that v9.0.0+ requires Node.js v14.18.0+. See https://github.com/ladjs/superagent/pull/1800 for insight. This project is supported and maintained by the team at Forward Email @ https://forwardemail.net superagent@5.3.1: resolution: {integrity: sha512-wjJ/MoTid2/RuGCOFtlacyGNxN9QLMgcpYLDQlWFIhhdJ93kNscFonGvrpAHSCVjRVj++DGCglocF7Aej1KHvQ==} engines: {node: '>= 7.0.0'} - deprecated: Please upgrade to v7.0.2+ of superagent. We have fixed numerous issues with streams, form-data, attach(), filesystem errors not bubbling up (ENOENT on attach()), and all tests are now passing. See the releases tab for more information at . + deprecated: Please upgrade to v9.0.0+ as we have fixed a public vulnerability with formidable dependency. Note that v9.0.0+ requires Node.js v14.18.0+. See https://github.com/ladjs/superagent/pull/1800 for insight. This project is supported and maintained by the team at Forward Email @ https://forwardemail.net superagent@7.1.6: resolution: {integrity: sha512-gZkVCQR1gy/oUXr+kxJMLDjla434KmSOKbx5iGD30Ql+AkJQ/YlPKECJy2nhqOsHLjGHzoDTXNSjhnvWhzKk7g==} engines: {node: '>=6.4.0 <13 || >=14'} - deprecated: Please downgrade to v7.1.5 if you need IE/ActiveXObject support OR upgrade to v8.0.0 as we no longer support IE and published an incorrect patch version (see https://github.com/visionmedia/superagent/issues/1731) + deprecated: Please upgrade to v9.0.0+ as we have fixed a public vulnerability with formidable dependency. Note that v9.0.0+ requires Node.js v14.18.0+. See https://github.com/ladjs/superagent/pull/1800 for insight. This project is supported and maintained by the team at Forward Email @ https://forwardemail.net supports-color@2.0.0: resolution: {integrity: sha512-KKNVtd6pCYgPIKU4cp2733HWYCpplQhddZLBUryaAHou723x+FRzQ5Df824Fj+IyyuiQTRoub4SnIFfIcrp70g==}