Loop Counter not storing/ retrieving value properly

I am trying to set up a loop so that after an error is reported a certain number of times it sends a message to the admins.

Right now I have a mutate node that sets
{{Count}} = {{Count}}+1

and when count is greater than 3 I want it to send a sms, to monitor what is happening I have it make an event each time it goes through the loop:

The latest 3 messages are after implementing the {{count}} +1 logic. My question is how can I store the value of Count and compare it in my loop to make sure the message will get sent after 3 loops?

image

If it was working properly I would think it would look like

count = 2
count = 1
count = 3
count = 2
count = 1

Hey @Jackson_Miller,

I would suggest using Workflow Storage. You would create a number type key with the name count. Then in your workflow, you can use the Storage: Get to get the value, use a conditional node to check if it is above a certain value, and if it isn’t, then you can use the Storage: Set with the Increment Value option.

Let me know if this is something that will work for you!

Thank you,
Heath

1 Like