Skip to content

Commit d085d49

Browse files
File Stash docs
1 parent ff5e01a commit d085d49

File tree

7 files changed

+228
-16
lines changed

7 files changed

+228
-16
lines changed

components/notion/actions/create-page/create-page.mjs

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -4,10 +4,10 @@ import base from "../common/base-page-builder.mjs";
44

55
export default {
66
...base,
7-
key: "notion-create-page",
8-
name: "Create Page",
7+
key: "DANNY-notion-create-page",
8+
name: "DANNY Create Page",
99
description: "Create a page from a parent page. [See the documentation](https://developers.notion.com/reference/post-page)",
10-
version: "0.2.16",
10+
version: "0.2.{{ts}}",
1111
type: "action",
1212
props: {
1313
notion,

components/slack/actions/send-message-to-channel/send-message-to-channel.mjs

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -3,10 +3,10 @@ import constants from "../../common/constants.mjs";
33

44
export default {
55
...common,
6-
key: "slack-send-message-to-channel",
7-
name: "Send Message to Channel",
6+
key: "slack-send-message-to-channel-DANNY",
7+
name: "DANNY Send Message to Channel",
88
description: "Send a message to a public or private channel. [See the documentation](https://api.slack.com/methods/chat.postMessage)",
9-
version: "0.0.4",
9+
version: "0.0.{{ts}}",
1010
type: "action",
1111
props: {
1212
slack: common.props.slack,

docs-v2/pages/connect/_meta.tsx

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -2,7 +2,7 @@ export default {
22
"index": "Overview",
33
"use-cases": "Use cases",
44
"managed-auth": "Managed auth",
5-
"components": "Tool calling",
5+
"components": "Tool Use",
66
"mcp": "MCP",
77
"api-proxy": "API proxy",
88
"workflows": "Workflows",

docs-v2/pages/connect/api.mdx

Lines changed: 23 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -225,7 +225,8 @@ curl -X POST "https://api.pipedream.com/v1/connect/{your_project_id}/actions/run
225225
},
226226
"projectId": 45672541,
227227
"refName": "main"
228-
}
228+
},
229+
"stash_id": ""
229230
}'
230231
```
231232

@@ -1847,6 +1848,20 @@ which you want to execute the action.
18471848

18481849
The ID of the last prop reconfiguration (if applicable).
18491850

1851+
---
1852+
1853+
`stash_id` **string|boolean** (_optional_)
1854+
1855+
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.
1856+
1857+
You can pass one of the following values:
1858+
- An empty string (`""`) to generate a new stash ID
1859+
- `"NEW"` to generate a new stash ID
1860+
- `true` to generate a new stash ID
1861+
- A previously created stash ID to reference existing files
1862+
1863+
See the [File Stash docs](/connect/components/files) for more details.
1864+
18501865
##### Examples
18511866

18521867
<Tabs items={['TypeScript', 'Node.js', 'HTTP (cURL)']}>
@@ -1882,6 +1897,7 @@ const requestOpts: RunActionOpts = {
18821897
refName: "main"
18831898
},
18841899
externalUserId: "jverce",
1900+
stashId: "", // Optional: Pass an empty string to generate a new stash ID, "NEW", true, or a previously created stash ID
18851901
};
18861902
const response: RunActionResponse = await pd.runAction(requestOpts);
18871903

@@ -1925,6 +1941,7 @@ const {
19251941
refName: "main"
19261942
},
19271943
externalUserId: "jverce",
1944+
stash_id: "", // Optional: Pass an empty string to generate a new stash ID, "NEW", true, or a previously created stash ID
19281945
});
19291946

19301947
// Parse and return the data you need
@@ -1950,11 +1967,12 @@ echo '{
19501967
"id": "gitlab-list-commits",
19511968
"configured_props": {
19521969
"gitlab": {
1953-
"authProvisionId": "apn_kVh9AoD"
1970+
"auth_provision_id": "apn_kVh9AoD"
19541971
},
1955-
"projectId": 45672541,
1956-
"refName": "main"
1957-
}
1972+
"project_id": 45672541,
1973+
"ref_name": "main"
1974+
},
1975+
"stash_id": ""
19581976
}' > data.json
19591977

19601978
curl -X POST "https://api.pipedream.com/v1/connect/{your_project_id}/actions/run" \
Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,4 @@
1+
export default {
2+
"index": "Overview",
3+
"files": "Working with Files",
4+
} as const
Lines changed: 193 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,193 @@
1+
import { Tabs } from "nextra/components";
2+
import Callout from '@/components/Callout';
3+
4+
# Working with Files
5+
6+
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.
7+
8+
## File Stash
9+
10+
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.
11+
12+
### How it works
13+
14+
1. Files created in `/tmp` during execution are synced with a Pipedream File Store when you pass `stashId` in the action execution payload
15+
2. Each file is assigned a presigned URL that remains valid for 30 minutes
16+
3. These URLs allow anyone with the link to download the file directly
17+
18+
## When to use stashId
19+
20+
You should pass the `stashId` parameter when:
21+
22+
1. You're working with actions that download or generate files in `/tmp`, such as actions with "file", "upload", or "download" in their name
23+
2. You're working with actions that have a `filePath` or `filename` prop
24+
3. You want to make files accessible outside of Pipedream's execution environment
25+
26+
To generate a new stash ID, you can pass:
27+
- An empty string (`""`)
28+
- The string `"NEW"`
29+
- Boolean `true`
30+
31+
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.
32+
33+
<Callout type="info">
34+
Avoid passing `stashId` unnecessarily as it will slightly increase response time.
35+
</Callout>
36+
37+
## API Reference
38+
39+
### Running actions with File Stash
40+
41+
To enable File Stash when running an action, use the `stash_id` parameter in your request:
42+
43+
| Parameter | Type | Description |
44+
| --- | --- | --- |
45+
| `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. |
46+
47+
<Tabs items={['Node.js', 'HTTP (cURL)']}>
48+
<Tabs.Tab>
49+
```javascript
50+
const resp = await pd.actionRun({
51+
externalUserId: "abc-123",
52+
actionId: "google_drive-download-file",
53+
configuredProps: {
54+
googleDrive: {
55+
authProvisionId: "apn_gyhLaz3"
56+
},
57+
fileId: {
58+
"__lv": {
59+
"label": "important files > mcp-hot.jpg",
60+
"value": "16nlbFcgtgZkxLLMT2DcnBrEeQXQSriLs"
61+
}
62+
},
63+
filePath: "/tmp/mcp-hot.jpg"
64+
},
65+
stashId: "" // An empty string will generate a new stash ID
66+
});
67+
68+
// The response contains file URLs in $filestash_uploads
69+
console.log(resp.exports.$filestash_uploads);
70+
```
71+
</Tabs.Tab>
72+
<Tabs.Tab>
73+
```bash
74+
curl -X POST https://api.pipedream.com/v1/connect/{project_id}/actions/run \
75+
-H "Content-Type: application/json" \
76+
-H "X-PD-Environment: {environment}" \
77+
-H "Authorization: Bearer {access_token}" \
78+
-d '{
79+
"external_user_id": "abc-123",
80+
"id": "google_drive-download-file",
81+
"configured_props": {
82+
"googleDrive": {
83+
"authProvisionId": "apn_jyhKbx4"
84+
},
85+
"fileId": {
86+
"__lv": {
87+
"label": "important files > mcp-hot.jpg",
88+
"value": "16nlbFcgtgZkxLLMT2DcnBrEeQXQSriLw"
89+
}
90+
},
91+
"filePath": "/tmp/mcp.png"
92+
},
93+
"stash_id": ""
94+
}'
95+
```
96+
</Tabs.Tab>
97+
</Tabs>
98+
99+
### Response
100+
101+
The response includes a `stashId` and a `$filestash_uploads` export with information about the uploaded files:
102+
103+
```json
104+
{
105+
"exports": {
106+
"$summary": "Successfully downloaded the file, \"mcp.png\"",
107+
"$filestash_uploads": [
108+
{
109+
"localPath": "/tmp/mcp.png",
110+
"s3Key": "1day/proj_lgsqAAJ/exu_x1iK86/d4ffb5b1081d3aacd2929f23f270268c/u/mcp.png",
111+
"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%2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w8KaNwgY6nAFw%2BP4e8vTHE2MyMAZ2GiwvdlE4%2BNPtJAX4L%2BrabrgxnAHgqR0xB%2B3rNI5b62zaMrUZCm7T28Fec%2BA2x16PFLw4yUUv8UksV3r0H3J9dO6%2FrORTxYz0UYq8aiARGvg8kcjOGJ72Q5wv%2B48Up8r39coHlyACOQdd6Lg4HsohStWgeDJV0LKXru6RkNmM3FJWcWUqOy8oZxgaWe%2F%2BBAo%3D&X-Amz-Signature=a7fb66bdf5de28bf3848c25eacbc417e3a1493ed55d38a7eb68b22bef873413d"
112+
}
113+
]
114+
},
115+
"os": [],
116+
"ret": {
117+
"fileMetadata": {
118+
"name": "mcp.png",
119+
"mimeType": "image/png"
120+
},
121+
"filePath": "/tmp/mcp.png"
122+
},
123+
"stashId": "d4ffb5b1081d3aacd2929f23f270237d"
124+
}
125+
```
126+
127+
Each file in the `$filestash_uploads` array includes:
128+
129+
- `localPath`: The path to the file in the `/tmp` directory
130+
- `s3Key`: The unique key for the file in the Pipedream File Store
131+
- `get_url`: A presigned URL that allows downloading the file for 30 minutes
132+
133+
## Usage Examples
134+
135+
### Reusing a stash ID
136+
137+
To add more files to an existing stash, provide the same `stash_id` in subsequent action runs:
138+
139+
<Tabs items={['Node.js', 'HTTP (cURL)']}>
140+
<Tabs.Tab>
141+
```javascript
142+
// First run generates a stash ID
143+
const firstRun = await pd.actionRun({
144+
externalUserId: "abc-123",
145+
actionId: "download-file-1",
146+
configuredProps: { /* ... */ },
147+
stashId: "NEW"
148+
});
149+
150+
// Save the stash ID
151+
const savedStashId = firstRun.stashId;
152+
153+
// Later, add more files to the same stash
154+
const secondRun = await pd.actionRun({
155+
externalUserId: "abc-123",
156+
actionId: "download-file-2",
157+
configuredProps: { /* ... */ },
158+
stashId: savedStashId // Reuse the existing stash ID
159+
});
160+
```
161+
</Tabs.Tab>
162+
<Tabs.Tab>
163+
```bash
164+
# First request with new stash
165+
curl -X POST https://api.pipedream.com/v1/connect/{project_id}/actions/run \
166+
-H "Content-Type: application/json" \
167+
-H "Authorization: Bearer {access_token}" \
168+
-d '{
169+
"external_user_id": "abc-123",
170+
"id": "download-file-1",
171+
"configured_props": { /* ... */ },
172+
"stash_id": "NEW"
173+
}'
174+
175+
# Get the stash_id from the response
176+
177+
# Second request using the same stash
178+
curl -X POST https://api.pipedream.com/v1/connect/{project_id}/actions/run \
179+
-H "Content-Type: application/json" \
180+
-H "Authorization: Bearer {access_token}" \
181+
-d '{
182+
"external_user_id": "abc-123",
183+
"id": "download-file-2",
184+
"configured_props": { /* ... */ },
185+
"stash_id": "d4ffb5b1081d3aacd2929f23f270237d"
186+
}'
187+
```
188+
</Tabs.Tab>
189+
</Tabs>
190+
191+
## File Storage Duration
192+
193+
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.

docs-v2/pages/connect/components.mdx renamed to docs-v2/pages/connect/components/index.mdx

Lines changed: 1 addition & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -647,6 +647,7 @@ following fields:
647647
[`$.export` in a Node.js](/workflows/building-workflows/code/nodejs/#using-export) component.
648648
2. `os`: a list of observations produced by the action (e.g. logs, errors, etc).
649649
3. `ret`: the return value of the action, if any.
650+
4. When using [File Stash](/connect/components/files) to sync local files, the response will also include a `stash` property with file information.
650651

651652
The following (abbreviated) example shows the output of running the action
652653
above:
@@ -1036,10 +1037,6 @@ This prop type is used by these database actions:
10361037
- `azure_sql-execute-raw-query`
10371038
- `turso-execute-query`
10381039

1039-
<Callout type="warning">
1040-
The `sql` prop is only supported in the Pipedream server SDK and REST API, and is not currently supported in `connect-react`.
1041-
</Callout>
1042-
10431040
#### Configuration
10441041

10451042
When configuring these actions, you'll need to provide:

0 commit comments

Comments
 (0)