Page 1 of 1

Force Stop Script

Posted: Sun Mar 02, 2025 7:01 am
by ezninnovation
When testing a script inside a flow, is there a way to force stop the script/flow? I have tried to stop the flow, but the element with the script is still stuck in the processing state so the flow won't stop. It will eventually timeout but it takes 15 minutes or so.

The message says "Some jobs are being process in the flow and the flow will be stopped as soon as they complete.

Re: Force Stop Script

Posted: Mon Mar 03, 2025 1:34 pm
by mkayyyy
I'd open the Progress pane in the Switch Designer, find the script that is stuck executing in the Progress pane, copy the Process ID and kill it in Resource Monitor (If you're on Windows, unsure on the Mac alternative) which will then let the flow stop

Image

Re: Force Stop Script

Posted: Tue Mar 04, 2025 2:44 pm
by tdeschampsBluewest
If you are lazy to search the ID in the ressource monitor, create a .bat with this ::

Code: Select all

@echo off
:Ask
echo processus to kill ? (number)
set INPUT=
set /p INPUT=%=%

TASKKILL /f /im %INPUT%
goto :Ask
Run it in administrator mode, then type the PID to kill it.

Re: Force Stop Script

Posted: Tue Mar 04, 2025 2:54 pm
by JimmyHartington
Nice .bat file.
I will use this on my server.

Re: Force Stop Script

Posted: Tue Mar 04, 2025 6:55 pm
by tdeschampsBluewest
Since we are on batFile, you can also use the following one.

:!: :!: :!: Keep in mind this one can be pretty nasty :evil: , and should be use in last resort at your own risk

Code: Select all

@echo off
:Ask
echo Are you sure to kill Switch?(y/n)
set INPUT=
set /P INPUT=Type input: %=%

If /I "%INPUT%"=="y" goto TaskKill
If /I "%INPUT%"=="n" goto Exit

:TaskKill
TASKKILL /f /im SwitchWatchdog.exe
TASKKILL /f /im Switch.exe
TASKKILL /f /im Switch_Service.exe
TASKKILL /f /im Switch_Helper.exe
TASKKILL /f /im SwitchScriptExecutor.exe
TASKKILL /f /im EnfocusSubscriptionNotifier.exe
timeout 2 >nul
goto Ask
:Exit
timeout 1 >nul
exitw


Re: Force Stop Script

Posted: Wed Mar 05, 2025 8:12 am
by jan_suhr
Have you tried the Switch preferences/Error handling/Abort processes after (minutes) and set it to just 1 minute. Then it should quit gracefully and just stop the problem flow.

You can change this while testing and then put it back to normal when you're done?