Execute the Wait node after the last user message if the user doesn't send any messages within 15 minutes

The workflow is as follows: the bot waits 15 minutes after each user message. If the user sends another message before the 15 minutes are up, the wait node does nothing (timer should reset). If the user doesn’t send any messages within 15 minutes, the bot sends a message: ‘Please leave us your feedback.’ How do I build this workflow?

Benjamin’s right about needing external state. But if you don’t want to spin up Redis, n8n has Static Workflow Data built in.

Store last message timestamp in $workflow.staticData.lastMsg. At the start of every message: read it, compare to now. Under 15 min: update the timestamp. Over 15 min: send the feedback prompt, clear state.

Something like: incoming message → Code node reads $workflow.staticData.lastMsg, compares to now. If delta over 15 min: send feedback, clear state. If delta under 15 min: update timestamp, resume.

No extra infrastructure needed. Redis is better at scale but overkill for a single conversation flow.