This is a typical scenario of a correlation identifier pattern .
When the work role is completed, it should send a message in turn , indicating that the document is ready. You can use the Correlation Identifier (for example, the document identifier) to indicate in the message DocumentReadyEvent to which the original request related to this event belongs.
You can also follow the path of full CQRS and simply update the view table, which includes the new document, and allow the website request.
source
share