How to prevent Temporal from running unregistered workflows

When I run a workflow of the type “random,” which I haven’t exported as a function, Temporal seems to just start its job and shows it as running (though when going inside it shows the error that Failed to initialize workflow of type ‘random’: no such function is exported by the workflow bundle

My expectation is that it should kill the workflow as well, rather than running to run only to show an error when I check inside. How can I stop Temporal from running workflow types that aren’t registered and immediately kill?

Using Temporal CLI 1.3.0 (Server 1.27.1, UI 2.36.0)

Hi,

Temporal does not immediately fail or kill a workflow execution if the workflow type is not registered.
Instead, the workflow remains in a “running” state and the system repeatedly attempts to schedule it,

This is by design: Temporal expects that a worker with the correct workflow registration may eventually become available, at which point the workflow could proceed.

How can I stop Temporal from running workflow types that aren’t registered and immediately kill?

I don’t think this is something you can configure on the server/worker side. You can use temporal cli or the sdk to terminate workflows

1 Like