Issue with Infinite Execution in Temporal Worker Initialization

I’ve integrated Temporal into my existing Node.js microservice, and I’m facing an issue during the initialization of the Temporal worker. It seems that the line await; in the temporal.worker.ts file never returns control and executes indefinitely (so the next line streamingRepository.init() never executed). I want to understand if this behavior is expected and how I can resolve it.

Relevant Code Snippets


export const start = async (module: NodeModule): Promise<void> => {
  // ... (other code)

  // Temporal worker initialization stuck here
  await temporalWorker.init();

  // Lines below never executed
  // ... (other code)


// This function sets up and runs the Temporal worker
async function run() {
  // Establish a connection with a Temporal server
  const connection = await NativeConnection.connect({
    address: temporalConstant.TARGET
  logger.debug('Established connection to the Temporal server');

  // Create a Temporal worker configuration
  const worker = await Worker.create({
    workflowsPath: require.resolve('./workflows/report.workflow'),
    taskQueue: temporalConstant.TASK_QUEUE,
    namespace: temporalConstant.NAMESPACE,
    connection: connection
  logger.debug('Created a Temporal worker configuration');

  // Start the Temporal worker

// This function initializes the Temporal worker
const init = async () => {'Initializing a Temporal worker');
  // Run the Temporal worker setup and execution
  await run();

// Object encapsulating the Temporal worker functions
const temporalWorker = {

export default temporalWorker;

Requested Help

  1. Is the behavior of await; running indefinitely expected in the context of Temporal worker initialization?
  2. If not, what could be causing this issue, and how can I resolve/debug it?
  3. Are there any best practices or adjustments I should consider in my Temporal setup to ensure smooth initialization and execution?

Any insights or guidance on this matter would be greatly appreciated. Thank you!