# n8n: selectively route IP-allowlisted API calls

요약: IP 허용 목록이 필요한 API를 호출하는 노드에만 allowip 프록시를 지정하세요.
비밀 환경변수 접근이 불가능하면 해당 호출만 인증된 Node/Vercel 백엔드로 옮기는 방안을 상의하세요.

## 1. What allowip is

allowip gives the project a fixed outbound IPv4 through an HTTPS CONNECT tunnel configured by the `ALLOWIP_TUNNEL_URL` environment variable. TLS to the destination stays end to end; allowip does not decrypt destination requests or receive destination API credentials.

## 2. Your task, agent

Inspect the workflows and any accompanying code to decide which outbound HTTP calls go to services requiring an IP allowlist. Route **only those calls** through the tunnel, not the whole n8n instance.

Typical signs include `GW.IP_NOT_ALLOWED`, `no_authorization_ip`, “IP not allowed”, 401/403 errors mentioning the IP, SDK docs/settings mentioning IP registration, or a service named by the user. Known examples include Naver Commerce, Coupang WING, Upbit, Bithumb, Kiwoom, Aligo, and 공공데이터포털. This is not exhaustive; requirements vary by API/key.

If it is unclear which calls qualify, ask the user **before changing anything**. Trace the actual nodes/client, including token calls that also require IP registration. Determine the hosting model and whether trusted workflow authors may access private environment variables; do not assume n8n Cloud supports arbitrary env configuration.

## 3. Constraints (must)

- Do not proxy unrelated analytics, your own database, other APIs, or build/install traffic. No instance-wide `HTTPS_PROXY` on a mixed-purpose instance.
- Keep TLS verification on: **Ignore SSL Issues** must stay off.
- Never log or hardcode the tunnel URL or credentials; read private env/platform secrets, not workflow item data, exported JSON, or Set/Edit Fields nodes.
- Stop on proxy failure; never silently fall back to direct connections through retries or error branches.
- Respect hosting/version limits. Do not weaken `$env` access restrictions or install undici in a Code node; a fallback backend must use Node, not Vercel Edge.

## 4. Recommended approach for this platform

Adapt this reference to the existing workflow and deployment. The [official HTTP Request node docs](https://docs.n8n.io/integrations/builtin/core-nodes/n8n-nodes-base.httprequest/#proxy), checked on 2026-11-24, confirm **Options > Proxy** and its precedence over global proxy variables. This setting is verified in documentation, **not live-tested against allowip in this repository**; HTTPS-to-proxy support must be checked on the installed version. The verified Node transport is the alternative if needed.

For self-hosted n8n, supply the issued HTTPS tunnel URL through the deployment's secret store or an ignored, permission-restricted env file. For example, extend the **existing** Compose service:

```yaml
environment:
  ALLOWIP_TUNNEL_URL: ${ALLOWIP_TUNNEL_URL:?Set ALLOWIP_TUNNEL_URL privately}
```

Restart/redeploy the actual service and configure every execution worker in queue mode. Do not print interpolated Compose configuration. Ask the administrator to confirm `$env` access is already permitted for trusted workflow authors; do not grant untrusted authors secret access just for this integration.

On each identified **HTTP Request** node, set **Parameters > Options > Add option > Proxy** to this expression:

```text
{{ $env.ALLOWIP_TUNNEL_URL }}
```

Do not screenshot or log the evaluated preview. Preserve the existing URL, method, n8n authentication credential, signing, headers, and body. Keep URLs HTTPS and controlled by workflow logic. If you want a guard, validate against an allowlist of hosts you identified; `TARGET_API_HOST` is **not required**.

A suitable node configuration disables following redirects, sets a bounded timeout (for example `15000` ms), keeps **Ignore SSL Issues** and **Never Error** off, and uses **On Error > Stop Workflow** (or disables **Continue On Fail** on older versions). Adapt labels to the installed version. Keep any necessary application retries on the same proxied path. Restrict editor access and sensitive execution-data/error retention; alerts should contain only sanitized status.

If n8n Cloud or blocked env access prevents secret-safe setup, discuss moving only the selected operation to an authenticated [Node](node.md) or [Vercel](vercel.md) backend. Keep `ALLOWIP_TUNNEL_URL` and destination secrets on that backend; n8n calls a fixed operation using an existing authentication credential. Do not introduce infrastructure without agreement or build an arbitrary-URL relay. If HTTPS proxy compatibility fails, use this backend approach rather than plaintext proxy URLs or disabled TLS checks.

## 5. Verify

Use a temporary HTTP Request node to GET `https://api.ipify.org?format=json` **through the same Proxy expression**, with redirects off, timeout bounded, and TLS verification on. Compare its `ip` exactly with the IPv4 shown in the allowip dashboard. An If node may compare `{{ $json.ip }}` with an optional non-secret `{{ $env.ALLOWIP_EGRESS_IP }}`; reject missing values and route mismatches to Stop And Error.

Only after that succeeds, run one existing authenticated **read-only** call to each selected target through its proxied node and check status. No orders, messages, or writes. Test the production/queue worker too, not just editor execution. Remove temporary diagnostics and report only sanitized results.

With a backend workaround, perform the ipify comparison **inside the backend through allowip**, then invoke its read-only operation from n8n. n8n's own IP does not verify backend egress.

Tunnel CONNECT codes: **407** authentication failed; **403** destination/port not allowed; **402** account expired/inactive; **502** upstream connection failed. n8n may wrap these in node errors. Do not copy raw errors into execution items or alerts; distinguish destination HTTP errors from tunnel codes.

## 6. Report back to the user

Explain which nodes/calls you routed and why, which you left alone, what verification ran, and what remains unverified. List remaining user actions such as setting deployment secrets or registering the **allowip dashboard IPv4**, not an n8n hosting IP or proxy hostname, in the target console.

Link the relevant solution: [Naver Commerce](https://allowip.com/solutions/naver-commerce), [Coupang WING](https://allowip.com/solutions/coupang), [Upbit/Bithumb](https://allowip.com/solutions/upbit-bithumb), [Kiwoom](https://allowip.com/solutions/kiwoom), [Aligo](https://allowip.com/solutions/aligo), or [공공데이터포털](https://allowip.com/solutions/public-data). The last has provider-specific restrictions, not a universal registration field.
