Hi, I am new to Temporal and trying to learn various concepts by doing a proof of concept. I was wondering about queries in workflows and where they would be useful. The only use case I could think of is to expose some internal state of workflow for debugging purposes. I am not feeling that confident about exposing some data via workflow queries that will be consumed routinely by other workflows. The reason is that it feels like temporal would have to load the workflow instance to execute the query method/function that produces query output. This adds unnecessary load to worker cluster. I would rather provide an internal API deployed outside the worker cluster and scale it separately.
Am I thinking about queries correctly or am I missing something? Are there any other use cases of queries except debugging that I am not thinking about?
Apologies if this has been discussed before. I tried searching about this in the forum but couldn’t find anything related.