How can I get the Run status after all execution in Apex Salesforce?

Hi, I’m working to connect Slack, Salesforce and OpenAI Assistant, but I’d like to know how can I receive the response dynamically without hard-code a waiting time?