Intermediate workflow results

I have an interesting use-case, and would appreciate help on how to approach it.
I’d like to write a simulator that gets user input, runs some computation, and gives the user (relatively) real-time results.
If real time was not a requirement, I could trigger a workflow, get the run ID, and then return the run output to the user.

The activities in this case would be:

  • Get a page of results
  • Calculate something

And the workflow would be

  • While there are more results
    • Get page
    • Calculate
  • Summarize

However, the real-time requirement of this feature prevents us from waiting for the workflow to finish.

Would this be possible through Temporal alone, by somehow getting the intermediate activity results, or would you recommend saving results to a separate store?

Sure, many of our users have similar requirements. There are a various approaches for this.

However, I’m not sure I correctly understand your exact use case, making it a bit hard for me to make specific suggestions.

Would it be possible for you to provide some basic example of what a “not real time” implementation of that workflow would look like, then point out at which point you would like to “return quickly to the user”, and what happens afterward (ie. why would it take too long to simply wait for that workflow to complete)?

Also, if you are a Temporal Cloud user, I suggest you contact us through our Zendesk support portal, so that we can better evaluate with your timing requirements.