8
n8n 中文网amn8n.com

获取n8n实例的公共IP地址

中级

这是一个Engineering领域的自动化工作流,包含 6 个节点。主要使用 Set, Webhook, Aggregate, HttpRequest, RespondToWebhook 等节点。 获取n8n实例的公共IP地址

前置要求
  • HTTP Webhook 端点(n8n 会自动生成)
  • 可能需要目标 API 的认证凭证

分类

工作流预览
可视化展示节点连接关系,支持缩放和平移
导出工作流
复制以下 JSON 配置到 n8n 导入,即可使用此工作流
{
  "id": "OU7CNqiRY4Kbvq1a",
  "meta": {
    "instanceId": "135b9ed6d0f8a3f531d9011b0173000ad0dac1ffc90258e867f38c270f30c9dc",
    "templateCredsSetupCompleted": true
  },
  "name": "获取 n8n 实例的公共 IP 地址",
  "tags": [],
  "nodes": [
    {
      "id": "1f1aa04c-fde0-4166-a714-451964e45fe5",
      "name": "HTTP 请求",
      "type": "n8n-nodes-base.httpRequest",
      "notes": "request public IP address information as json",
      "position": [
        300,
        -160
      ],
      "parameters": {
        "url": "https://api.ipify.org",
        "options": {},
        "sendQuery": true,
        "queryParameters": {
          "parameters": [
            {
              "name": "format",
              "value": "json"
            }
          ]
        }
      },
      "executeOnce": false,
      "notesInFlow": true,
      "typeVersion": 4.2,
      "alwaysOutputData": true
    },
    {
      "id": "ddb35464-535f-4ce4-a14d-682673690ca0",
      "name": "Webhook",
      "type": "n8n-nodes-base.webhook",
      "notes": "simple webhook with header-auth",
      "position": [
        -140,
        -160
      ],
      "webhookId": "4879bc79-d6f8-48df-bfe4-613366c7f399",
      "parameters": {
        "path": "4879bc79-d6f8-48df-bfe4-613366c7f399",
        "options": {},
        "responseMode": "responseNode",
        "authentication": "headerAuth"
      },
      "credentials": {
        "httpHeaderAuth": {
          "id": "0K7Eny0GNMoVhKel",
          "name": "Header Auth account"
        }
      },
      "notesInFlow": true,
      "typeVersion": 2
    },
    {
      "id": "a6ac927d-404d-44a7-8268-4609094c1346",
      "name": "响应 Webhook",
      "type": "n8n-nodes-base.respondToWebhook",
      "notes": "return an array from the workflow and end the webhook invocation.",
      "position": [
        740,
        -160
      ],
      "parameters": {
        "options": {},
        "respondWith": "text",
        "responseBody": "={{ $json.data.pluck('ip').unique().toJsonString() }}"
      },
      "executeOnce": true,
      "notesInFlow": true,
      "typeVersion": 1.2,
      "alwaysOutputData": true
    },
    {
      "id": "20a55cc9-fba5-4392-a807-2783db6261bb",
      "name": "便签",
      "type": "n8n-nodes-base.stickyNote",
      "position": [
        -200,
        -300
      ],
      "parameters": {
        "width": 1160,
        "height": 380,
        "content": "## 用于获取托管 n8n 实例的公共 IP 地址"
      },
      "typeVersion": 1
    },
    {
      "id": "908003cf-f012-4bd6-8128-b3238de2507d",
      "name": "聚合",
      "type": "n8n-nodes-base.aggregate",
      "position": [
        520,
        -160
      ],
      "parameters": {
        "options": {},
        "aggregate": "aggregateAllItemData"
      },
      "typeVersion": 1
    },
    {
      "id": "115d0f12-7ee0-4d0d-8086-f462e8bee197",
      "name": "重复",
      "type": "n8n-nodes-base.set",
      "notes": "Repeat 10 times",
      "position": [
        80,
        -160
      ],
      "parameters": {
        "options": {},
        "duplicateItem": true,
        "duplicateCount": 10
      },
      "executeOnce": true,
      "notesInFlow": true,
      "typeVersion": 3.4,
      "alwaysOutputData": true
    }
  ],
  "active": false,
  "pinData": {},
  "settings": {
    "executionOrder": "v1"
  },
  "versionId": "ea9c9b26-5362-4ee9-84b0-fae0bf02305c",
  "connections": {
    "Repeat": {
      "main": [
        [
          {
            "node": "HTTP Request",
            "type": "main",
            "index": 0
          }
        ]
      ]
    },
    "Webhook": {
      "main": [
        [
          {
            "node": "Repeat",
            "type": "main",
            "index": 0
          }
        ]
      ]
    },
    "Aggregate": {
      "main": [
        [
          {
            "node": "Respond to Webhook",
            "type": "main",
            "index": 0
          }
        ]
      ]
    },
    "HTTP Request": {
      "main": [
        [
          {
            "node": "Aggregate",
            "type": "main",
            "index": 0
          }
        ]
      ]
    }
  }
}
常见问题

如何使用这个工作流?

复制上方的 JSON 配置代码,在您的 n8n 实例中创建新工作流并选择「从 JSON 导入」,粘贴配置后根据需要修改凭证设置即可。

这个工作流适合什么场景?

中级 - 工程

需要付费吗?

本工作流完全免费,您可以直接导入使用。但请注意,工作流中使用的第三方服务(如 OpenAI API)可能需要您自行付费。

工作流信息
难度等级
中级
节点数量6
分类1
节点类型6
难度说明

适合有一定经验的用户,包含 6-15 个节点的中等复杂度工作流

作者
Ger Longstacks

Ger Longstacks

@dims3body

DevOps expert passionate with automation, be it infrastructure provisioning, cloud operation, or workflow.

外部链接
在 n8n.io 查看

分享此工作流