title: Google Dataflow Templates - passing NumWorkers, MaxNumWorkers, WorkerMachineType, AutoscalingAlgorithm
body: <p>I am using Google Cloud Dataflow Java SDK 2.1.0. </p>
  
  <p>I am able to create a template using --templateLocation pipeline option along with some other ValueProvider pipeline options which I would like to pass at run time. I am invoking the template using Google dataflow API from within a cloud function.</p>
  
  <p>The template worked OK with parameters stagingLocation, tempLocation and my custom parameters, but when I pass the parameters for numWorkers, maxNumWorkers, workerMachineType, autoscalingAlgorithm in the API call, I got "Found unexpected parameters" error for these. I read another <a href="https://stackoverflow.com/questions/44801081/pass-parameters-from-cloud-functions-to-dataflow">stackoverflow post</a> and created another template with these DataflowPipelineOptions referred to in Log statements like below:</p>
  
  <pre><code>LOG.info("Number of workers =&gt; " + String.valueOf(options.getNumWorkers()));
  </code></pre>
  
  <p>The new template did accept the default pipeline options mentioned above. So it looks like the templates are not carrying pipeline options that are not referred to in the pipeline code - which is OK for custom options, but I suppose all the default pipeline options should always be there in any template. </p>
  
  <p>Can anyone confirm if this is expected behavior or let me know if I am not doing it right?</p>