Signal behavior #342
-
Signal behavior in the below piece of code seems to be a problem. I am running a workflow and want to block it till an external signal is received from a URL (implemented by call to http://localhost:3000/bar/:token) below. If the token (uuid) is passed from startWorkflow function, the code is running well and the blocking behavior is good i.e. workflow moves to Activity1 and executes it. But if the channel name is generated as part of workflow execution, it doesnt work and the workflow remains stuck. ie. but doesnt work if the chanName in the same line is changed to I am passing the chanName or newuid by copying the relevant signal channel name from the console and pasting it into the browser e.g. http://localhost:3000/bar/d811b2b9-60e1-4bab-bcd1-69ebe92a877a
|
Beta Was this translation helpful? Give feedback.
Replies: 1 comment 1 reply
-
You do want to have a well-known name for the signal channel and then send the token as part of the payload. So I'd do something like: const chanName = "token-signal"
// workflow
token, err := workflow.NewSignalChannel[string](ctx, chanName).Receive(ctx)
// url handler
c.SignalWorkflow(ctx, wf.InstanceID, chanName, token) |
Beta Was this translation helpful? Give feedback.
You do want to have a well-known name for the signal channel and then send the token as part of the payload. So I'd do something like: