UiPath Documentation
maestro-automate
latest
false
Maestro Automate user guide

HTTP Request

The HTTP Request node sends a request to a web address, with its configuration, authentication, and response branching.

What it does​

Sends an HTTP request to a URL and makes the response available to the nodes after it.

Authentication options​

One HTTP Request node covers both ways of authenticating, which you choose in the Authentication field:

  • Manual authentication: the method, URL, headers, body, and credentials are configured inline. It fits any external Representational State Transfer (REST) endpoint where the credentials are managed in the node, for example an API key header or a bearer token.
  • Connector based authentication: the request goes through a connection, so the connection handles authentication and the credentials aren't configured in the node. It fits centralized credential management against a service that is connected through Integration Service.

Configuration reference​

FieldRequiredDefaultDescription
Import or exportNoNoneA menu above the fields. Import from cURL parses a cURL command and fills in the method, URL, headers, and body automatically.
AuthenticationYesManual authenticationHow the request is authenticated. Manual authentication passes the credentials in the request headers. Connector based authentication sends the request through a connection, as described below.
MethodYesGETHTTP method for the request. Supported values are GET, POST, PUT, PATCH, and DELETE.
URLYesNoneFull URL to send the request to, including the https:// scheme. In a Fixed value field, a value is inserted with double curly braces, for example https://api.example.com/users/{{ $vars.userId }}.
HeadersNoNoneKey-value pairs sent as HTTP request headers. Header names and values support variable expressions.
Query parametersNoNoneKey-value pairs appended to the URL as a query string. Names and values support variable expressions.
Content TypeNoapplication/jsonMultipurpose Internet Mail Extensions (MIME) type of the request body. Supported values are application/json, application/xml, text/plain, and application/x-www-form-urlencoded.
BodyNoEmptyRequest body for POST, PUT, and PATCH requests. Enter the value directly in the code editor or use variable expressions.
Branching tabNoDefault output onlyResponse branches that route the workflow based on response properties. Each branch has a name and condition expression.
Timeout (Advanced tab)NoPT15MMaximum time to wait for a response, in International Organization for Standardization (ISO) 8601 duration format.
Retry count (Advanced tab)No0Number of times to retry the request if it fails. Retries use the timeout value as the backoff interval.

Connector based authentication​

When Authentication is Connector based authentication, the panel shows these fields instead of the manual ones:

FieldRequiredDescription
ConnectorYesThe connector to send the request through, for example Slack.
Connection (named after the connector, for example Slack connection)YesThe connection to use.
MethodYesThe HTTP method for the request.
Base URLNoThe connector's base URL, shown as a placeholder such as https://slack.com/api.
PathNoThe endpoint path for the REST API request.
HeadersNoKey-value pairs, up to 20. The connector adds its own Authorization, Accept, and Content-Type headers automatically.
Query parametersNoKey-value pairs, up to 20.

The editor suggests common header names such as Authorization, Content-Type, Accept, X-Api-Key, and others. For query parameters, adding a parameter with name page and value 2 sends the request to https://api.example.com/items?page=2.

The node evaluates branch conditions in order and follows the first match. If no branch matches, the workflow follows the Default output.

Branch condition expressions use the same JavaScript syntax as Decision and Switch nodes:

$vars.httpRequest1.output.code === 200
$vars.httpRequest1.output.code === 200
$vars.httpRequest1.output.code >= 400
$vars.httpRequest1.output.code >= 400

Each branch appears as a separate output handle on the right side of the node on the canvas, alongside the Default handle.

Common timeout values:

  • PT30S: 30 seconds.
  • PT5M: 5 minutes.
  • PT15M: 15 minutes.
  • PT1H: 1 hour.

Credentials​

You can authenticate requests in two ways.

Manual authentication​

Pass credentials directly in request headers. For API key authentication, add a header with name X-Api-Key and value set to your key. For bearer token authentication, add an Authorization header with a value like Bearer <your-token>.

Store sensitive values such as tokens and API keys in secret variables rather than hardcoding them.

Connector based authentication​

Select a connection in the properties panel. The connection injects credentials into the request automatically, so you don't need to manage headers yourself.

A connection fits centralized credential management, automatic token refresh, and cases where several workflows share the same API credentials.

