Is it possible to programatically cancel an active integration run?

I’m using webhooks to kick off a timer when my front door is unlocked. It’s set to notify me if my door is left unlocked for 5 mins and again at 10 mins. It does this using wait nodes that wait 5 mins and then check the lock status.

The problem i’m running into is that if the door is locked and unlocked in that time frame it will kick off the workflow again and I might get two “unlocked” notifications in a few mins of each other.

The question is, if the webhook is called again, can I cancel the previous run or maybe call an action to kill any other active runs of the workflow?

Hey @mindofbeholder!

Welcome to the community :sparkling_heart:

I love your use case! Which Resume operation are you using in the Wait node? Is it the On webhook call operation? Can you share your workflow? Please remove any sensitive data with dummy data.

A solution that comes to my mind is to add a check to your workflow. Use a variable to store the status of your workflow - running, idle. Once your workflow is triggered, check for the status and proceed accordingly.

1 Like

I’m using time on the wait nodes.

Your check idea was great! What I ended up doing was storing a unix timestring in a redis instance I already had standing. I check the redis instance before checking the door and sending the time noti.

If the timestamp in the redis instance doesn’t match the timestamp for this cycle then that means the door has already been locked and unlocked again and this cycle should stop and let the new cycle take over.