title: Error: The template parameters are invalid. Google Cloud function to run an existing dataflow template GCS_Text_Bigquery
body: <p>I'm building a Cloud function, with storage trigger and trying to run a dataflow from within. I created a dataflow job "jsonbq-1", with an existing <code>GCS_Text_BigQuery</code> template, have created a simple uDF to take the incoming CSV Data and put into tables. 
  The Cloud function is executed and the Dataflow is called but there is no response, and the error displayed in the <code>log:Error</code>:  The template parameters are invalid.</p>
  
  <p>I'm not sure where the error is.</p>
  
  <p><strong><code>Index.js</code> looks like this.</strong></p>
  
  <pre><code>`const google = require('googleapis'); 
   //const { auth } = require('google-auth-library');
  
   exports.goWithTheDataFlow  = (event, callback) =&gt; {
  
   const file = event.data;
   const context = event.context;
  
   console.log(`Event ${context.eventId}`);
   console.log(`  Event Type: ${context.eventType}`);
   console.log(`  Bucket: ${file.bucket}`);
   console.log(`  File: ${file.name}`);
   console.log(`  Metageneration: ${file.metageneration}`);
   console.log(`  Created: ${file.timeCreated}`);
   console.log(`  Updated: ${file.updated}`);
  // console.log(err);
  //console.log(projectId);
  //console.log(authClient);
   google.auth.getApplicationDefault(function (err, authClient, projectId) {
   if (err) {
     throw err;
   }
  console.log(err) 
  console.log(projectId);
  
  const dataflow = google.dataflow({ version: 'v1b3', auth: authClient });
      console.log(`gs://${file.bucket}/${file.name}`);
     dataflow.projects.templates.create({
    projectId: projectId,
    resource: {
  
   parameters: {
     inputFile: `gs://${file.bucket}/${file.name}`,
     output_Table: 'titanium-gamma-212906:np_cf_1.cf1',
     //bigQueryLoadingTemporaryDirectory: 'gs://test-bucket-np'
   },
   jobName: 'json-bq1',
   gcsPath: 'gs://dataflow-templates/latest/GCS_Text_to_BigQuery',
   //jobName: 'json-bq1',
   //gcsPath: 'gs://dataflow-templates/latest/GCS_Text_to_BigQuery',
   //output_Table: 'titanium-gamma-212906:np_cf_1.cf1',
   //javascriptTextTransformFunctionName: 'transform',
   //bigQueryLoadingTemporaryDirectory: 'gs://test-bucket-np'
   }
   }, function(err, response) {
   if (err) {
   console.error("problem running dataflow template, error was: ", err);
   }
   console.log("Dataflow template response: ", response);
   callback();
   });
  
   });
  
  callback();
  };`
  </code></pre>
  
  <p><strong>package.json</strong></p>
  
  <pre><code>"name": "sample-cloud-storage",
    "version": "0.0.1",
    "dependencies": {
      "googleapis": "24.0.0"
    }
  }
  </code></pre>
  
  <p><strong>The LOG:</strong></p>
  
  <p><a href="https://i.stack.imgur.com/0zrPw.jpg" rel="nofollow noreferrer"><img src="https://i.stack.imgur.com/0zrPw.jpg" alt="The LOG"></a></p>
  
  <p>Thanks in advance folks.</p>