title: Spawning processes in the background
body: <p>I have a RabbitMQ message queue where I add <code>configuration.json</code> to the queue. Each of these configurations' has all the information required to start a workflow. So if I have <strong>5</strong> messages in the queue, I need to feed the configuration <strong>5</strong> commands through my consumer which starts the workflow.</p>
  
  <p>If I exit the python script that spawns these processes, I exit the actual workflow process as well. And that is the issue.</p>
  
  <p>Currently:</p>
  
  <pre class="lang-py prettyprint-override"><code>subprocess.run(f'nextflow run nextflow/workflow_runner.nf -w "gs://nextflow-text-bucket/work" -c nextflow/nextflow.config --at_config {config_file} --csv {csv_dest} &amp;', shell=True)
  </code></pre>
  
  <p>Over here I simply add an <code>&amp;</code> symbol to the end of the command so that it runs in the background. How can I alter this code so that my python script, creates a <strong>new</strong> process which is disconnected from this consumer.</p>
  
  <p>BASICALLY, How can I efficiently create <strong>n</strong> number of processes, using a python script, which are not dependant on the script that started them. And I have the ability to log on to the machine and connect to the output of <strong>each</strong> of the process. </p>
  
  <p>This is what the output looks like:</p>
  
  <pre><code>N E X T F L O W  ~  version 20.01.0
  Launching `nextflow/workflow_runner.nf` [pedantic_pauling] - revision: a8fe3d5045
  executor &gt;  google-lifesciences (1)
  [92/828e5d] process &gt; prc1             [  0%] 0 of 1
  [-        ] process &gt; prc2              -
  [-        ] process &gt; prc3              -
  [-        ] process &gt; prc4              -
  [-        ] process &gt; prc5              -
  </code></pre>
  
  <p>And is updated as each process completes. So having the ability to start this off in the bg, but be able to "attach" on to it and check where it's reached.</p>