Activities staying in pending

I’m developing locally in a test environment (still using temporal cloud, though). I have a number of different activities, but some of them (all of the same type, all the last activity that gets triggered) seem to stay in pending and never complete. I have registered the activity.

I’m not sure what is going on

Can you post the screenshot of the pending activity view?

I think I figured it out - I had something like

workflow.ExecuteActivity(ctx, TheActivity, TheActivityArg{})

I think omitting the Get allowed the workflow to complete without the activity blocking, and maybe when the workflow is complete, pending activities aren’t picked up?

Changing to

workflow.ExecuteActivity(activityCtx, TheActivity, TheActivityArg{}).Get(ctx, nil)

seems to have fixed it.

I had the same issue while setting up a demo workflow locally in Ruby.

This happens when you “schedule” an activity async and don’t wait for the result in your workflow and the workflow execution completes before the task having the chance to execute or picked up by a worker to run.