Seeking Help: Google Sheets ID Not Recognized in n8n Automation (Full Workflow Orchestration)
Hello n8n & Perplexity community!
We’re building a no-code AI content production pipeline using Google Sheets + Google Apps Script + n8n + Perplexity + OpenAI + Tavus, and we’ve hit a blocker we can’t resolve on our own.
The Goal
We want to create a fully automated, scalable system for AI content generation and video creation using avatars. Here’s how it’s supposed to work:
1. User adds a topic to a Google Sheet in column B (“Topic”)
2. Google Apps Script:
- Automatically generates a unique ID in column A
- Adds a timestamp in column G
- Then triggers an n8n webhook via
UrlFetchApp.fetch()
usingid
andtopic
as GET query params
3. n8n Flow (Stage 1 expected sequence):
Webhook Trigger (GET)
receives the ID & TopicSanitizeParams
Code node standardizes inputSaveToSheet
node (Google Sheets – Update Row) updates the corresponding row withstatus = "pending"
andcreated_at
- Flow continues through logic branches depending on approval status
4. If Status = “approved”:
- Perplexity is called (sonar-pro-online)
- The response is processed by OpenAI (caption + hashtags + full post)
- Tavus API is triggered to render an avatar-based video with ElevenLabs voice
- Final result is stored in the sheet (Media_URL column) and prepared for publishing
The Problem
Everything was working… until we accidentally deleted and recreated the Google Sheet tab (same name: "Social_Media_Plan_v2"
).
Since then:
Webhook
still receives the ID and topicSanitizeParams
node works correctly- BUT
SaveToSheet
fails silently – no update happens, andid
becomes{}
in input - Even after rebuilding the Google Sheets node, setting Sheet by ID, reauthenticating OAuth2 credentials, and mapping all columns manually – it still doesn’t match the
id
column.
What We’ve Tried
- Confirmed
gid
(sheetId) and manually configured node Sheet → Select by ID - Ensured “ID” column is formatted as Plain Text
- Manually hardcoded an ID for testing – still no update
- Verified webhook is sending:
https://example.n8n.cloud/webhook/studio-trigger?id=ID-test123&topic=AutomationTest
- Used Debug node to inspect input – JSON shows:
json
КопіюватиРедагувати
{
"query": {
"id": "ID-test123",
"topic": "AutomationTest"
}
}
- Updated Code Node to:
javascript
КопіюватиРедагувати
const query = $node["Webhook Trigger"].json.query || {};
return [{
json: {
id: String(query.id).trim(),
topic: query.topic.trim(),
status: "pending",
createdAt: new Date().toISOString(),
updatedAt: new Date().toISOString()
}
}];
- Headers match exactly: “ID” (not “Id” or “id”)
- Tried
Map Each Column Manually
,Match on Column: ID
, header row = 1, first data row = 2 - Tried reauthenticating Google credentials completely
What We Need Help With
- Why is n8n’s Google Sheets node not recognizing the ID, even when everything is correctly passed and mapped?
- Could Google Apps Script triggers or sheet recreation (gid change) cause a hidden issue even after rebuilding the node?
- Can you help us validate if our webhook setup → param parsing → Google Sheets Update pattern is best practice?
Our Goal After Fixing This
Once the SaveToSheet
works again:
- If
status == approved
, we call Perplexity (sonar-pro-online
) to generate content - Process that content through OpenAI (
gpt-4
), generate 1 caption, hashtags, and post - Trigger Tavus API + D-ID for video rendering
- Store
Media_URL
and final content back to the Google Sheet - Later: auto-post to Buffer, Telegram, LinkedIn
Tools Used
- Google Sheets – structured with columns:
ID
,Topic
,Status
,Caption
,Hashtags
,Post
,Media_URL
,Created_At
,Updated_At
- n8n Cloud – main automation flow
- Perplexity API – via HTTP node
- OpenAI – for content rewriting
- Tavus + ElevenLabs – video + audio
- Apps Script – to trigger webhook and insert metadata
We would truly appreciate any advice or help from the community or Perplexity team.
If needed, I can share screenshots or sanitized JSON examples privately.
Thanks in advance,