Note:

Create a connection describes how to create one.

Examples​

Example 1: Basic GET request​

Fetch a single resource from a public API.

The node is configured with Method set to GET and URL set to https://jsonplaceholder.typicode.com/posts/1. All other fields remain at their defaults.

The response is available in a downstream Script node:

const body = $vars.httpRequest1.output.body;
const status = $vars.httpRequest1.output.code;

return {
  title: body.title,
  userId: body.userId,
  status: status
};
const body = $vars.httpRequest1.output.body;
const status = $vars.httpRequest1.output.code;

return {
  title: body.title,
  userId: body.userId,
  status: status
};

The response object is available at $vars.httpRequest1.output and contains three fields:

  • $vars.httpRequest1.output.body: the parsed response body.
  • $vars.httpRequest1.output.code: the HTTP status code, for example 200.
  • $vars.httpRequest1.output.headers: an object containing the response headers.

Example 2: POST request with a JSON body​

Create a new resource by sending a JSON payload.

The node is configured with Method set to POST, URL set to https://api.example.com/orders, an Authorization header with the value Bearer {{ $vars.apiToken }}, and Content Type left as application/json. The body:

{
  "product": "Widget",
  "quantity": 5,
  "customer_id": "cust_12345"
}
{
  "product": "Widget",
  "quantity": 5,
  "customer_id": "cust_12345"
}

The created resource's ID is available in a downstream node:

const orderId = $vars.httpRequest1.output.body.id;
return { orderId: orderId };
const orderId = $vars.httpRequest1.output.body.id;
return { orderId: orderId };

If the request fails and you've connected an error handle, the error details are available at $vars.httpRequest1.error:

// In a Script node connected to the error handle
const errorMessage = $vars.httpRequest1.error.message;
const errorStatus = $vars.httpRequest1.error.status;

return {
  failed: true,
  reason: errorMessage,
  httpStatus: errorStatus
};
// In a Script node connected to the error handle
const errorMessage = $vars.httpRequest1.error.message;
const errorStatus = $vars.httpRequest1.error.status;

return {
  failed: true,
  reason: errorMessage,
  httpStatus: errorStatus
};

The error object contains:

  • code
  • message
  • detail
  • category
  • status

Example 3: Route responses with branches​

Response branches let the workflow follow different paths based on the API's response without a separate Decision node.

The node is configured with Method set to GET, URL set to https://api.example.com/users/{{ $vars.userId }}, and two branches on the Branching tab: Success with condition $vars.httpRequest1.output.code === 200 and Not Found with condition $vars.httpRequest1.output.code === 404.

The node now has three output handles on the canvas:

  • Success: connects to the nodes that process the user data.
  • Not Found: connects to the nodes that handle the missing user.
  • Default: connects to a fallback path for any other status code.

Each downstream path receives the full response. For example, on the Success branch:

const user = $vars.httpRequest1.output.body;
return { name: user.name, email: user.email };
const user = $vars.httpRequest1.output.body;
return { name: user.name, email: user.email };

Choosing between HTTP Request and an integration node​

Use the HTTP Request node as a general-purpose tool for calling any API. Use a dedicated integration node when one exists for the service you're calling.

Use HTTP Request when...Use an integration node when...
The API has no dedicated connector in the Add node panelA connector exists for the service, such as Slack, Salesforce, or HubSpot CRM
You need full control over headers, query parameters, and body formatYou want pre-built typed inputs and outputs with no manual configuration
You're prototyping against a new API or internal serviceYou want a connection to handle sign-in and token refresh for you
The API uses a non-standard authentication schemeYou want a maintainable workflow that won't break if the API changes its contract

As a rule, searching the Add node panel for a connector first is the better order, with HTTP Request as the fallback when nothing exists for the target service.

Next steps​

  • Script node: transforming and processing HTTP response data.
  • Decision node: branching on conditions, as an alternative to response branches.
  • Variables and data flow: $vars, expression syntax, and variable scoping.
  • Community: ask questions and share workflows with other builders on the UiPath Forum.

Was this page helpful?

Connect

Need help? Support(opens in new window)

Want to learn? UiPath Academy(opens in new window)

Have questions? UiPath Forum(opens in new window)

Stay updated