You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Copy file name to clipboardExpand all lines: apps/docs/content/docs/integrations/file.mdx
+5-4Lines changed: 5 additions & 4 deletions
Display the source diff
Display the rich diff
Original file line number
Diff line number
Diff line change
@@ -87,15 +87,16 @@ Fetch and parse a file from a URL with optional custom headers.
87
87
88
88
### File Write
89
89
90
-
Create a new workspace file. If a file with the same name already exists, a numeric suffix is added (e.g., "data (1).csv").
90
+
Create a new workspace file, either from text content or from an existing file. If a file with the same name already exists, a numeric suffix is added (e.g., "data (1).csv").
91
91
92
92
#### Input
93
93
94
94
| Parameter | Type | Required | Description |
95
95
| --------- | ---- | -------- | ----------- |
96
-
|`fileName`| string | Yes | File name \(e.g., "data.csv"\). If a file with this name exists, a numeric suffix is added automatically. |
97
-
|`content`| string | Yes | The text content to write to the file. |
98
-
|`contentType`| string | No | MIME type for new files \(e.g., "text/plain"\). Auto-detected from file extension if omitted. |
96
+
|`fileName`| string | No | File name \(e.g., "data.csv"\). Required when writing text; optional when storing a file, which keeps its own name unless this overrides it. If the name already exists, a numeric suffix is added automatically. |
97
+
|`content`| string | No | The text content to write to the file. Provide exactly one of content or fileInput. |
98
+
|`fileInput`| file | No | An existing file to store in the workspace, such as one produced by an earlier tool. Use this for anything that is not text — PDFs, images, audio, archives. Provide exactly one of content or fileInput. |
99
+
|`contentType`| string | No | MIME type for new files \(e.g., "text/plain"\). Auto-detected from the file extension, or taken from the stored file, if omitted. |
Copy file name to clipboardExpand all lines: apps/docs/content/docs/tables/index.mdx
+3Lines changed: 3 additions & 0 deletions
Display the source diff
Display the rich diff
Original file line number
Diff line number
Diff line change
@@ -24,13 +24,16 @@ Every column has a type, which decides how its values are stored and validated.
24
24
|**Currency**| An amount in a currency you pick per column |`$1,234.56`|
25
25
|**Boolean**|`true` or `false`|`true`|
26
26
|**Date**| A date |`2026-03-16`|
27
+
|**Expiration**| An absolute row expiration time, stored as Unix epoch seconds (seconds since January 1, 1970 UTC) |`1773671400`|
27
28
|**JSON**| An object or array |`{ "tier": "pro" }`|
28
29
|**Select**| One of a fixed set of options, or several |`Pro`|
29
30
30
31
Types are enforced as you enter values, so a Number column only takes numbers.
31
32
32
33
A Currency column stores a plain number and renders it in the currency you choose for that column, so filters, sorts, and exports all see the amount itself. Changing a column's currency relabels it — it does not convert the amounts.
33
34
35
+
A table can have one Expiration column. Adding it enables row expiration; rows with a non-empty expiration value become eligible for deletion after that time passes. Cleanup runs periodically, so actual row removal may happen after the expiration timestamp rather than exactly at it. Deleting the Expiration column disables expiration for the table. Expiration cells use the date editor, while APIs and workflows read and write integer Unix epoch seconds.
36
+
34
37
## Editing a table
35
38
36
39
Open the **Tables** section in the sidebar and click **New table** to create one. Add columns from the column header, type into a cell to edit it, and paste rows from a spreadsheet to bulk-load. Filter and sort from the toolbar without changing the underlying data. The editor has full keyboard support; see [keyboard shortcuts](/keyboard-shortcuts).
`.path` resolves to the file's location on the sandbox filesystem, so any language
119
+
can open it — pandas, ffmpeg, a CLI. It is the counterpart to `.base64`, which
120
+
inlines the contents instead and works only in JavaScript. Both appear in the
121
+
reference dropdown next to `.name` and `.size`.
122
+
123
+
**Writing.** Anything your code writes to `/tmp/sim/outputs` comes back as
124
+
`<function.files>`, a list of file objects any file-accepting block takes directly —
125
+
attach them to an email, upload them to storage, or save them to the workspace with
126
+
the File block. There is nothing to turn on.
127
+
128
+
The one exception is a call that names an explicit `outputSandboxPath`. That asks
129
+
for particular paths to be exported and answers with that export's own result, so
130
+
the output directory is not harvested alongside it — choose one or the other rather
131
+
than expecting both in the same run.
132
+
133
+
<Callouttype="info">
134
+
Referencing `.path` runs the block in the remote sandbox, since the local
135
+
JavaScript VM has no filesystem — expect the slower start of a remote run even for
136
+
plain JavaScript. Referencing the file itself (`<gmail.attachments[0]>`, `.name`,
137
+
`.url`) does not, and stays local. Up to 20 files come back per run, 50MB total,
138
+
nested no more than 11 directories deep; a run that exceeds any of these fails
139
+
rather than returning part of what your code wrote.
140
+
</Callout>
141
+
142
+
<Callouttype="warn">
143
+
Returned files live with the execution rather than in your workspace, and a text
144
+
file containing a resolved secret value is refused rather than returned — there is
145
+
nowhere on an execution file to record that it carries one. Write such a file to a
146
+
workspace path instead, or keep the secret out of the output.
147
+
</Callout>
105
148
106
149
## Language
107
150
@@ -401,8 +444,8 @@ The lazy `sim.files` and `sim.values` helpers are available only in JavaScript f
401
444
{ question: "What languages does the Function block support?", answer: "JavaScript, Python, and Shell. JavaScript is the default. Python remains a stable saved language choice; Shell and custom Sandbox controls appear when a remote sandbox provider is enabled. Python and Shell execution require that provider." },
402
445
{ question: "When does code run locally vs. in a sandbox?", answer: "JavaScript without external imports runs in a local isolated sandbox for speed. JavaScript that uses import or require, Python, and Shell run in the configured remote sandbox." },
403
446
{ question: "Does JavaScript still work without E2B or Daytona?", answer: "Yes. JavaScript without import or require runs in Sim's local isolated VM and does not require a remote provider. JavaScript with external imports, Python, Shell, and custom Sandboxes require E2B or Daytona and fail explicitly when it is unavailable." },
404
-
{ question: "How do I reference outputs from other blocks inside my code?", answer: "Use angle-bracket syntax directly, like <agent.content> or <api.data>, with no quotes around the tag — Sim replaces it with the real value before execution. For environment variables, use double curly braces: {{API_KEY}}." },
405
-
{ question: "What does the Function block return?", answer: "Two outputs: resultand stdout. Use return in JavaScript, assign __sim_result__ in Python, or print an __SIM_RESULT__= marker in Shell to set result. Ordinary console, print, and command output goes to stdout." },
447
+
{ question: "How do I reference outputs from other blocks inside my code?", answer: "Use angle-bracket syntax directly, like <agent.content> or <api.data>, with no quotes around the tag — Sim replaces it with the real value before execution. For environment variables, use double curly braces: {{API_KEY}}. To read a file, reference its path — <gmail.attachments[0].path> mounts it and resolves to a location any language can open." },
448
+
{ question: "What does the Function block return?", answer: "Three outputs: result, stdout, and files. Use return in JavaScript, assign __sim_result__ in Python, or print an __SIM_RESULT__= marker in Shell to set result. Ordinary console, print, and command output goes to stdout. Anything your code writes to /tmp/sim/outputs comes back in files as a file object later blocks can accept directly." },
406
449
{ question: "Can I make HTTP requests from a Function block?", answer: "Yes. fetch() is available in JavaScript with async/await. In Python, use requests or httpx. In Shell, use curl or a CLI available on the selected sandbox." },
407
450
{ question: "Is there a timeout for Function block execution?", answer: "Yes, a configurable execution timeout. If your code exceeds it, the run is terminated and the block reports an error. Keep this in mind for external calls or heavy processing." },
0 commit comments