- I have a workflow A which will wait for the signal from another workflow B.
- There might be a situation when workflow B won’t send any signal.
- Based on the workflow timeout configuration, workflow A will timeout after 7 days.
- I wanted to capture the state of workflow A.
Basically, I wanted to capture the state of the flow inside a workflow method with some piece of code to wait for the signal.
Don’t use workflow timeout for business level logic. It is a protection mechanism to avoid keeping forgotten workflows in the system forever.
In your case wait for both signal and a 7 day timer inside your workflow code. Something like:
Workflow.await(Duration.ofDays(7), signalReceived);
1 Like