Workflow overridden by another

Hi,

I made a flow with a sleep function in javascript (similar to this one: https://n8n.io/workflows/948), the flow is triggered by a typeform entry and is followed by a 4h sleep then a telegram message is sent by a bot.

The problem I am facing is that if a user A input something and 1h later a user B, I will only receive the telegram message of the user B. Because the user A flow has been overridden somehow by the user B.

Is there a way to avoid this to happen?

Hey @Sandoche!

Welcome to the community :wave:

As the workflow is triggered again, the previous execution data gets deleted. The workflow doesn’t have access to the previous execution data. I would suggest you break down the workflow into two workflows:
Workflow 1: Send data from Typeform to Google Sheets (or any other database you prefer)
Workflow 2: Setup a Cron node to trigger the workflow every 4 hours. This workflow will get the new data in the Google Sheets node and send a message on Telegram. In this workflow, we are using the concept of polling. You can read more about it here: Creating triggers for n8n workflows using polling ⏲

Thanks that looks awesome!

Let us know if you still have more questions :slight_smile:

Very nice of you.

Just one questions out of curiosity, would this work for me: Scaling n8n | Docs

Could setting up this queue system avoid to get the previous data deleted? or is it unrelated?

This is unrelated. If you’re hosting n8n on your own servers, and want to scale it, that’s when it is going to be helpful.