Can't append rows in G Sheet or write to G Docs

Describe the problem/error/question

I’m playing with an AI agent work flow that does Q&A with the user to collect home reno/repair tasks and supporting photos. When it’s done, it should write each identified task and corresponding photo(s) to a Google Sheet and to G Docs.

The AI agent appears to correctly record multiple tasks. But it only (appears to) write the last task item to G Sheets – not sure if previous task items are being overwritten, even though I am using the ‘Append Row’ operation in the Google Sheets node. And it creates the Google Doc but writes nothing to it at all.

What is the error message (if any)?

No error message. Just the output to G Sheet and G Docs is not what is expected.

Please share your workflow

Share the output returned by the last node

output of G Sheet Node (showing the 10th of 10 runs):

[
{
“response”: [
{
“DESCRIPTION_OF_WORK”: “Large mold issue in guest bedroom closet, approximately 2 feet across; no previous remediation steps taken; requires mold assessment and remediation.”,
“PHOTOS”: "=IMAGE("https://storage.googleapis.com/download/storage/v1/b/n8n_photos/o/%2F?generation=1746201857072247&alt=media\“)”
}
]
}
]

output of G Docs Node (unhelpful):

[
{
“response”: [
{
“kind”: “drive#file”,
“id”: “1qv1li-l0NDDdN6wjCuysH_9rNAs3AnEFtRNHTj4X2dc”,
“name”: “n8n Report Output”,
“mimeType”: “application/vnd.google-apps.document”
}
]
}
]

The output in G Sheet should contain a row for each run of the G sheets node. I.e., if the G Sheet node ran 10 times (10 task items), then there should be 10 rows in the Google Sheet. There is only one row in the Google Sheet, for the last run only. And the Google Doc is completely blank.

Information on your n8n setup

  • n8n version:
    1.90.2
  • Database (default: SQLite): I think default?
  • n8n EXECUTIONS_PROCESS setting (default: own, main): I think default?
  • Running n8n via (Docker, npm, n8n cloud, desktop app): n8n cloud
  • Operating system: Sequoia 15.3.2 (24D81)

I had a similar issue before, I enabled google drive API and change the operation to append or update and it worked

I “solved” it by reporting and therefore calling the ai model after each run:

You are a workflow agent responsible for processing LinkedIn contact search results and writing them to Google Sheets one at a time.

TASK OBJECTIVE

Your mission is to ENSURE that each contact is APPENDED INDIVIDUALLY to the Google Sheet, and ONLY AFTER the write operation completes, you must CONFIRM success to the user and THEN move to the next contact. You MUST ENFORCE SEQUENTIAL EXECUTION with reporting between each write.

INPUT PARAMETERS

  • Keyword: {{ $json[“keyword”] }}
  • maxResults: {{ $json.maxResults }}
  • account: {{ $json.account }}

STEP-BY-STEP EXECUTION (CHAIN OF THOUGHTS)

  1. UNDERSTAND the task: You must first search for contacts via LinkedIn’s API and then write each result to Google Sheets individually.

  2. BASICS: You will receive a batch of contacts. You are to iterate over them one at a time.

  3. BREAK DOWN the task:

    • Step 1: Call the LinkedIn Search Contacts API with the keyword.
    • Step 2: For EACH contact returned:
      • WAIT for the Google Sheets Append operation to complete
      • THEN continue to the next contact
  4. ANALYZE: If you do not wait for each Google Sheets node to finish, you risk multiple contacts being written in the same row or skipped due to concurrency issues.

  5. BUILD: Your loop MUST:

    • Execute the Google Sheets append synchronously
    • Await confirmation before moving forward
  6. FINAL BEHAVIOR: The agent must process entries in strict sequence

ENFORCED RULES

  • NEVER batch or parallelize writes to Google Sheets
  • ALWAYS WAIT for each append to finish before proceeding

EXAMPLE FLOW

  1. Search returns 5 contacts.
  2. First contact is written → Google Sheets confirms → Proceeds to second contact.
  3. Repeat until all contacts are processed.
1 Like

I had the same problem and this solution really works. Thank you!