I remember that in some post I had seen that when I publish a process as Web Services, I can obtain some process variable. It's possible??
Discussion posts and replies are publicly visible
https://community.appian.com/b/appmarket/posts/synchronous-process-model-web-service
Possibly referring to this plugin which I've used in the past but in line with previous responses there are more modern design approaches for what you describe