title: How to convert a non-templated beam job to templated job and run it on GCP Dataflow runner?
body: <p>I was able to run the non-templated beam job directly on the GCP dataflow runner by using the below command :</p>
  <pre><code>java -jar &lt;jar_name&gt; 
  --runner=DataFlowRunner 
  --gcpTempLocation=gs://some/gcs/location 
  --stagingLocation=gs://some/gcs/location/stage 
  --tempLocation=gs://some/gcs/location/temp 
  --region=&lt;region_name&gt; 
  --project=&lt;project_name&gt; 
  --subnetwork=&lt;subnet_name&gt; 
  --jobName=&lt;job_name&gt;
  </code></pre>
  <p>I wanted to templatize the same job by using the below command to stage the template in the gcs bucket :</p>
  <pre><code>java -jar &lt;jar_name&gt; 
  --runner=DataFlowRunner 
  --gcpTempLocation=gs://some/gcs/location 
  --stagingLocation=gs://some/gcs/location/stage 
  --templateLocation=gs://some/gcs/location/templates/&lt;job_name&gt;
  --region=&lt;region_name&gt; 
  --project=&lt;project_name&gt;
  </code></pre>
  <p>but I am receiving the below error while creating the job template instance:</p>
  <pre><code>18:11:05.004 [main] INFO org.apache.beam.runners.dataflow.DataflowRunner - Template successfully created.
  Exception in thread &quot;main&quot; java.lang.UnsupportedOperationException: The result of template creation should not be used.
      at org.apache.beam.runners.dataflow.util.DataflowTemplateJob.getJobId(DataflowTemplateJob.java:41)
      at org.apache.beam.runners.dataflow.DataflowPipelineJob.getJobWithRetries(DataflowPipelineJob.java:559)
      at org.apache.beam.runners.dataflow.DataflowPipelineJob.getStateWithRetries(DataflowPipelineJob.java:540)
      at org.apache.beam.runners.dataflow.DataflowPipelineJob.waitUntilFinish(DataflowPipelineJob.java:324)
      at org.apache.beam.runners.dataflow.DataflowPipelineJob.waitUntilFinish(DataflowPipelineJob.java:253)
      at org.apache.beam.runners.dataflow.DataflowPipelineJob.waitUntilFinish(DataflowPipelineJob.java:212)
      at org.apache.beam.runners.dataflow.DataflowPipelineJob.waitUntilFinish(DataflowPipelineJob.java:206)
      at com.gojek.de.jobs.EventFilterJob.main(EventFilterJob.java:72)
  </code></pre>
  <p>and upon running the dataflow job from the GCS template, the dataflow job runner cannot launch the job instance from the template.</p>
  <p>I am able to see the template creation at the GCS bucket. I am not sure, why the job run failed.
  also, can we directly convert a non-template beam job to a template job?</p>
  <p>Note: I cannot run the maven command given in the <a href="https://cloud.google.com/dataflow/docs/guides/templates/creating-templates" rel="nofollow noreferrer">document</a> as our project is Gradle based.</p>