WorkflowServiceRunner keeps lingering when I run an Automator Service via keyboard shortcut

Hi, when I trigger an Automator Quick Action/Service from a keyboard shortcut, it runs, but WorkflowServiceRunner sometimes doesn’t exit and stays in Activity Monitor. After a few uses, I end up with multiple lingering WorkflowServiceRunner processes. Running the same workflow directly from Automator seems fine.

Has anyone hit this? Any reliable workaround to make keyboard-triggered Services exit cleanly every time?

Related older report: https://stackoverflow.com/q/18455465

This issue seems to have become much more noticeable since macOS 26 —
the problem where WorkflowServiceRunner and FolderActionsDispatcher don’t terminate properly.

I’ve been running the following script at the end of my Automator workflows.
I’m not completely sure if this is the “correct” way to handle it, but so far I haven’t had any problems.
So please take it only as a reference.

use AppleScript version "2.8"
use framework "Foundation"
use framework "AppKit"
use scripting additions
property refMe : a reference to current application

log doQuitAutomatorRunner()




##################################
#com.apple.automator.xpc.runnerの終了
to doQuitAutomatorRunner()
	#terminateAutomaticallyTerminableApplications 自動終了
	#	refMe's NSRunningApplication's terminateAutomaticallyTerminableApplications()
	#
	set listBundleID to {"com.apple.automator.xpc.runner", "com.apple.automator.xpc.workflowServiceRunner", "com.apple.Automator", "com.apple.appkit.xpc.openAndSavePanelService", "com.apple.quicklook.QuickLookUIService"} as list
	#terminate 通常終了
	repeat with itemBundleID in listBundleID
		set ocidAppArray to (refMe's NSRunningApplication's runningApplicationsWithBundleIdentifier:(itemBundleID))
		repeat with itemApp in ocidAppArray
			itemApp's terminate()
		end repeat
	end repeat
	
	#forceTerminate 強制終了
	#	repeat with itemBundleID in listBundleID
	#		set ocidAppArray to (refMe's NSRunningApplication's runningApplicationsWithBundleIdentifier:(itemBundleID))
	#		repeat with itemApp in ocidAppArray
	#			itemApp's forceTerminate()
	#		end repeat
	#	end repeat
	try
		tell application "System Events" to quit
	end try
	#terminateAutomaticallyTerminableApplications 自動終了
	refMe's NSRunningApplication's terminateAutomaticallyTerminableApplications()
end doQuitAutomatorRunner

System Events also tends to remain in memory without being GC’d…
And the AppNap issues are tough too.
macOS 26 is really challenging in many ways.

I forgot to mention one thing:
since this approach forces the process to terminate itself,
the Automation workflow will end with an error.

I’m moving all my workflows to Shortcuts, I’m done dealing with Automator.

One big issue, though: Shortcuts automations can’t monitor system folders like /private/tmp, even though Automator can.