title: Parse, saveAll failing after two httpRequests (Cloud Code job)
body: <p>I am running a job that does the following</p>
  
  <ul>
  <li>httpRequest</li>
  <li><ul>
  <li>processing</li>
  </ul></li>
  <li><ul>
  <li><ul>
  <li>httpRequest to different server using some of the processed data</li>
  </ul></li>
  </ul></li>
  <li><ul>
  <li><ul>
  <li><ul>
  <li>more processing, extending a Parse.Object model and then</li>
  </ul></li>
  </ul></li>
  </ul></li>
  <li><ul>
  <li><ul>
  <li><ul>
  <li><ul>
  <li>saveAll</li>
  </ul></li>
  </ul></li>
  </ul></li>
  </ul></li>
  </ul>
  
  <p>At one point I was doing only one httpRequest that did the saveAll and it worked.</p>
  
  <p>After I added the second httpRequest, the saveAll stopped working</p>
  
  <p>I've read some anecdotal things about "2 queries / httpRequests per job/function" and then I've read some other anecdotal things about Promises, and some anecdotal things about chaining promises but at this point I am lost</p>
  
  <p>so I've rewritten this job to use Promises but I am still getting an error in the saveAll method</p>
  
  <pre><code>Parse.Cloud.job("myJob", function(request, status) {
  
  Parse.Cloud.httpRequest({
      method: "GET",
      url: "https://api.website.com/api/method",
      headers: {
          "Content-Type": "application/json"
      }
  }).then(function(httpResponse)
      /*,success: function(httpResponse)*/
      {
  
          var symbols = httpResponse.data["symbols"];
  
          var tickerNames = new Array();
  
          symbols.forEach(function(obj) {
  
              tickerNames.push(obj.symbol);
              //maybe do a before save method to check if it already exists               
  
          });
  
          return tickerNames;
      }).then(function(tickerNames) {
  
      return Parse.Cloud.httpRequest({
          method: "GET",
          url: "https://api.secondsite.org/api/" + tickerNames.join(","),
          headers: {
              "Authorization": "Bearer ACCESSTOKEN",
              "Accept": "application/json"
          }
          /*,
                              success: function(httpResponse) {*/
      }).then(function(httpResponse) {
  
              var serverObjects = new Array();
  
              var objectArray = httpResponse.data["quotes"]["quote"];
              objectArray.forEach(function(obj) {
  
                  var SocialPicks = Parse.Object.extend("SocialPicks");
                  var newPick = new SocialPicks();
                  newPick.set("symbol", obj.symbol);
                  newPick.set("title", obj.description);
                  newPick.set("changePercent", obj.change_percentage);
                  newPick.set("volume", obj.volume);
                  newPick.set("avgVolume", obj.average_volume);
  
                  //newPick.save();
  
                  serverObjects.push(newPick);
  
              });
  
              //console.log(serverObjects[0].symbol);
  
              var promise = Parse.Promise.as();
  
              promise = promise.then(function(){
                  return Parse.Object.saveAll(serverObjects)
                  .then(function(list) {
  
                      console.log("saveAll success");
                      status.success("success");
  
                  }, function(error) {
                      console.log("saveAll error");
                      status.error("not successful saving");
                  });
              })
  
              return promise;
  
          },
          /*error: function(error) {*/
          function(httpResponse) {
              console.log("ERROR");
              status.error("not successful network call");
          }
      );
  
  });
  
    });
  </code></pre>
  
  <p>this always fails with <code>status.error("not successful saving");</code> , whether I use promises or a sequential version of this method without promises</p>
  
  <p>at this point I'm not sure if I have hit a limitation of parse, or if I am using promises incorrectly, or both, or other</p>
  
  <p>so, if anyone has experience doing subsequent httpRequests in Cloud Code and then writing the objects, insight would be helpful</p>