I have completed my very first agent. yei!. Well, sort of, mostly completed. I created a workflow to write blogs as per my requirements. One issue I am having is publishing to Google Docs as a fully formatted document. H1, H2, and H3 are not being formatted, and instead come out as HEADING 2, HEADING 3 line items at the beginning of the paragraph. I have tried using an agent to format it and tried different prompts, but nothing seems to work.
The document comes out as plain text, no formatting whatsoever. I am also having issues getting it to hyperlink key phrases.
output from the last node before publishing is this
“
Easy Divorce: Your Guide to a Kinder, Smoother Separation
Hello @Oscar_Chavarria
Welcome to the n8n community and congrats for your first agent!
Unfortunately the current Google Docs node only inserts plain text. It doesn’t translate Markdown, HTML or heading tags, so everything lands as body text and the “H1/H2/H3” labels vanish. The same limitation prevents hyperlinks.
This is a known gap in the node. See also this topic to have more insights.
Here are a few ways to fix it:
HTML file:
Export your blog post as a proper HTML file (with real “h1”, “a href”, etc.) and upload it to Google Drive using the Upload File node. If you set the right mimeType, Drive will convert it into a Google Doc with the formatting preserved.
HTTPS Request:
Use an HTTP Request to call Google Docs API directly (specifically batchUpdate). That way, you can insert text and style it however you want.
If you want to use Notion to store your blog posts. I can help you create a page entry for each blog post with the formatting you need (headers, paragraph, bullets, etc…)
Thank you very much for this. ChatGPT created an HTTP request for me and gave me several different scripts, and they all kept failing. It suspects an error with my Oath authentication, but I can create blog posts, and my permissions look fine. So I will try the HTML file, ChatGPT did not think of that. Thanks for the clarification!
Thanks for your comment. I am not using Notion yet, but are you saying that even then, I would need to create an entry page first? I cannot just publish directly a formatted doc?
There are 2 notion nodes in n8n the create and update pages.
You do have to create the page first using n8n, then using the ID of the new page, you have to call the append block notion node, which will make the content. Unfortunately, you do have to make 2 calls because of the way blocks work.
Notion is cool for blogging, because you can make a database where each page name is the title of the blog post and n8n will automatically pull in the page, perform the AI prompt to generate content and then update the pages content.