Thank you for the answer.
Unfortunately, I don't know Objective-C or AppleScript.
But, Is it possible to use an external script and run it through NodeJS in this case?
For example: /usr/local/bin/node main.js args
And is it possible to use external packages in the main.js file, e.g. axios for data acquisition?
If so, how can I get the data back to Alfred?