This is an item, but it’s empty

Hi. I have a workflow built to automatically send messages to leads on Whatsapp.

All the leads who send a message on the form on my website are registered in Google Sheets.

That’s where my workflow starts. Every 5 minutes n8n checks if there is a new contact in the spreadsheet and sends a sequence of messages.

What’s the problem?
Even when there isn’t a new contact, the flow runs to the end. I get the following message: “This is an item, but it’s empty.”

Is there any way to make the flow stop when there is no new contact?

In theory, the If node that I call “Não recebeu” (it’s “Didn’t receive” in portuguese) should stop the flow from continuing because I’ve set some locks.

Version: 1.25.1
Running n8n via Docker
Operating system: Ubuntu 20.04.6

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:

@lfilippi , replace your “home-made” polling of the spreadsheet with Sheet trigger.

1 Like

My trigger is a Cron that doesn’t work between 6pm and 7am. It doesn’t work on Sundays either.

At times, more than 30 contacts accumulate in the spreadsheet during breaks.

So I don’t know if the Google Sheets trigger fits in this case.

Can anyone help? :disappointed_relieved:

Why don’t you have the form hooked up right into n8n and have that trigger it? Then you can have the same workflow add them to the sheet if you want to keep track of it?

If that doesn’t work you should follow @ihortom’s suggestion and replace the cron trigger with the built in sheet trigger. That will simplify a lot in the workflow.

If it can only work at certain hours, then have a separate workflow that you trigger based on time (with an If node) that has a delay until it’s within your desired time range.
It’s not a problem that there are a lot of contacts in a short time, it will all be getting processed regardless.

If you need to keep your schedule trigger the way it is then try to set up an if statement node somewhere to check if the data is there, and if it’s not quick out.

Let me know if that’s not helpful and you need more help

1 Like

Thank you for your help @ihortom and @liam

The proposed solutions make sense, but I wanted to avoid changing the workflow structure too much because it meets my needs.

I found the solution. My node that checks for new contacts that have not yet been answered had the Always Output Data setting enabled.

All I had to do was deactivate Always Output Data and my lock to stop the workflow from continuing if there are no new contacts stopped proceeding with empty fields.

1 Like

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