To Solve await is only valid in async function in nodejs Error Here The error is not referring to myfunction but to start. Here we wait for the myfunction to finish and then return a promise that'll be waited for as well It's useless to wait for the myfunction to finish before to return we can simply return a promise that will be resolved later. Also, point that we don't use the async keyword on the function because we can simply return the promise returned by myfunction.