I believe what’s happening here is that you are essentially creating HTML twice. The “Convert to HTML” operation of the “Convert to File” will try to generate an HTML table based on the input data. However, in the example case you have described the input data is already an HTML data structure.
n8n used to have a “Move Binary Data” node that would allow you to simply write raw text data into a file, but it seems that’s no longer possible using the Convert to File node
So my suggestion here would be to instead copy the good old “Move Binary Data” node from an older n8n version. It can no longer be added through the menu in newer n8n versions, but it’ll still work if you simply copy it from elsewhere.
Here’s an example workflow (from which you can also copy the aforementioned node):
So @Jon just hinted this is still possible using the new “Convert to File” node as well, although it’s hidden behind the base64 operation of the node. Here’s an updated example workflow:
Thank you! I was searching for the ‘Move Binary Data’ node but, as you mentioned, it’s no longer available in new versions of n8n. Now it’s difficult to figure out how to save the file because this feature is hidden under the base64 operation, which might be confusing for people with less programming experience.