title: Use NodeJS Bull Queue seperate processor
body: <p>I'm trying to run the <code>process</code> in different <code>processor</code> file itsef as its in <code>bull</code> <a href="https://github.com/OptimalBits/bull" rel="nofollow noreferrer">documentation</a>, I've added the file as below.</p>
  
  <pre><code>// -------- Queue.js ----------
  
  formatQueue.process(__dirname + "/processors/format-worker.js");
  
  
  // On Cmplete Handler
  
  formatQueue.on('completed', function(job, result){
      console.log(result, "Format-Complete-job"); // result is undefined
      if(job.data.is_well_format){
          existenceQueue.add(job.data, { attempts: 3, backoff: 1000 });
      }else QueueModel.lastStep(job.data)
  });
  
  // -------- Queue.js ends ---------
  
  //format-worker.js
  Validator = require("../../validators");
  module.exports = (job) =&gt; {
      Validator.Format.validate(job.data, (data) =&gt; {
          job.data = data;
          return Promise.resolve(data);
      });
  }
  </code></pre>
  
  <p>Now On Job complete which I was using before, I used to get job data with updated job parameters. Now I'm not getting updated job data. and the second parameter which is there in the documentation i.e <code>result</code> is <code>undefined</code>. Now how can I get the updated job data in this case.</p>
  
  <p>The <code>job</code> and the <code>processors</code> are working fine it I run the <code>process</code> as below.</p>
  
  <pre><code>formatQueue.process(function(job, done){
      Validator.Format.validate(job.data, (data) =&gt; {
          job.data = data;
          done();
      });
  });
  </code></pre>
  
  <p>In this case, The job data itself is getting updated and that works aswell.</p>
  
  <p>I have multiple queues doing the different jobs, Once the previous job is finished with success, then only I need the other job to start the work.
  I have another question and I've mentioned the usecase there. <a href="https://stackoverflow.com/questions/61565588/nodejs-bull-stop-the-queue-jobs-on-a-job-failed/">please check it here</a>.</p>