title: Construct promise flow from json
body: <p>My program has the following flow:</p>
  
  <pre><code>Promise.resolve(phase_1)
    .then(phase_2)
    .then(phase_3)
    .then(phase_4)
    .catch(errorHandler);
  </code></pre>
  
  <p>But i want but the phases in a flow.json:</p>
  
  <pre><code>[
    "phase_1",
    "phase_2",
    "phase_3",
    "phase_4",
  ]
  </code></pre>
  
  <p>But achieve the same result. Is it possible?</p>
  
  <p>How i'm trying to:</p>
  
  <pre><code>let returning;
  flow.forEach(function(phase, index) =&gt; {
     if (!index &amp;&amp; !returning) {
       returning = Promise.resolve(require(phase));
     } else {
       returning.then(require(phase));
     }
  });
  </code></pre>
  
  <p>Thanks!!!</p>