Send HTTP request

The Send HTTP request action connects your workflow to a web server or URL and sends HTTP requests.

After Flow sends your HTTP request, it waits for a maximum of 30 seconds for an HTTP response code. If Flow hasn't received a response after 30 seconds, then it closes the connection to your app. Later, it retries the request.

Fields

The Send HTTP request action contains the following fields.

Fields used in the Send HTTP request action.
FieldDescription
HTTP methodThe method of HTTP request to send. The Send HTTP request action supports the following methods:

  • Get - Sends a request for information from the server.
  • Delete - Removes a resource from the server.
  • Head - Retrieves the HTTP response headers of the server.
  • Options - Retrieves the options and features that are supported by the server.
  • Patch - Partially updates a resource on the server.
  • Put - Updates a resource on the server.
  • Post - Creates or replaces a resource on the server.
URLThe URL of the server to which the HTTP request is sent.
HeadersThe key and value pair for the HTTP request. Multiple key-value pairs can be entered.
BodyThe content to be sent to the server.

Triggers

The Send HTTP request action can be used in any workflow.

Example

In this example, use Flow to send an HTTP request to an external service.

Before you begin, do the following:

  • Configure a web service that receives HTTP requests and stores the data of those requests for testing, such as Request Catcher. Remember to use caution when sending sensitive data (such as passwords or API keys) to a third-party service.

Then, follow these steps in Flow:

  1. Choose the Product status updated trigger, which allows you to test this workflow by changing the status on a product.
  2. Add Send HTTP Request to your workflow and connect it to the trigger.
  3. Open the configuration panel by clicking the Send HTTP Request step.
  4. In the HTTP Method field, enter POST.
  5. In the URL field, enter the URL to test against, such as https://shopifyflow.requestcatcher.com/test.
  6. In the Headers section, enter a header with Key of Content-Type and Value of text/plain.
  7. In the Body section, enter set to to send the title and updated status of the product from the trigger.
  8. Activate the workflow.
  9. Test it by changing the status on a Product from Draft to Active (or vice versa).
  10. Observe the results in the external testing service, such as https://shopifyflow.requestcatcher.com/ in this example.

Response codes

The following table describes how Flow processes the HTTP response code after it receives a response.

How Flow processes HTTP response codes.
HTTP response codeHow Flow processes the response code
2XX or 3XX SuccessFlow marks the HTTP request as a success, and performs subsequent actions in the workflow.
429 or 5XX ErrorFlow automatically retries the action for up to 24 hours until it receives a different response code or it times out.
Other response codeIf your app returns a code that isn't described in this table or it times out while retrying actions, then Flow marks the HTTP request as failing. Subsequent workflow actions are not taken.

Limitations

The Send HTTP request action has the following limitations:

  • The action does not return any data from the response to the HTTP request.

Templates

Notify your fulfillment provider about upcoming orders

Send an HTTP request to your fulfillment provider when orders are tagged "Warehouse" in Order Tagger. View template

Can’t find the answers you’re looking for? We’re here to help.