title: Debug async waterfall AWS Lambda
body: <p>I am writing a lambda for converting images and I am using async.waterfall for it.
  I am having a hard time debugging the lambda, since it does not seem to start the second function transform. Can any body help me on debugging. This is actually a pretty basic setup but I don't see why it does not go into the transform function nor throws any errors</p>
  <pre><code>    async.waterfall([
          function download(next) {
              
              s3.getObject({
                      Bucket: srcBucket,
                      Key: srcKey
                  },
                  next);
          },
          function transform(response, next) {
              console.log(&quot;transform&quot;, response);
              sharp(response.Body)
                  .webp()
                  .toBuffer(next);
          },
          function upload(data, info, next) {
              console.log(&quot;upload&quot;);
              s3.putObject({
                      Bucket: dstBucket,
                      Key: dstKey,
                      Body: data,
                  },
                  next);
          }
      ], function (err) {
          if (err) {
              console.error(
                  'Unable to convert ' + srcBucket + '/' + srcKey +
                  ' and upload to ' + dstBucket + '/' + dstKey +
                  ' due to an error: ' + err
              );
          } else {
              console.log(
                  'Successfully converted ' + srcBucket + '/' + srcKey +
                  ' and uploaded to ' + dstBucket + '/' + dstKey
              );
          }
          callback(null, &quot;message&quot;);
      });
  </code></pre>