Kill Process
The shutdown switch for anything StartProcess launched
- trigger
- trigger
- success
- status
Every background process your workflow starts eventually needs to stop, and Kill Process is how you do it politely instead of hunting for a terminal. It's the cleanup half of comfyui-sg-process-manager's Start Process → Kill Process pair: you give it the same process_key you started with, and it terminates that process for you.
The key thing to understand is scope. Kill Process only knows about processes this pack started and is tracking - it looks them up by process_key in the pack's global registry, not by scanning your OS. If you want to kill something ComfyUI didn't launch, that's what Kill Process by PID and Kill Process by Name are for. This one is the "undo" button for your own workflow.
How it works
Under the hood it's a terminate-then-escalate routine. A normal kill sends a graceful termination signal - proc.terminate() on Unix, which is SIGTERM, letting the process clean up. If you check force_kill, it goes straight to proc.kill() (SIGKILL, no cleanup, instant). Either way the node then waits up to five seconds; if the process hasn't died by then, it force-kills it and tells you so. So even a "graceful" kill has a hard fail-safe built in, which is the right call for automation that has to keep moving.
The inputs and outputs that matter
It's a lean node. Three inputs:
trigger(any type) - passthrough. The kill only fires when this is fed, so you can wire it to a separate branch or a later point in the graph. The trigger value is echoed out.process_key- the key of the process to terminate. It must match the key you used in Start Process, exactly. Typos here are the #1 failure.force_kill(defaultFalse) - graceful terminate vs. hard kill.
Outputs are trigger (passthrough), success (BOOLEAN - whether the termination worked), and status (STRING - "Process terminated", "Process force killed", or "Process not found" if the key isn't in the registry).
Install
It ships with the rest of the pack. In ComfyUI Manager search "comfyui-sg-process-manager", or:
cd ComfyUI/custom_nodes
git clone https://github.com/sebagallo/comfyui-sg-process-manager.git
Restart ComfyUI. No extra dependencies, no model downloads - it's all stdlib.
Gotchas that actually bite
- "Process not found" means the key isn't registered - different key, the process was already killed, or it exited on its own. Note that if the process died naturally, its key can linger in the registry; the status message is your source of truth.
- The pack cleans up after itself. On ComfyUI exit, every tracked process is force-killed automatically, so orphaned background processes from this pack shouldn't survive a restart. If you're killing a process because ComfyUI is misbehaving, remember that these nodes run inside the same process - a hung ComfyUI means the kill won't fire.
- Security, one more time: this node runs in a custom node with full OS access, so only run it from workflows you trust - the same rule as everything else in this pack.
Inputs (3)
| Name | Type | Default | Description |
|---|---|---|---|
| trigger | * | — | |
| process_key | STRING | my_process | — |
| force_killopt | BOOLEAN | false | — |
Outputs (3)
| Name | Type | Description |
|---|---|---|
| trigger | * | — |
| success | BOOLEAN | — |
| status | STRING | — |