Say I have the following scenario, how would I handle it with temporal?
I receive a lead event. This should start a workflow instance in the lead state.
I receive an opportunity event. This will start a 2nd workflow instance in the opportunity state.
I receive a job event that ties the lead from workflow #1 to the opportunity from workflow #2. What should happen here or how do I merge these two workflows?
Multiple entry points seem to cause issues
These are based on a single workflow definition.
Use signalWithStart to send both lead and opportunity events to the workflow. Use the same workflowID for both. So there is no need to merge. The first event received is going to start workflow before delivering the signal.
It is hard to give a general recommendation without understanding the use case. What happens when each of the events is received? Do you need to handle each of them separately or only when all three are received?
All 3 separately, and there is no x out of 3 because many times, there is no 3rd event, and it’s expected to be two workflows in that case. There should only be one workflow when the 3rd event actually comes.