Activities Not Scheduled After First Activity Completes

Hi everyone,

I’m having an issue where my workflow only executes the first activity and then times out. The workflow starts, calls the first activity (alpha), but never schedules the subsequent activities.

What’s happening

  • Workflow logs “About to call alpha”

  • Alpha activity completes successfully in Temporal Cloud

  • Workflow task times out after Alpha completion

  • No other activities (beta, gamma, delta, epsilon) get scheduled

  • Last log message is “About to call alpha”

Current code

Workflow:

export async function runSimpleDAG(): Promise<void> {
    log.info('Workflow starting')

    log.info('About to call alpha')
    const alphaResult = await alpha()
    log.info('Alpha completed', { result: alphaResult })

    log.info('About to call beta')
    const betaResult = await beta(alphaResult)
    // rest of activities...
}

Example activity (all 5 are identical except for the name):

import { sleep } from '@temporalio/activity'

export async function alpha(): Promise<string> {
    const sleepTime = Math.floor(Math.random() * 10000)
    await sleep(sleepTime)
    return Hello from Alpha! (slept ${sleepTime}ms)
}

Activity setup:

import type * as activities from '@/dag/src/activities'

const { alpha, beta, gamma, delta, epsilon } = proxyActivities<typeof activities>({
   startToCloseTimeout: '10 minutes',
   scheduleToStartTimeout: '10 minutes',
   scheduleToCloseTimeout: '10 minutes',
   taskQueue: 'default',
   retry: {
      maximumInterval: '10 minutes',
   },
})

Worker:

const worker = await Worker.create({
   workflowsPath,
   connection,
   namespace: TEMPORAL_NAMESPACE,
   taskQueue: TEMPORAL_TASK_QUEUE,
   activities,
})

What I’ve tried

  • Simplified the alpha activity to just return a string

  • Added explicit taskQueue: ‘default’ to override sticky behavior

  • Verified all 5 activities are registered with the worker

  • Added detailed logging throughout the workflow

Temporal Cloud shows

  • Alpha activity: Scheduled → Started → Completed

  • Workflow task: Scheduled → Started → Never completes

  • No subsequent activities are ever scheduled

The workflow task just hangs after Alpha completes. I’m not sure if this is a configuration issue, a sticky task queue problem, or something else entirely.

Has anyone seen this before? Any suggestions on what to check next?

Thanks for any help!

Hi,

can you check if the worker is still running after executing the first activity? if you want to share the workflow history we can take a look , and/or a standalone reproduction

Example activity (all 5 are identical except for the name):

Does beta activity accepts an string?

Antonio

Yes, heres beta, the others also accept inputs. I tried calling alpha multiple times, same results

import { sleep } from '@temporalio/activity'

export async function beta(alphaResult: string): Promise<string> {
  const sleepTime = Math.floor(Math.random() * 10000)
  await sleep(sleepTime)

  return `Hello from Beta! (slept ${sleepTime}ms) - Got: ${alphaResult}`
}

Also heres the workflow with logs

export async function runSimpleDAG(): Promise<void> {
  log.info('Workflow starting')

  // Step 1: Alpha runs independently
  log.info('About to call alpha')
  const alphaResult = await alpha()
  log.info('Alpha completed', { result: alphaResult })

  log.info('About to call beta')
  // Test: Just schedule Beta and see if it works
  const betaResult = await beta(alphaResult)
  log.info('Beta completed', { result: betaResult })

  log.info('About to call gamma')
  // If we get here, the issue is not with Beta
  // Let's test Gamma
  const gammaResult = await gamma(alphaResult)
  log.info('Gamma completed', { result: gammaResult })

  log.info('About to call delta')
  // If we get here, the issue is not with Gamma either
  // Let's test Delta
  const deltaResult = await delta(gammaResult)
  log.info('Delta completed', { result: deltaResult })

  log.info('About to call epsilon')
  // Finally test Epsilon
  await epsilon(betaResult, deltaResult)
  log.info('Epsilon completed')

  log.info('Workflow completed successfully')
}

Heres the worker output after 20 mins

webpack 5.100.1 compiled successfully in 622 ms { sdkComponent: 'worker', taskQueue: 'default' }
2025-08-13T16:25:51.575Z [INFO] Workflow bundle created { sdkComponent: 'worker', taskQueue: 'default', size: '1.13MB' }
v8.promiseHooks.createHook is not available; stack trace collection will be disabled.
2025-08-13T16:25:51.830Z [INFO] Worker state changed { sdkComponent: 'worker', taskQueue: 'default', state: 'RUNNING' }
2025-08-13T16:25:55.993Z [INFO] Workflow starting {
  sdkComponent: 'workflow',
  taskQueue: 'default',
  namespace: 'segundo-test.f6jq5',
  workflowId: 'job-node-execution-1755102355891',
  runId: '0198a440-a23c-70b6-bd87-ea3c0791bf31',
  workflowType: 'runSimpleDAG'
}
2025-08-13T16:25:55.993Z [INFO] About to call alpha {
  sdkComponent: 'workflow',
  taskQueue: 'default',
  namespace: 'segundo-test.f6jq5',
  workflowId: 'job-node-execution-1755102355891',
  runId: '0198a440-a23c-70b6-bd87-ea3c0791bf31',
  workflowType: 'runSimpleDAG'
}

And the temporal cloud event history

Another thing i noticed is that the taskqueue changes for the workflow once alpha executes.

I have no issues with adopting sticky queues, the thing is that the sticky queue has no activity handler, and the console ouput of the worker doesnt state that its listening to any other queues but default

Thank you,

There is no reason for the activity worker to stop polling if you don’t have anything else running.

can you check this code my-temporal-pocs/typescript/_forum_18185 at main · antmendoza/my-temporal-pocs · GitHub and let me know if it differs from yours?

Another thing i noticed is that the taskqueue changes for the workflow once alpha executes.
this is expected after the workflow task timeout the server reschedules the workflow task on the “normal” task queue so that any available worker can pick it up.

Can you share the workflow options? have you set the workflowTaskTimeout to 2 minutes?

Antonio

Thank you for writing a reproducible example, youre awesome.

It seems to have the same result, one thing i noticed is that when i remove the await the activities run and are scheduled. I solves the issue but causes others, i need it to respect the order since im building a dag.

export async function runSimpleDAG(): Promise<string> {
  console.log('Workflow starting')

  // Step 1: Alpha runs independently
  console.log('About to call alpha')
  alpha()
  console.log('Alpha completed')

  console.log('About to call beta')
  // Test: Just schedule Beta and see if it works
  beta()
  console.log('Beta completed')

  console.log('About to call gamma')
  // If we get here, the issue is not with Beta
  // Let's test Gamma
  gamma()
  console.log('Gamma completed')

  console.log('About to call delta')
  // If we get here, the issue is not with Gamma either
  // Let's test Delta
  delta()
  console.log('Delta completed')

  console.log('About to call epsilon')
  // Finally test Epsilon
  epsilon()
  console.log('Epsilon completed')

  console.log('Workflow completed successfully')

  return 'done'
}
 

Thats my workflow right now.

Heres the cloud logs

Thanks Antonio, for your help.

I tried something else, and it seems to confirm that the await is causing issues, heres my code:


export async function runSimpleDAG(): Promise<string> {
  alpha()
  beta()
  // this is the last thing that runs
  await gamma()
  delta()
  epsilon()

  return 'done'
}

Here are the cloud logs

Also, i’m using bun, could it cause the issue?

SOLVED

Bun was the issue, i changed the executable to npm and it worked flawlessly.

Thanks Antonio for the attention

1 Like