Hi Team, we have a usecase that when we receive certain event from external service, we signal the workflow but while sending the signal we don’t know if workflow exist or not, which is causing serviceerror_NotFound errors and we are executing lot of signals, hence our DB CPU usage is also going high. We want to understand what are best practices for using signals in high volume. Especially for our use case, is it better to always do a get workflow call and then signal or can we signal and ignore failure of workflow not found? Get workflow vs Signal Workflow which is CPU intensive task?
Have you considered SignalWithStart?
Thanks for the response Maxim. In our case, if workflow doesn’t exist then we don’t want to start a workflow, but if it exists then we want to signal it.
Then signaling and ignoring NotFound is the right way to go.
Just to confirm, in terms of CPU performance also, is signaling and ignoring NotFound right way?
Yes. This is the cheapest. I’ve seen cases when most events could be filtered out without checking a workflow existence. This reduced the db load significantly.
1 Like