This is a standard API call with HTTP Request. It uses POST to send a body (query parameters) and the API responds with JSON.
We have the activity timeout set at 30 seconds, but after around 8 seconds it is failing with “the operation timed out.” We can see on our end the API call going out our proxy. The API vendor can see that they receive the request, pull their data, and send back the JSON response in about 8 seconds - exactly when the HTTP Request activity is faulting.
Note that this issue is intermittent. It happens frequently but doesn’t happen all the time. We do have queue retry set up and about 95% of the time the item is retried and succeeds on the 2nd or 3rd try.
We suspect that the issue is that the API sends the response and closes the connection, but the automation doesn’t get the response and sees the connection close, erroneously interpreting it as a timeout.
We are currently coordinating with our network team to watch the communication (across, of course, multiple proxies and firewalls) to see what’s happening.
If anyone has any ideas or has run into this issue before, I would really appreciate input.
One suggestion/idea would be to maybe try to isolate the issue by using invoke code/coded workflows to run the HTTP Request via raw code (and maybe with the HttpClient, instead of RestSharp used by the HTTP Request activity).
It is a bit more work, but it could potentially help you figure out if the issue is network related or UiPath activity related.
// Create a HttpClient instance
System.Net.Http.HttpClient client = new HttpClient();
// Define payload as query parameters
var queryParams = new Dictionary<string, string>
{
{ "Key1", "value1" },
{ "Key2", "value2" },
// add other parameters as needed
};
// Convert payload to HttpContent
var httpContent = new FormUrlEncodedContent(queryParams);
// Define Uri
var uri = new Uri("https://webhook.site/[grabFullUrlByGoingTowebhook.site]"); // replace "" with your url
// Perform POST operation with HttpClient
HttpResponseMessage response = client.PostAsync(uri, httpContent).GetAwaiter().GetResult();
// If Json response is expected from server
if (response.IsSuccessStatusCode)
{
Argument1 = response.Content.ReadAsStringAsync().GetAwaiter().GetResult();
// process the response here
}
I rebuilt the automation from scratch in Windows compatibility (previous version was legacy) and with newer versions of all dependencies and now it seems to be working fine. Must have been a bug in an earlier version dependency.