通过HTTP请求从任意工作流发送结构化日志到BetterStack
中级
这是一个Engineering, DevOps领域的自动化工作流,包含 8 个节点。主要使用 HttpRequest, ManualTrigger, ExecuteWorkflow, ExecuteWorkflowTrigger 等节点。 通过HTTP请求从任意工作流发送结构化日志到BetterStack
前置要求
- •可能需要目标 API 的认证凭证
工作流预览
可视化展示节点连接关系,支持缩放和平移
导出工作流
复制以下 JSON 配置到 n8n 导入,即可使用此工作流
{
"meta": {
"instanceId": "568298fde06d3db80a2eea77fe5bf45f0c7bb898dea20b769944e9ac7c6c5a80"
},
"nodes": [
{
"id": "72babb83-0530-4809-9f6f-d9afaf91fd59",
"name": "发送日志到 BetterStack",
"type": "n8n-nodes-base.httpRequest",
"position": [
80,
140
],
"parameters": {
"method": "POST",
"options": {},
"jsonBody": "={\n \"message\":\"{{ $json.message }}\",\n \"level\": \"{{ $json.level }}\"\n} ",
"sendBody": true,
"specifyBody": "json",
"authentication": "genericCredentialType",
"genericAuthType": "httpHeaderAuth"
},
"credentials": {
"httpHeaderAuth": {
"id": "NAa1bu8yteVhXxxV",
"name": "Header Auth BetterStack"
}
},
"typeVersion": 4.2
},
{
"id": "863b184b-05c0-47b7-82c1-166bdf25a32a",
"name": "接收日志消息",
"type": "n8n-nodes-base.executeWorkflowTrigger",
"notes": "from another workflow",
"position": [
-140,
140
],
"parameters": {
"workflowInputs": {
"values": [
{
"name": "level"
},
{
"name": "message"
}
]
}
},
"notesInFlow": true,
"typeVersion": 1.1
},
{
"id": "e696b65e-5249-43b2-9a33-4e59fc616f21",
"name": "测试工作流",
"type": "n8n-nodes-base.manualTrigger",
"position": [
-260,
-120
],
"parameters": {},
"typeVersion": 1
},
{
"id": "f7b51eae-4016-4072-9539-b66ea8646508",
"name": "发送测试日志消息",
"type": "n8n-nodes-base.executeWorkflow",
"notes": "using workflow",
"position": [
-40,
-120
],
"parameters": {
"options": {},
"workflowId": {
"__rl": true,
"mode": "id",
"value": "={{$workflow.id}}"
},
"workflowInputs": {
"value": {
"level": "error",
"message": "This is a test log message"
},
"schema": [
{
"id": "level",
"type": "string",
"display": true,
"required": false,
"displayName": "level",
"defaultMatch": false,
"canBeUsedToMatch": true
},
{
"id": "message",
"type": "string",
"display": true,
"required": false,
"displayName": "message",
"defaultMatch": false,
"canBeUsedToMatch": true
}
],
"mappingMode": "defineBelow",
"matchingColumns": [],
"attemptToConvertTypes": false,
"convertFieldsToString": true
}
},
"notesInFlow": true,
"typeVersion": 1.2
},
{
"id": "72457cde-ea6f-406a-8d5e-70878114dd3e",
"name": "便签",
"type": "n8n-nodes-base.stickyNote",
"position": [
-440,
60
],
"parameters": {
"width": 860,
"height": 280,
"content": "## 发送日志条目到 BetterStack"
},
"typeVersion": 1
},
{
"id": "442976e5-1306-4c9b-a3e6-5693ae6d132c",
"name": "便签 1",
"type": "n8n-nodes-base.stickyNote",
"position": [
-440,
-240
],
"parameters": {
"color": 7,
"width": 660,
"height": 280,
"content": "## 演示"
},
"typeVersion": 1
},
{
"id": "4175c168-1f59-4213-8bc4-a71dd62c3bd9",
"name": "便签 2",
"type": "n8n-nodes-base.stickyNote",
"position": [
20,
100
],
"parameters": {
"color": 3,
"height": 200,
"content": "### 编辑我"
},
"typeVersion": 1
},
{
"id": "c69c7c62-f4b5-4b14-b6be-8e9f3b8a38cd",
"name": "便签 3",
"type": "n8n-nodes-base.stickyNote",
"position": [
-780,
-240
],
"parameters": {
"color": 6,
"width": 300,
"height": 580,
"content": "### 🧾 记录到 BetterStack"
},
"typeVersion": 1
}
],
"pinData": {},
"connections": {
"Test workflow": {
"main": [
[
{
"node": "Send test log message",
"type": "main",
"index": 0
}
]
]
},
"Recieve log message": {
"main": [
[
{
"node": "Send Log to BetterStack",
"type": "main",
"index": 0
}
]
]
}
}
}常见问题
如何使用这个工作流?
复制上方的 JSON 配置代码,在您的 n8n 实例中创建新工作流并选择「从 JSON 导入」,粘贴配置后根据需要修改凭证设置即可。
这个工作流适合什么场景?
中级 - 工程, 开发运维
需要付费吗?
本工作流完全免费,您可以直接导入使用。但请注意,工作流中使用的第三方服务(如 OpenAI API)可能需要您自行付费。
相关工作流推荐
读取站点地图并过滤URL
从sitemap.xml中提取和处理特定链接
Set
Xml
Filter
+4
10 节点Audun
工程
网页内部链接提取
从网页中提取内部链接
If
Set
Html
+6
13 节点Audun
工程
使用Redis防止工作流并发运行
使用Redis防止工作流并发运行
If
Set
Wait
+8
43 节点Hugues Stock
工程
使用OpenAI和Quickchart.io可视化SQL代理查询
使用OpenAI和Quickchart.io可视化SQL代理查询
Set
Http Request
Agent
+7
16 节点Agent Studio
工程
基于 Bright Data MCP 的 AI Telegram 数据提取机器人
集成 Bright Data MCP 的 AI Telegram 数据提取机器人
If
N8n
Wait
+11
21 节点Cyril Nicko Gaspar
工程
API架构提取器
API架构提取器
If
Set
Code
+22
88 节点Polina Medvedieva
工程