Things you need to know about n8n:
-
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.
-
All these integrations can be used for free. Address: https://n8n.io/integrations/categories/ai/
-
Official template library: https://n8n.io/workflows
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: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!
Step 1: Describe the problem in detail to Cline:
Cline responded quickly, asking whether I was using local deployment or cloud service:
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
-
Add the “Proxy” parameter in the HTTP Request node
-
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:The port started successfully, opened the UI:
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
- Confirm network connectivity:
- Basic network is normal (can access baidu.com)
- The target API is restricted from access
- 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
- 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
- Add the “Proxy” parameter in the HTTP Request node
- Configuration:
- Protocol: http
- Host: 127.0.0.1
- Port: 7897
Verification Method
- Test request:
https://newsapi.org/v2/everything?q=ai&apiKey=your_API_KEY
- 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
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’):