With the Actor Model, it is common for an actor to send a signal to itself. Treating a workflow as an actor I attempt the following:
we := workflow.GetInfo(ctx).WorkflowExecution
err = workflow.SignalExternalWorkflow(ctx, we.ID, we.RunID, "messages", message).Get(ctx, nil)
if err != nil {
panic(fmt.Errorf("could not signal external workflow: %v", err))
}
Unfortunately upon executing this workflow I see the following error:
Worker log:
2020/08/18 00:59:45 ERROR Workflow panic. Namespace default TaskQueue test WorkerID 365071@beast-ubuntu@ WorkflowID TestWorkflow RunID 45d5376f-7b22-46b5-8b7b-6167efc4b909 PanicError could not signal external workflow: UnknownExternalWorkflowExecution PanicStack coroutine root [panic]:
myproject.com/test/domain/root.TestWorkflow(0x1003860, 0xc000047300, 0x0, 0x0)
/home/paul/myproject.com/test/domain/root/testworkflow.go:67 +0x846
reflect.Value.call(0xd69c60, 0xefbe08, 0x13, 0xeaf39a, 0x4, 0xc00046bde0, 0x1, 0x1, 0xfd2570, 0xe8e4c0, ...)
/usr/local/go/src/reflect/value.go:460 +0x8ab
reflect.Value.Call(0xd69c60, 0xefbe08, 0x13, 0xc00046bde0, 0x1, 0x1, 0xfd2570, 0xe8e4c0, 0xc00013a4b0)
/usr/local/go/src/reflect/value.go:321 +0xb4
go.temporal.io/sdk/internal.(*workflowEnvironmentInterceptor).ExecuteWorkflow(0xc00013a4b0, 0x1003860, 0xc000047300, 0xc000110010, 0xc, 0x0, 0x0, 0x0, 0x0, 0x0, ...)
/home/paul/go-sdk/internal/workflow.go:370 +0x2b2
go.temporal.io/sdk/internal.(*workflowExecutor).Execute(0xc000047140, 0x1003860, 0xc000047300, 0x0, 0xc000517f38, 0xc68596, 0x0)
/home/paul/go-sdk/internal/internal_worker.go:759 +0x334
go.temporal.io/sdk/internal.(*syncWorkflowDefinition).Execute.func1(0x1003a20, 0xc000144ff0)
/home/paul/go-sdk/internal/internal_workflow.go:491 +0xf3
Furthermore, the signal successfully completes when using the Temporal Test framework.
Is this an error or am I trying something outside of intended operation?