How to respond to SPA with intermediate process result

In my case I have several “user tasks” inside a process and there are dependencies between them. For example task A starts process, some logic is going and then I need to return response to user with information to start task B. Am I wrong with such kind of process? I fell I am wrong because I do not even imagine how can I return some variables from process to SPA when process reached task B. I would be very graceful if somebody help me