Add the Write file tool step to your tool
- Open your tool and click + Add step.
- Search for Write file and select it.
- Enter the File path — the path where the file should be written within the filesystem mount.
- Enter the Content — the text to write to the file.
- Click Run step to test the write and confirm the file was created.
Parameters
The path where the file should be written, relative to the filesystem mount root. For example:
reports/output.txt or data/result.json. If intermediate directories in the path do not exist, the step will return an error.The text content to write to the file. The file will contain exactly this string — no formatting or encoding is applied automatically.
Examples
Saving LLM output to a file
Saving LLM output to a file
An agent generates a report using an LLM step and saves it for later retrieval:
The file is written to the filesystem mount and persists for future agent runs.
| Parameter | Value |
|---|---|
file_path | reports/weekly_summary.txt |
content | {{llm_step.output}} |
Creating a JSON data file
Creating a JSON data file
An agent writes structured data output to a JSON file:
The Python code step produces a JSON string, which Write file saves to the specified path.
| Parameter | Value |
|---|---|
file_path | data/results.json |
content | {{python_step.output}} |
Initializing a file with a template
Initializing a file with a template
An agent creates a new configuration file with default values at the start of a workflow:
| Parameter | Value |
|---|---|
file_path | config/run_config.json |
content | {"status": "pending", "retries": 0, "last_run": null} |
Write file vs. Edit file
| Use case | Recommended step |
|---|---|
| Creating a new file | Write file |
| Replacing the full contents of a file | Write file |
| Changing a specific part of a file | Edit file |
Frequently asked questions (FAQs)
What happens if the file already exists?
What happens if the file already exists?
The existing file is overwritten entirely. There is no merge — the new content completely replaces the old content. If you need to preserve existing content, read the file first and incorporate its contents into the new content string.
Does Write file create missing directories?
Does Write file create missing directories?
No. If the directories in the file path do not already exist, the step returns an error. Create any necessary directories before using Write file, or use a Python code step with
os.makedirs to create the directory structure.Can I append content to an existing file?
Can I append content to an existing file?
Write file always overwrites. To append, use a Read file step to get the current contents, concatenate the new content in a subsequent step, then write the combined result back with Write file.
Is there a maximum file size?
Is there a maximum file size?
There is no hard limit imposed by the Write file step itself, but very large content strings may be constrained by tool step input limits or filesystem mount capacity.

