Workflow Pause/Terminate

Wondering if anyone could help me understand the steps required to create buttons that 1-pause and 2-terminate a workflow that is running.

Usually workflows are only triggered. If you have a “long” workflow (maybe you are using a long time delay) you can add “pass through a condition” between actions to check for a variable, then other workflows can modify that variable to make the condition fail.

Probably there is a better way to achieve what you want. Can you share some details about your workflow and what are you trying to accomplish?

@dorilama Are you saying that a workflow could somehow cancel an active time delay in another workflow? Can you elaborate please?

the nocode time delay action can’t be canceled. If you need to create your own cancelable timers you need to use js with setTimeout or setInterval and their correspondent clear functions, and trigger workflows (wwLib.executeWorkflow) from the callbacks.
There is a post by Aurelie about something like this.
It’s very easy to create infinite loops or multiple instances of the timeout because of multiple executions that don’t clear the previous instance, so be aware of this and check your implementation.

1 Like

Thanks @dorilama. I’m asking this in the context of trying to create an auto-logout feature after a certain amount of time. Have you created something like that in WeWeb?

relying on a timer to auto logout is not the best approach. For example think about an use that will just close the browser, your auto-logout workflow will never execute. A better way is to set a shorter token expiration for auth and then either auto refresh the toke at intervals or send the user to login when a request is made and the token is expired.
Xano doesn’t support refresh tokens. There are topics about implementing it on their forum.
Supabase handles refresh tokens and has utility functions specifically for this.


Sounds good thanks @dorilama!

1 Like