This forum reply (to a similar question) seems to imply that a naked await should work within a function node...
The call is asynchronous and returns a promise so you need to await for that to complete before you return
This SO post (upper snippet) offers a pattern, which causes my flow to break when I return msg; (no downstream execution or output).
(async function() {
let res = await pool.query('select 1 as somethingForExample;');
msg.payload = res;
return msg;
})()
(...based on the code snippet for querying Postgres here)
Checking node version in node-red I am using...
docker run --rm -it --entrypoint /bin/sh nodered/node-red:1.3.5-minimal
node -v
The version of node is...
v10.24.1
Which according to this SO, the minimum required version for an assumed top level async (with which an await could be included) seems to be v13.
Can I let x = await something(); in a function node? Do I need to wrap it in an async? How do I do so successfully given the pattern offered? Does this announcement by the node-red team that flows were transitioned to asynchronous (vs async, specifically) in v1.0 impact this issue?