Send HTTP request
This Workflow Companion action allows you to send HTTP requests to a specified URL and handle the response.
Configuration
Action Parameters
- URL (required): The endpoint to which the HTTP request will be sent. You can use variables to dynamically set the URL.
- Body: The request payload, if applicable. For JSON payloads, you may find it convenient to prepare the data using
the
Run codeaction.
Request configuration
-
Method: The HTTP method for the request (
GET,POST, and so on...) -
Content type: The media type of the request body.
-
Authentication: The type of authentication for the request. Available options:
- None: No authentication.
- Shared credential: Use a saved credential from the app settings (Settings → Send HTTP Request Auth). A shared credential can be reused across multiple actions.
- Custom: Configure authentication inline for this specific action. Credentials are stored per-action.
When using Shared credential or Custom mode, the following authentication types are available:
- Basic: Username and password
- Bearer token: A bearer token sent in the
Authorizationheader - Custom header: A custom header name and value
-
Additional headers: Custom key-value headers appended to the request.
Response configuration
-
When the server returns an error status code: What the action does. Select an option for each group of status codes:
- 429 Too many requests: The server received too many requests. This is usually temporary.
- Other 4xx status codes: The server did not accept the request, for example
400 Bad Requestor404 Not Found. Usually, the same request gets the same status code again. - 5xx status codes: The server could not process the request, for example
500 Internal Server Erroror503 Service Unavailable.
The options are:
- Continue workflow: The action returns the response, and the workflow continues. To handle the error, use
the
okandstatusfields in a condition. - Fail workflow: The workflow stops with an error that shows the status code and the start of the response body.
- Retry for up to 36 hours: The request is sent again at increasing intervals, until the server returns a status code that is not retried. After 36 hours of retries, the workflow fails.
If the action cannot connect to the server, for example because the host is not found or the connection is refused, the request is retried for up to 36 hours with any of these options.
The action follows redirects (
3xxstatus codes) up to 5 times. A3xxresponse without a redirect address, such as304 Not Modified, is returned like any other response. -
Data transformation: You can enable this option to customize the response using JavaScript. This is useful in cases where:
- The HTTP response body is too large and exceeds Shopify Flow's allowed limits (you may see a "Response too large" error) — you can extract only the necessary data to reduce its size.
- You want to enrich or modify the response by including information from the response headers.
When enabled, you can write a JavaScript function like this:
export default transform(({ body, status, headers, url }) => { // transformation code return { /* your transformed data */ }; });The function may return either a string or any JSON-serialisable value. The input parameter is an object with the following properties:
- body: The raw response body (string)
- status: The HTTP status code (number)
- headers: An object containing all response headers
- url: The URL the request was sent to (string)
Security
Authentication credentials — passwords, tokens and custom header values — are stored encrypted and never shown in the UI after saving. Additional headers aren't credentials: put tokens and keys under Authentication.
A redirect keeps the headers you set, authentication included, when it leads to the same host or one of its subdomains without moving from HTTPS to HTTP; any other redirect drops them. A redirect that sends the body on keeps the Content type.
Output
The action returns the following fields:
- body: The response body. Can be parsed in a
Run codeaction for structured data processing. - ok: Indicates if the request was successful (status in the range 200-299). Can be used in conditions for further response handling.
- status: The HTTP status code of the response. Can be used in conditions to handle different response scenarios.