title: Returning a promise when using async/await in Firebase Cloud Functions
body: <p>So I've happily been using async/await since node 8 is supported on Firebase Cloud Functions. I am struggling with 1 thing though. When using callable functions, it is told that you have to return a promise in the function, otherwise it won't work correctly. When using raw promises, its clear to me how to use it:</p>
  
  <pre><code>exports.createBankAccount = functions.region('europe-west1').https.onCall((data, context) =&gt; {
      return promiseMethod().then((result) =&gt; {
          return nextPromise(result);
      }).then((result) =&gt; {
          return result;
      }).catch((err) =&gt; {
          // handle err
      })
  });
  </code></pre>
  
  <p>But now, with async await, I'm not sure how to return this "chain of promises":</p>
  
  <pre><code>exports.createBankAccount = functions.region('europe-west1').https.onCall(async (data, context) =&gt; {
      const res1 = await promiseMethod();
      const res2 = await nextPromise(res1);
      return res2;
      // ??? Where to return the promise?
  });
  </code></pre>
  
  <p>Does somebody know?</p>