title: Programmatic trigger for AWS Connect - agent contact flow
body: <p>I achieved the following use case : </p>
  
  <p>1) I am able to programmatically make an outbound call for the 'Contact flow (inbound)' contact flow type using the following code </p>
  
  <pre><code> let params = {
      "InstanceId" : '12345l-abcd-1234-abcde-123456789bcde',
      "ContactFlowId" : '987654-lkjhgf-9875-abcde-poiuyt0987645',
      "SourcePhoneNumber" : '+1123456789',
      "DestinationPhoneNumber" : customerPhoneNumber,
      "Attributes" : {
          'name' : customerName,
          'dayOfWeek' : dayOfWeek
      }
  
  }
  
  connect.startOutboundVoiceContact(
      params, function (error, response){
  
          if(error) {
              console.log(error)
              callback("Error", null);
          } else
          {
              console.log('Initiated an outbound call with Contact Id ' + JSON.stringify(response.ContactId));
              callback(null, 'Success');
          }
      }
      ); 
  </code></pre>
  
  <p>It is successfully working. But one issue is 'It will directly call the customer from the AWS Connect which will not include the agent'</p>
  
  <p>2) Using the Amazon CCP (Call Control Panel), I am able to make an outbound call to the customer and It is working successfully.</p>
  
  <p><strong>TODO / AIM :</strong> </p>
  
  <p>Instead of 'contact inbound flow type', If I try to use the 'Agent Transfer flow type' with the same code,</p>
  
  <p><a href="https://i.stack.imgur.com/jqBGd.png" rel="nofollow noreferrer"><img src="https://i.stack.imgur.com/jqBGd.png" alt="enter image description here"></a></p>
  
  <p>It is failed with the following error </p>
  
  <pre><code>  message: 'ContactFlow type is invalid',
    code: 'InvalidParameterException',
    time: 2019-10-17T14:28:02.568Z,
    requestId: 'e7359538-a0b2-47c5-a61f-6c7e1b4bf7a6',
    statusCode: 400,
    retryable: false,
    retryDelay: 63.66530948519367 }
  </code></pre>
  
  <p>So how do I automatically connect the agent to the customer in the call? </p>