Solution for Network Errors When Deploying n8n HTTP Node in China (Resolved)

Things you need to know about n8n:

  1. n8n is a workflow automation platform with over 400 integrations and more than 900 ready-to-use templates, making it easy to build powerful automation processes. Most importantly, it supports local deployment, ensuring data security. Although Coze also has rich features, it cannot guarantee data security.

  2. All these integrations can be used for free. Address: https://n8n.io/integrations/categories/ai/

  3. Official template library: https://n8n.io/workflows

    Solution for Network Errors When Deploying n8n HTTP Node in China (Resolved)

Today, while creating a workflow, I encountered this issue. I couldn’t find a ready-made answer on Google or Deepseek, and I was quite frustrated! The HTTP URL I was using was from newsapi:Solution for Network Errors When Deploying n8n HTTP Node in China (Resolved)Solution for Network Errors When Deploying n8n HTTP Node in China (Resolved)Suddenly, I thought that using the debug feature in VS+Cline should solve this problem (I was using the Deepseek V3 interface)!! I immediately got to work!Solution for Network Errors When Deploying n8n HTTP Node in China (Resolved)Step 1: Describe the problem in detail to Cline:Solution for Network Errors When Deploying n8n HTTP Node in China (Resolved)Cline responded quickly, asking whether I was using local deployment or cloud service:Solution for Network Errors When Deploying n8n HTTP Node in China (Resolved)Cline quickly provided two solutions:Solution 1:Set proxy environment variables when starting n8n, run the following code in PowerShell:

$env:HTTP_PROXY="your_proxy_port"
$env:HTTPS_PROXY="your_proxy_port"
npx n8n

Solution 2:Directly configure the proxy in the HTTP Request node

  1. Add the “Proxy” parameter in the HTTP Request node

  2. Fill in:

  • Protocol: http
  • Host:Fill in your own
  • Port: Fill in your own
  • Ensure Clash Verge is running and the system proxy is enabled

  • Test the URL can be maintained as:<span><span>https://newsapi.org/v2/everything?q=ai&apiKey=7ab7813$$$$$$$$$$$$$$$$$b2$$$</span></span>

    First, try Solution 1:Solution for Network Errors When Deploying n8n HTTP Node in China (Resolved)The port started successfully, opened the UI:Solution for Network Errors When Deploying n8n HTTP Node in China (Resolved)It worked! The problem is resolved! Let’s summarize:

    Solution for Network Connection Delay Errors When Deploying n8n HTTP Node

    Problem

    • Connection timeout when accessing international APIs (like NewsAPI) from within China
    • Error message: “The connection timed out”
    • Direct curl test also fails

    Diagnosis

    1. Confirm network connectivity:
    • Basic network is normal (can access baidu.com)
    • The target API is restricted from access
  • Proxy test:
    • Direct connection fails
    • Can successfully access through Clash Verge proxy

    Solution

    Solution 1: Configure Global Proxy for n8n

    Applicable for all HTTP requests to automatically go through the proxy

    1. Set environment variables when starting n8n:
      # PowerShell
      $env:HTTP_PROXY="http://your_proxy_address"
      $env:HTTPS_PROXY="http://your_proxy_address"
      npx n8n

      Ensure:

    • Clash Verge is running
    • System proxy is set to 127.0.0.1:7897

    Solution 2: Configure Proxy for HTTP Request Node Individually

    Applicable for scenarios where some requests need a proxy

    1. Add the “Proxy” parameter in the HTTP Request node
    2. Configuration:
    • Protocol: http
    • Host: 127.0.0.1
    • Port: 7897

    Verification Method

    1. Test request:
      https://newsapi.org/v2/everything?q=ai&amp;apiKey=your_API_KEY
    2. Expected return:
      {
        "status": "ok",
        "totalResults": 34,
        "articles": [...]
      }

    Notes

    • The proxy port may vary depending on Clash configuration (default 7890/7891)
    • In production environments, it is recommended to use a more stable proxy solution
    • Do not directly write sensitive API keys in the request URL

    Conclusion

    By correctly configuring the proxy settings, the network restriction issue for accessing international APIs from mainland China using n8n can be resolved. Choose between global proxy or individual node proxy solutions based on actual needs.

    Share

    Solution for Network Errors When Deploying n8n HTTP Node in China (Resolved)To facilitate communication and sharing of solutions for setting up agents, I created a group, welcome to join (scan the WeChat QR code and note ‘agent’): Solution for Network Errors When Deploying n8n HTTP Node in China (Resolved)

    Leave a Comment