Is there a way to query state of a workflow which has timed out while waiting for the signal after a specific number of day?

  1. I have a workflow A which will wait for the signal from another workflow B.
  2. There might be a situation when workflow B won’t send any signal.
  3. Based on the workflow timeout configuration, workflow A will timeout after 7 days.
  4. 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