Testing ContinueAsNew


I have a workflow that has conditional logic on whether or not it is a continue-as-new workflow execution.

if workflow.GetInfo(ctx).ContinuedExecutionRunID == "" {
  // something
} else {
  // something else

How can I test the else branch? I didn’t see anything obvious in testsuite.TestWorkflowEnvironment.



Go SDK test env currently supports only a single workflow run (see this issue as well). You can test if the workflow returns workflow.NewContinueAsNewError if it helps.

Yes, I want to run one workflow as a continue-as-new workflow. That is, it should have a ContinuedExecutionRunID populated. Is that possible? If not, I’ll make a feature request ticket.

I don’t think it is possible. Please file an issue to get this added.