Loops and String compare

Describe the problem/error/question

I want to exec a python script that outputs a string, than I want to compare this string to the previous output (for example 60 seconds apart). If the strings are the same do nothing, if the strings are different then send a signal and update the previous string with the new one.

What is the error message (if any)?

No errors, just that the loop does not work.

Please share your workflow

Share the output returned by the last node

After the wait it is always faster the “previous data” node, therefore the exec is not run again.

Information on your n8n setup

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

Hi @LorenzoZappa

Here’s a workflow that loops correctly. Replace the mock code step with your execute step and it should work for your data.

:heart:If this response helped you, please click the heart to show that it is useful
:white_check_mark:If this response solved your issue, mark it as the solution to help the community