N8N

n8n convert to file node

The Convert to File node is one of the most useful tools in n8n that doesn’t get enough attention. This node is amazing if you’ve ever wanted to make structured files like spreadsheets, JSON documents, or text files right in your processes, without using Google Docs or other apps.

I’m going to explain what the Convert to File node does, how it works, and why it’s such an important tool for automation in this piece.

Before we start, if you are looking for help with a n8n project, we are taking on customers. Head over to our n8n Automation Engineer page.

What Is the Convert to File Node?

The Convert to File node in n8n allows you to generate files directly within your workflows. Instead of just passing data around between services, you can transform that data into actual downloadable documents.

 

Supported file formats include:

  • Spreadsheets: CSV, XLS, XLSX, ODS

  • Text-based files: TXT, HTML, RDF

  • Data exchange formats: JSON

  • Base64 file handling: Convert base64 strings back into usable files

That means you can take any structured data, whether it comes from an API, a database, or an AI-generated output and instantly turn it into a real file.

 

 

Example 1

Sometimes, when building or testing workflows in n8n, you just need some dummy data to work with. Instead of waiting for an external API or database, you can quickly generate mock JSON inside n8n using the Edit Fields node. From there, the Convert to File node allows you to transform that JSON into a structured Excel (XLSX) file that you can download and share.

 

 

Add the Edit Fields Node

  1. In your n8n workflow, create a new node and select Edit Fields.

  2. Set the node mode to Manual Input.

  3. Add your mock JSON data directly into the node.

For example, here’s a simple dataset of fictional companies:

 

				
					[
{
"companyName": "SnapVerse",
"founder": "Liam Parker",
"yearFounded": 2019,
"industry": "Social Media"
},
{
"companyName": "FitTrackr",
"founder": "Ava Thompson",
"yearFounded": 2021,
"industry": "Health & Fitness"
},
{
"companyName": "EduSphere",
"founder": "Noah Patel",
"yearFounded": 2017,
"industry": "EdTech"
},
{
"companyName": "ShopSmart",
"founder": "Emma Williams",
"yearFounded": 2020,
"industry": "E-commerce"
},
{
"companyName": "Travelio",
"founder": "James Rodriguez",
"yearFounded": 2018,
"industry": "Travel & Hospitality"
}
]

				
			

 

Connect to the Convert to File Node

  1. Add a Convert to File node after your Edit Fields node.

  2. Configure the Operation to Convert JSON to File.

  3. Choose your desired output format—in this case, XLSX for Excel.

At this point, n8n knows to take the structured JSON you created and turn it into an actual file.

Execute and Download

  1. Run the workflow (either with a manual execution or a trigger).

  2. Open the Convert to File node output.

Click Download to save the generated .xlsx file locally.

Final thought

Why This Workflow Is Useful

  • Quick Prototyping: No need for live data sources when you just want to test logic.

  • Export Flexibility: You can generate XLSX, CSV, JSON, HTML, or text files.

  • Data Sharing: Structured test files can be handed off to teammates without needing external databases.

  • Base64 Support: Beyond JSON, the Convert to File node can also re-create files from base64 strings

Thank you for reading this article. Make sure to check out our other n8n content on the website. If you need any help with n8n workflows we are taking on customers so reach out

Leave a Reply

Your email address will not be published. Required fields are marked *