Skip to main content
The HTTP Request node connects your workflow to external APIs and web services. Use it to fetch data, send webhooks, upload files, or integrate with any service that accepts HTTP requests.
HTTP Request Node Configuration

HTTP Request Node Configuration

HTTP Methods

The node supports all standard HTTP methods for different types of operations:
GET retrieves data from servers without modifying anything. Use for fetching user profiles, searching databases, or getting current status.HEAD gets response headers without the full response body. Useful for checking if resources exist or getting metadata.

Configuration

Configure every aspect of your HTTP request including URL, headers, query parameters, request body, and authentication. Variables from previous workflow nodes can be dynamically inserted anywhere in your request configuration.

Variable Substitution

Reference workflow variables using double curly braces: {{variable_name}}. Dify supports deep object access, so you can extract nested values like {{api_response.data.items[0].id}} from previous HTTP responses. Secret-type environment variable values are masked in workflow run logs and in this node’s request log.

Timeout Configuration

HTTP requests have configurable timeouts to prevent hanging:
  • Connect timeout: Maximum time to establish connection
  • Read timeout: Maximum time to read response data
  • Write timeout: Maximum time to send request data
Timeouts are enforced to maintain workflow performance and prevent resource exhaustion.

Authentication

The node supports multiple authentication types: No Auth (type: "no-auth") - No authentication headers added API Key (type: "api-key") with three subtypes:
  • Basic (type: "basic") - Adds Basic Auth header with base64 encoding
  • Bearer (type: "bearer") - Adds Authorization: Bearer <token> header
  • Custom (type: "custom") - Adds custom header with specified name and value

Request Body

Choose the appropriate body type based on your API requirements:
  • JSON for structured data
  • Form Data for traditional web forms
  • Binary for file uploads
  • Raw Text for custom content types

File Detection

The HTTP Request node automatically detects file responses using sophisticated logic:
  1. Content-Disposition analysis - Checks for attachment disposition or filename parameters
  2. MIME type evaluation - Analyzes content types to distinguish text from binary
  3. Content sampling - For ambiguous types, samples first 1024 bytes to detect text patterns
Text-based responses (JSON, XML, HTML, etc.) are treated as regular data, while binary content becomes file variables.

File Operations

The HTTP Request node handles file uploads and downloads seamlessly:
File Upload Configuration Example

File Upload Configuration Example

File Uploads use the binary request body option. Select file variables from previous nodes to send files to external services for document storage, media processing, or backup. File Downloads are automatically handled when responses contain file content. Downloaded files become available as file variables for use in downstream nodes.

Error Handling and Retries

Configure robust error handling for production workflows that depend on external services:
HTTP Retry Configuration

HTTP Retry Configuration

Retry on failure is on by default, so a failed request is sent again before the node gives up. You can set up to 10 retries, up to 5000 ms apart. More retries and longer intervals ride out longer outages, but a request that keeps failing takes longer to fail.
For a request that creates or changes data, such as placing an order or sending a message, turn off Retry on failure unless repeating the request is harmless. A failed request, such as one that timed out, may still have gone through, so a retry can make the same change twice.Repeating is harmless when the request only sets something to a fixed value, such as marking a ticket closed, or when the API accepts an idempotency key and the request includes one.
HTTP Error Handling Options

HTTP Error Handling Options

Error Handling defines alternative workflow paths when HTTP requests fail, ensuring your workflow continues executing even when external APIs are unavailable. For a request that changes data, set Error Handling to Fail Branch. On that branch, add nodes that check whether the change went through and resend the request only if it didn’t. If the API offers no way to check, have the branch notify someone instead.

Response Processing

HTTP responses become structured variables in subsequent nodes with separate access to:
  • Response Body - The main content returned by the API
  • Status Code - HTTP status for conditional logic
  • Headers - Response metadata as key-value pairs
  • Files - Any file content returned by the API
  • Size Information - Content size in bytes with readable formatting (KB/MB)

SSL Verification

SSL certificate verification is configurable per node (ssl_verify parameter). This allows connections to internal services with self-signed certificates while maintaining security for external APIs.
Dynamic API Integration Example Workflow

Dynamic API Integration Example Workflow

Last modified on December 4, 2026