Write to HTML

Hi!

I’m struggling with my workflow development and can’t figure out the next step. Tried the templates and search, but can’t seem to find the same solution. Maybe someone can share some great insights, experience how-to’s…

Thank you in advance!

Challenge 1: Write HTML file after generating HTML template

I got the data in airtable to pick it up and then there has to be a report as an output. It will be filled with text, charts and bullets. I can get the data into a template and style it with inline CSS and afterwards I would like to write it to a HTML file.

I put it in the node ‘Write File to Disk’, but how to configure so that:

  1. It saves as .html with the actual code in it.
  2. To get a dynamic file name by using the fields before (e.g. name)

Challenge 2: Generate PDF from HTML

A bonus would be to have the output saved as HTML as above and as PDF as well. Might be a next step of course, depending on complexity I guess.

My workflow so far…

Share the output returned by the last node

Error; The item has no binary field.

I thought passing the HTML output to the ‘Input Binary Field’ would be the right thing. But i get stuck on the binary data. And it seems I can’t get the participants list to name the .html files as well. The error message:
[Can’t determine which item to use]

Information on your n8n setup

  • n8n version: local instance, v1.61.0
  • Database (default: SQLite): Default
  • n8n EXECUTIONS_PROCESS setting (default: own, main): Default?
  • Running n8n via (Docker, npm, n8n cloud, desktop app): Docker, local
  • Operating system: Windows

hello @schaepdlx

before using the Read/Write data in file node use a Convert to File node with HTML operation

This topic was automatically closed 90 days after the last reply. New replies are no longer allowed.