Gmail Reply Node

I’m building a Gmail-based automation

My workflow fetches emails from a thread using the Gmail API and sends a reply using a Gmail Send node.
However, my reply email only includes the new message I’m composing - it does not include the full thread history (previous messages in the conversation), as would normally happen when replying in the Gmail web interface.
I want the reply to mimic Gmail’s native behavior: the new message should appear at the top, and below it the entire thread history (from the original message onward) should be included automatically, preserving the formatting as much as possible.

Hello! Welcome to the community!

You can try these steps:

  1. Fetch the last message from the Thread

Use the Gmail → Get Thread or Gmail API HTTP Request to retrieve the conversation history.

  1. Extract the payload.parts or snippet (for plain text) or body.data (for HTML) of the most recent message(s).

  2. Build a combined reply message (in HTML)

  3. Send the final message via Gmail send node
    Paste the combined HTML into the Raw Content (HTML) field.

Tell me if it works!

Thank you!
so there’s no way to use is like the manual interface? only with the workaround of adding the history to the thread each time?

I think the Gmail API doesn’t replicate the behavior of the Gmail web interfacewhen replying.

There is no built-in way to automatically include thread history or quoted text. The web interface handles that internally for UI purposes, but the API requires you to manually construct the entire message, including any previous content you want to show.

So yes, the workaround of retrieving and appending the message history yourself is currently the only way to fully mimic Gmail’s native reply experience when using automation via n8n.

does anyone have a working sample of this? I did my best but including the message history is proving to be a challange.

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