Storing Data in N8N

I have an issue. I want to send a lot of contacts through GHL (CRM) to n8n where they will be written on google sheets, but this happens super fast and the contacts on google sheet get messed up.

So in the end only 1 or 2 contacts get in the google sheet. I believe that this is because the rows get overwritten by the new data.

I’m not sure how to proceed. Is there a way to store all the contacts that come from GHL somehow on n8n or some workaround?

It looks like your topic is missing some important information. Could you provide the following if applicable.

  • n8n version:
  • Database (default: SQLite):
  • n8n EXECUTIONS_PROCESS setting (default: own, main):
  • Running n8n via (Docker, npm, n8n cloud, desktop app):
  • Operating system:

I’ve faced a similar issue before. I think it’s a bug with the Google Sheets node.
What n8n version are you in?

But you have some options:

  1. Use a Loop node to process each item individually, and you can also add a Wait node to the loop, to prevent items from overwriting each other.
  2. Use HTTP Request to call the Sheets API, instead of using the default node (if this is a bug, this option will avoid it)
  3. Store your data in a database instead. Databases are way faster and more reliable than spreadsheets.

If my reply answers your question, please remember to mark it as a solution.

1 Like

Before proceeding, check with google sheets history/log so that you can confirm that the data is actually getting over written, or some thing else

Hi @solomon,

Thanks for the reply.

I don’t think that the loop node will work because the item are already processed individually. I send the contacts from GHL 1 by 1 to the webhook in n8n. (btw if I didn’t understand you correctly feel free to correct me!)

I will give it a go with the http request and database.

Hey @Yo_its_prakash,

Thanks for the reply, to be honest I’m not sure how to do that, because the ghl contacts are send separately. If you have any suggestions let me know!

Yes, you are correct about items being processed one by one. That’s a key behavior from n8n.

But what I’m telling you is to add a WAIT node in your loop, so you can give enough time for the Sheets API to process the inputs, instead of throwing everything too fast into it.

Sending items too fast to Google Sheets is unfortunately the reason for this bug.

I don’t know if n8n can fix this or if it’s an issue in the Sheets API.

To find that out, you would have to try my second suggestion, which is using a custom HTTP request node.

Please try one of the solutions I told you in my first reply. They will probably fix your issue

Hi, have you tried to add an “Wait” step ?

Hi Vasislav,

The issue is happening because the webhook you’re using to trigger the n8n workflow through GHL (CRM) is causing data to be written to the Google spreadsheet multiple times. This can happen when the webhook triggers before the previous data has finished saving, which results in new data overwriting what was already written.

A good solution would be to switch from the webhook to using the GHL API. This would allow you to first retrieve the contacts from GHL, check if they already exist in the spreadsheet, and only add the new ones. This way, you can avoid the data being overwritten and make sure only unique contacts are added.

Let me know if you have any other questions!

1 Like

Update:

I tried Airtable (kinda works but it has a maximum of 5 request per second) I ended up using supabase, it just works better and also added drip mode in GHL (1000 contacts every 5 minutes) otherwise n8n gets overwhelmed. Last test size was 8K+ contacts.

1 Like

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