Convert to File
Turn a value into a downloadable file — Markdown, text, JSON, CSV, HTML, PDF, Word or Excel.
A Convert to File node (convert_to_file) turns one value into a file that is kept with the run for 30 days. Set three things:
Configuration
| Field | Type | Default | Description |
|---|---|---|---|
sourceExpression | string | '' | What to write, usually an expression such as {{ upstream.report-writer.output.text }}. |
format | md | txt | json | csv | html | pdf | docx | xlsx | md | The file format. |
filename | string | report | Expressions allowed. The format's extension is added when the name lacks it. |
shareWith | workflow | project | workflow | This workflow only, or Every workflow in this project — see below. |
- Format — Markdown (
.md), text (.txt), JSON, CSV, HTML, PDF, Word (.docx) or Excel (.xlsx). - Source — what to write, usually an expression such as
{{ upstream.report-writer.output.text }}. - File name — expressions allowed, for example
report-{{ trigger.body.day }}. The format's extension is added when the name lacks it. - Who can use the file — This workflow only (the default) or Every workflow in this project.
What each format expects of its source:
| Format | Source |
|---|---|
| Markdown, text | Text, written as-is. Anything else is written as JSON. |
| JSON | Any value. Text that is JSON is parsed first, so a model's JSON answer is pretty-printed. |
| CSV, Excel | An array of objects (one row each; the columns are every key, in first-seen order) or an array of arrays. |
| HTML, PDF, Word | Markdown — headings, bold and italic, links, lists, tables, quotes and code blocks are kept. |
Using a file from another workflow
A file belongs to the workflow that made it. AI Prompt attachments, Send Email, HTTP Request, FTP and app nodes can read it only from that workflow, and a file id that arrives some other way (for example in a webhook payload) does not change that.
To hand a file to a second workflow, set Who can use the file to Every workflow in this project on the Convert to File node that makes it, then pass the file's fileId along (for example in the webhook payload that starts the second workflow). Sharing never crosses a project, and never crosses an organization. A workflow in another project is refused with a message that names the fix.
A shared file is kept for the same 30 days as any other.
PDFs use a font that covers every EU language, including Greek and Cyrillic. In a CSV, a text cell that starts with =, +, - or @ is prefixed with ' so a spreadsheet does not run it as a formula.
Output
| Field | Type | Description |
|---|---|---|
file | file | The file reference — attach it, send it, or read it with an AI Prompt. |
file.filename | string | The file name. |
file.contentType | string | Its content type. |
file.sizeBytes | number | Its size. |
file.text | string | Its content as text. |
The node's output is {{ upstream.<nodeId>.output.file }} — the same file reference a Form Trigger upload produces, so an AI Prompt node can read it as an attachment. file.filename, file.contentType, file.sizeBytes and file.text (the content as text) are there too.
In the node editor's Output pane, a run's file shows its name, type and size with a Download button. After 30 days the file is deleted and the button says so.
Limits and errors
- Files are capped at 25 MB and kept for 30 days.
- A source that does not fit the format — not an array for CSV or Excel — fails the node with the reason.
Example
name: Weekly report PDF
description: Writes the weekly report and saves it as a PDF.
graph:
nodes:
- id: weekly
type: trigger_recurrence
position: { x: 0, y: 0 }
data: { mode: cron, cronExpression: 0 7 * * 1, timezone: Europe/Sofia }
- id: write
type: ai_prompt
position: { x: 280, y: 0 }
data:
llm_slot: writer-model
model_id: gpt-4o
instructions: "Write last week's report in Markdown. Today is {{ run.startedAt }}."
outputFormat: text
- id: to-pdf
type: convert_to_file
position: { x: 560, y: 0 }
data:
sourceExpression: '{{ upstream.write.output.completionText }}'
format: pdf
filename: weekly-report
shareWith: workflow
edges:
- { id: weekly-to-write, source: weekly, target: write }
- { id: write-to-pdf, source: write, target: to-pdf }In a Package
- Travels:
sourceExpression,format,filename,shareWith - Converted: none
- Never carried: none