title: How to invoke async activity in UIPath
body: <p>I am trying to execute custom asyncCodeActivity in UIPath. Added the package,  passing all data, however UIPath just hangs when it reaches custom activity and does not throw any exceptions/or stops. I tried to create Class Library using CodeActivity and AsyncCodeActivity - my activity should make several APICalls but I get result it just stops when it reaches my custom activity and does not go to the next one. Is there any example how to create async custom activity for UIPath? My class library worked ok when I tried to test it outside of UIpath. Will appreciate any help.<br>
  My class library using CodeActivity:   </p>
  
  <pre><code>public class AddInvoice : CodeActivity
   {       
      [Category("Input")]
      [RequiredArgument]
      public InArgument&lt;string&gt; PickupZip { get; set; }         
  
      [Category("Output")]
      [RequiredArgument]
      public OutArgument&lt;String&gt; Output { get; set; }
  
      public async Task&lt;string&gt; ApiTest(CodeActivityContext context)
      {            
          try
          { 
          var origin = await GoogleAPIWrapper.GetAddressByZip(PickupZip.Get(context));          
          string PickupAddress;
          string DeliveryAddress;
          var inv = new IList();
          if (origin.StatusId &gt;= 0)
          {                
              invoice.PickupCity = origin.Locality;                
              invoice.PickupState = origin.AdminLevel1; 
          }
          else
          {               
              invoice.PickupCity = null;               
              invoice.PickupState = null;   
          }             
          var tkn = token.Get(context);
          var client = new HttpClient();
          HttpClientHandler handler = new HttpClientHandler();
          client = new HttpClient(handler, false);
          client.BaseAddress = new Uri("http://test.test.com/");
          client.DefaultRequestHeaders.Add("Authorization", "Bearer " + tkn);
          StringContent content = new StringContent(JsonConvert.SerializeObject(inv), Encoding.UTF8, "application/json");
          var response = await client.PostAsync("api/insert/", content);
          var resultContent = response.StatusCode;
              Output.Set(context, resultContent.ToString());
      }
          catch (Exception e)
          {                
              Output.Set(context, e.ToString());
          }
          return "ok";
  }
      protected override void Execute(CodeActivityContext context)
      {
          try
          {
              string result = ApiTest(context).GetAwaiter().GetResult();
          }
          catch (Exception e)
          {
              Output.Set(context, e.ToString());
          }
      }      
  
  
      public class IList
      {            
          public string PickupState { get; set; }            
          public string PickupCity { get; set; }           
      }
  
  }  
  </code></pre>