Wait for an activity to be done and after that query the workflow to get the result

Hi Temporal, I’m trying to implement a workflow with sequential interaction with the user. at each step, the user provides new info and in case of valid info, he can go to the next step. I’m using wait_condition at each step to wait for a signal that adds info to the workflow. when the signal is triggered the related activity that must validate the info will run. I don’t know how to wait for the activity to be completed and query the workflow for the result.

Sounds like you want to send something back from a workflow to a client after some time. This is a use case for updates which is not supported in Python yet. In the meantime, you can either complete the workflow with the response (and user can await handle.result()) or you have to query via a poll (or there are more advanced options such as hosting an activity only worker on the client with a unique task queue and having the workflow call that activity).

1 Like