๐Ÿ’ฌ How to build a workflow that detects new bullet points in a Google Doc (DE), translates them with ChatGPT, and appends them to another Doc (FR)?

Hi everyone :wave:

Iโ€™m trying to build the following automated workflow in n8n and would love your help on how to best structure it:


:repeat:

Goal:

I have two Google Docs:

  1. Original Document (DE) โ†’ written in German
  2. Translated Document (FR) โ†’ should receive the French translations

Whenever I add new bullet-point-style lines (e.g. marketing headlines) to the original document, I want n8n to:

  • Detect only the new lines (not already processed)
  • Translate each new line to French using ChatGPT (OpenAI)
  • Append the translated version to the bottom of the translated document

:brain:

Current Setup:

  • Iโ€™m using Google Docs โ†’ Get to read the German document
  • Iโ€™m using a Static Data node to store the last known content (body field)
  • In a Function node, I compare the current vs. previous content (split by line)
  • I plan to pass each new line to OpenAI and then use Append Text for the French doc

:x:

Problem(s):

  • The Function node keeps throwing:Referenced node doesnโ€™t existโ€ฆeven though both nodes (Google Docs & Static Data) are connected
  • Iโ€™m unsure how to correctly pass two inputs into a Function node
  • I also want to update the Static Data after each successful run to store the new DE content

:bulb:

My question:

How would you structure this workflow cleanly in n8n?

Especially:

  • Best practices for comparing two text inputs line-by-line
  • How to pass two different inputs into a Function node
  • How to reliably store and update previous values between runs (via Static Data or better approach?)

Iโ€™m happy to share my JSON export if needed. Thank you in advance :pray: