Using fetch-url and api-call steps

Use Fetch URL for HTTP requests and page retrieval. Use Make API Call for JSON API requests that need response mapping. Both steps support GET, POST, PUT, DELETE, and PATCH requests, custom headers, request bodies, templates, and output variables.

Open a flow in the Flow editor to add either step. Rename a step in its header, then set its result variable in Output variable. New Fetch URL and Make API Call steps use fetch_result and api_result as their default output variables.

Before you begin

Open a flow in the Flow editor. If a request needs credentials, create a secret in Managing secrets before you configure the step.

Fetch URL step

Fetch URL sends a standard HTTP request or retrieves page content through Firecrawl.

Add a Fetch URL step

To add a Fetch URL step, follow these steps:

  1. In the Flow editor, click Add Step.
  2. Select Fetch URL.
  3. In the Fetch selector, choose Standard HTTP or Firecrawl (Web Scraping).

Standard HTTP mode

Configure the following fields for a standard HTTP request:

  • URL: enter the endpoint URL. You can include flow variables such as {{PRODUCT_ID}}.
  • Method: choose GET, POST, PUT, DELETE, or PATCH. The default is GET.
  • Body: enter the request payload for POST, PUT, or PATCH. Changing the method to GET or DELETE hides this field without clearing its stored value.
  • Response type: choose JSON or Text/HTML. When you choose Text/HTML, enable Prefer Markdown when available to request Markdown before HTML or text.
  • Headers: add key-value pairs in the advanced Headers settings.

Use a URL template when a flow variable supplies part of the endpoint:

https://api.example.com/products/{{PRODUCT_ID}}

Replace PRODUCT_ID with the name of the flow variable that contains the product ID.

Firecrawl mode

Choose Firecrawl (Web Scraping) when you need page content in one or more output formats.

Configure the following Firecrawl options:

  • Formats: choose one or more of Markdown, HTML, Raw HTML, Screenshot, Links, or JSON.
  • Extract main content only: request the page’s main content without its surrounding navigation.
  • JSON extraction: when you select JSON, enter a JSON schema or describe the data to extract.
  • Advanced settings: configure result caching, maxAge, country, and languages.

Make API Call step

Make API Call sends an HTTP request and parses the response as JSON. Use responseMapping to select fields from the JSON response when you define the step through the API or SDK.

Add a Make API Call step

To add a Make API Call step, follow these steps:

  1. In the Flow editor, click Add Step.
  2. Select Make API Call.
  3. Configure the method, URL, request body, and headers.

Configure the following fields for the step:

  • Method: choose GET, POST, PUT, DELETE, or PATCH.
  • URL: enter the endpoint URL.
  • Body: enter the request body for POST, PUT, or PATCH.
  • Headers: add key-value pairs in the advanced Headers settings.

Set headers

Add headers as key-value pairs in either step’s Headers settings. This example uses a managed secret and a flow variable:

Content-Type: application/json
Authorization: Bearer {{secret:API_KEY}}
X-Custom-Header: {{CUSTOM_HEADER_VALUE}}

Replace API_KEY with the name of your managed secret and CUSTOM_HEADER_VALUE with the name of a flow variable.

Set the request body

For POST, PUT, or PATCH requests, enter a request body. JSON is a common format:

1{
2 "customer": "{{CUSTOMER_NAME}}",
3 "order": {
4 "items": "{{ORDER_ITEMS}}",
5 "total": "{{CALCULATE_TOTAL}}"
6 }
7}

Replace CUSTOMER_NAME, ORDER_ITEMS, and CALCULATE_TOTAL with the names of flow variables.

Configure authentication

Use headers for authentication in the Flow editor. Flow definitions can also set the auth configuration. Store credentials as managed secrets instead of writing them directly in a Flow.

Use a bearer token

Send a bearer token in the Authorization header:

Authorization: Bearer {{secret:API_KEY}}

Replace API_KEY with the name of the managed secret that stores the token.

Use Basic auth

Encode the USERNAME:PASSWORD string as base64, then send the result in the Authorization header:

Authorization: Basic BASE64_CREDENTIALS

Replace BASE64_CREDENTIALS with the encoded credentials. Store the encoded value in a managed secret instead of hardcoding it.

Send an API key in a header

Send an API key in a header that the external service accepts:

X-API-Key: {{secret:API_KEY}}

Replace API_KEY with the name of the managed secret that stores the API key.

Handle responses

Each step stores its result under the configured Output variable. Fetch URL stores either a parsed JSON value or text. Make API Call stores the full parsed JSON response unless responseMapping selects fields.

Reference a full result or a nested property in a later step:

{{API_RESPONSE}}
{{API_RESPONSE.DATA}}

Replace API_RESPONSE with the output variable name and DATA with a property in the response.

Handle errors

To choose how a step responds to an error, open its Error handling control and choose Continue on error, Stop on error, or Use fallbacks. Add a Conditional Logic step when you need to inspect the result before the next step runs.

Build dynamic URLs

Build a URL from flow variables when the endpoint depends on earlier data:

https://api.example.com/{{RESOURCE}}/{{ITEM_ID}}?filter={{SEARCH_TERM}}

Replace RESOURCE, ITEM_ID, and SEARCH_TERM with the names of flow variables.

Rate-limit requests

Add a Wait Until step between requests when an external API limits request frequency. Use this sequence:

  1. Add a Fetch URL or Make API Call step.
  2. Add a Wait Until step and set delayMs to 1000 for a one-second pause.
  3. Add the next Fetch URL or Make API Call step.

Test a step

Test an HTTP step with the inputs from the most recent flow run. Run the flow at least once before you test a step. The test uses the current step configuration, including unsaved edits, and does not save its output to run history.

To test a step, follow these steps:

  1. Run the flow once.
  2. Open the step’s action menu.
  3. Choose Test with last run.
  4. Review Previous output and New output in the test panel.
  5. If Runtype asks you to confirm side effects, review the warning and click Run anyway.

Apply best practices

Apply these practices when you build HTTP steps:

  • Validate responses: check status codes and expected fields before using response data.
  • Handle errors: configure step-level error handling and use conditional logic for fallbacks.
  • Protect secrets: reference credentials with {{secret:SECRET_NAME}} instead of hardcoding them.
  • Choose the right step: use Fetch URL for direct HTTP requests or page content, and use Make API Call for JSON API requests.

Next steps

Continue with these guides: