Automations listening to script output

I am working to implement actionable notifications and I am looking how to use a single script which sends notifications and awaits for responses which then passes back to calling automation.

The script may be called by “N” automations, each expecting an answer from the user such as
“Yes” / " No" / “Ignore”

There may be times when user has not responded to all prompts, but some only. Plus the user may answer them in a random order, not the order received.

How should I look for mapping the answer received to the automation who triggered the script?

Thank you

I’d do this by making the automation pass a random ID to the script, then make the script “send” its output prefixed with the ID to an input_text helper. The automation can watch that input_text entity for a state change that contains its ID and pull the response from that.