How to Create google sheet and add data?

Hi all,
i’m able to append data to an existing sheet but
I don’t understand how to create a google sheet and add some row.
I use google create for the spreadsheet, it’s OK
retrieve data from postgres, it’s ok
but how to create column header key to append data in this new spreadsheet ??

I miss something somewhere ?

Thanks

Welcome to the community @Chris_Doudet!

Yes, there is currently sadly no easy way to do that yet. You would have to go through RAW data to do it.

In the following example, you can define the columns in the Set node, comma-separated. Be however aware that this overwrites the data of the whole sheet. Probably not a problem in your case, as it is empty, but still wanted to have it mentioned.

Perfect,
thanks

You are welcome. Have fun!

if I understand correctly, this scenario can be used to update data. how do i add a row?

Hey @Max_T,

You can add a row using the Append operation.

@jan is there an updated version of this flow?

I tried following your steps and adapting it to the current versions of the actions, but I’m not having much success.

Unfortunately, the current version of the Google sheets node doesn’t support the raw operation anymore. But you can copy&paste the previous version from this example into your workflow

Why does n8n lose features after 3 years?
Data is an essential part of automation, and it should be improved. (You can see Zapier has its own data table integrated with many features in Zapier).

Are there other better ways to store data now?

Is there a better way to do this now (in version 1.78.0), or do I still need to go through this whole process?

I am now facing the same exact issue in 2025. Is there a better way of going at this by now, or how can I achieve the desired outcome (adding headers to a newly created Google Sheet)?

Same here. It seems odd that there is a manual dependency to make this automation work (create the spreadsheet with columns ahead of time, I mean).

However, I did copy/paste the old working example from earlier in this thread and it works.

This only works if you create a new spreadsheet every single time. But I want to create a new sheet within a spreadsheet. But if I use this workflow, it only changes the headers in the very first sheet in the workflow, not in the sheet I just created.

Or did I miss something, did you make it work?

Ahhh, no, you didn’t. I was only using it to create a new file and populate the column headers for later updating via the Append method.

It looks like the API allows you to create new sheets with “batchupdate” but at that point you are working with code.

The following will create a new google sheet and then based on the edit node create the header row in google sheets

Thank you, exactly what I was searching for, I´ll check it out immidiately.

Hi
Can you help me out how to do the same thing with an Ai Agent , mean how to set column name in the empty sheet for the first time .

Its just update the doc details in the sheet.

[

{

“Document”: “1Y7KNvUtPXV7ehYnXCR8jwbktmwMdHOU0lWa4wVC3ASg”,

“Sheet”: “HeaderNavigationContent”,

“Header_Row”: 1,

“toolCallId”: “call_V2rfQnJril4GC0Bh1xm5z5PC”

}

]