"No workflows registered" when using bundled workflows

I’m trying to follow the recommendation of bundling up my workflows for production. For some reason, the local version is working, but the bundled is not.

I switch the source of my workflows based on NODE_ENV:

const workflowSource = () => {
  const require = createRequire(import.meta.url);

  return process.env.NODE_ENV !== 'local'
    ? {
        workflowBundlePath: {
          codePath: require.resolve('./workflow-bundle.js'),
        },
      }
    : { workflowsPath: require.resolve('./lib') };
};

That workflow source is then passed into my WorkerOptions. The worker starts up just fine, but then reports: No workflows registered, not polling for workflow tasks

In the UI i can also see that the worker isn’t processing workflows.

I have verified that the workflow bundle produced by bundleWorkflowCode exists in the location my config points to, and looked into the contents of the bundle to see that there are indeed reference to the workflow I’m trying to run.

Does anyone have any further debugging steps for me? Thanks!

Hi @corylogan

Have you tried running this example samples-typescript/production at main · temporalio/samples-typescript · GitHub?

It seems the attribute name is workflowBundle (not workflowBundlePath) samples-typescript/production/src/worker.ts at aebbe3bb1ab084f52194b91e153a555ffb97e97e · temporalio/samples-typescript · GitHub

Antonio