8
n8n 中文网amn8n.com

自动化GLPI工单截止日期提醒

高级

这是一个Ticket Management, Multimodal AI领域的自动化工作流,包含 16 个节点。主要使用 If, Set, SplitOut, Aggregate, HttpRequest 等节点。 通过Microsoft Teams发送的自动化GLPI工单截止日期提醒

前置要求
  • 可能需要目标 API 的认证凭证
工作流预览
可视化展示节点连接关系,支持缩放和平移
导出工作流
复制以下 JSON 配置到 n8n 导入,即可使用此工作流
{
  "meta": {
    "instanceId": "9a6585d268bcb16af660ea2f3e8e0a8881962c92868e9c530eb83c6c580731c3"
  },
  "nodes": [
    {
      "id": "89d3c9e8-e4cc-4a28-80ab-7f7661491168",
      "name": "无操作,不执行任何操作3",
      "type": "n8n-nodes-base.noOp",
      "position": [
        320,
        400
      ],
      "parameters": {},
      "typeVersion": 1
    },
    {
      "id": "5c41293e-18e8-49eb-94bd-442d4c1fc373",
      "name": "结束会话1",
      "type": "n8n-nodes-base.httpRequest",
      "position": [
        96,
        32
      ],
      "parameters": {
        "url": "={{ $('Configuration Variables').item.json.glpi_url }}apirest.php/killSession",
        "options": {},
        "sendHeaders": true,
        "headerParameters": {
          "parameters": [
            {
              "name": "Session-Token",
              "value": "={{ $('Get session token').item.json.session_token }}"
            },
            {
              "name": "App-Token",
              "value": "={{ $('Configuration Variables').item.json.app_token }}"
            }
          ]
        }
      },
      "typeVersion": 4.2
    },
    {
      "id": "d15822e3-b973-457a-9706-779958ff44b1",
      "name": "无操作,不执行任何操作2",
      "type": "n8n-nodes-base.noOp",
      "position": [
        320,
        32
      ],
      "parameters": {},
      "typeVersion": 1
    },
    {
      "id": "d33d8698-b491-4d09-8ea0-ce2d9feb9e95",
      "name": "配置变量",
      "type": "n8n-nodes-base.set",
      "position": [
        -1248,
        560
      ],
      "parameters": {
        "fields": {
          "values": [
            {
              "name": "glpi_url",
              "stringValue": "https://your_glpi_server.com"
            },
            {
              "name": "app_token",
              "stringValue": "Your App Token is here"
            }
          ]
        },
        "options": {}
      },
      "typeVersion": 3.2
    },
    {
      "id": "37f976d6-bc9e-4bb1-a1a8-c2cd80dc0f21",
      "name": "向技术支持1发送消息",
      "type": "n8n-nodes-base.microsoftTeams",
      "position": [
        96,
        416
      ],
      "webhookId": "faef30e7-48b9-48d8-ac4a-2930a533a552",
      "parameters": {
        "chatId": {
          "__rl": true,
          "mode": "list",
          "value": "19:9d87b5db-9cfe-4cc5-ab11-b131a06789ff_b3481c22-4337-4a46-aec4-0457bad71345@unq.gbl.spaces",
          "cachedResultUrl": "https://teams.microsoft.com/l/chat/19%3A9d87b5db-9cfe-4cc5-ab11-b131a06789ff_b3481c22-4337-4a46-aec4-0457bad71345%40unq.gbl.spaces/0?tenantId=84a66816-16ec-48c3-bcea-b62049cde20b",
          "cachedResultName": "Support Technician 1, Integropen Solutions (oneOnOne)"
        },
        "message": "=## Action Required: Ticket about to expire\n\n**Title:** {{ $json['1'] }}\n\n**ID:** {{ $json['2'] }}\n\n**Expires in:** {{ $json['18'] }}",
        "options": {
          "includeLinkToWorkflow": false
        },
        "resource": "chatMessage"
      },
      "credentials": {
        "microsoftTeamsOAuth2Api": {
          "id": "6gsSfvAqrtsa0H1n",
          "name": "Microsoft Teams account"
        }
      },
      "typeVersion": 2
    },
    {
      "id": "ad446521-d997-4563-84f6-30dbd5865622",
      "name": "向技术支持2发送消息",
      "type": "n8n-nodes-base.microsoftTeams",
      "position": [
        320,
        608
      ],
      "webhookId": "faef30e7-48b9-48d8-ac4a-2930a533a552",
      "parameters": {
        "chatId": {
          "__rl": true,
          "mode": "list",
          "value": "19:57fafa2a-5195-4d52-a389-ef2fb95d75f0_b3481c22-4337-4a46-aec4-0457bad71345@unq.gbl.spaces",
          "cachedResultUrl": "https://teams.microsoft.com/l/chat/19%3A57fafa2a-5195-4d52-a389-ef2fb95d75f0_b3481c22-4337-4a46-aec4-0457bad71345%40unq.gbl.spaces/0?tenantId=84a66816-16ec-48c3-bcea-b62049cde20b",
          "cachedResultName": "Support Technician 2, Integropen Solutions (oneOnOne)"
        },
        "message": "=## Action Required: Ticket about to expire\n\n**Title:** {{ $json['1'] }}\n\n**ID:** {{ $json['2'] }}\n\n**Expires in:** {{ $json['18'] }}",
        "options": {
          "includeLinkToWorkflow": false
        },
        "resource": "chatMessage"
      },
      "credentials": {
        "microsoftTeamsOAuth2Api": {
          "id": "6gsSfvAqrtsa0H1n",
          "name": "Microsoft Teams account"
        }
      },
      "typeVersion": 2
    },
    {
      "id": "27036a12-b3ee-4319-b65c-c98bb217897a",
      "name": "聚合",
      "type": "n8n-nodes-base.aggregate",
      "position": [
        -128,
        32
      ],
      "parameters": {
        "options": {},
        "aggregate": "aggregateAllItemData"
      },
      "typeVersion": 1
    },
    {
      "id": "1f1bb9d4-d8f6-40d2-94ce-ffe727d8c0ef",
      "name": "即将过期的工单",
      "type": "n8n-nodes-base.httpRequest",
      "position": [
        -800,
        560
      ],
      "parameters": {
        "url": "={{ $('Configuration Variables').item.json.glpi_url }}/apirest.php/search/Ticket",
        "options": {},
        "sendQuery": true,
        "sendHeaders": true,
        "queryParameters": {
          "parameters": [
            {
              "name": "criteria[0][field]",
              "value": "18"
            },
            {
              "name": "criteria[0][searchtype]",
              "value": "lessthan"
            },
            {
              "name": "criteria[0][value]",
              "value": "={{new Date(Date.now() + (2 * 24 * 60 * 60 * 1000)).toISOString().split('T')[0]}}"
            }
          ]
        },
        "headerParameters": {
          "parameters": [
            {
              "name": "Content-Type",
              "value": "application/json"
            },
            {
              "name": "Session-Token",
              "value": "={{ $json.session_token }}"
            },
            {
              "name": "App-Token",
              "value": "={{ $('Configuration Variables').item.json.app_token }}"
            }
          ]
        }
      },
      "typeVersion": 4.2
    },
    {
      "id": "861d3525-6e45-476d-a00b-fade07e0ded8",
      "name": "获取会话令牌",
      "type": "n8n-nodes-base.httpRequest",
      "position": [
        -1024,
        560
      ],
      "parameters": {
        "url": "={{ $json.glpi_url }}/apirest.php/initSession",
        "options": {},
        "sendHeaders": true,
        "authentication": "genericCredentialType",
        "genericAuthType": "httpBasicAuth",
        "headerParameters": {
          "parameters": [
            {
              "name": "Content-Type",
              "value": "application/json"
            },
            {
              "name": "App-Token",
              "value": "={{ $json.app_token }}"
            }
          ]
        }
      },
      "credentials": {
        "httpBasicAuth": {
          "id": "7dcUgKfChVkBmVFm",
          "name": "GLPI"
        }
      },
      "typeVersion": 4.2
    },
    {
      "id": "db9e10ea-b03f-4792-b5e7-5b4484a5351c",
      "name": "技术支持1?",
      "type": "n8n-nodes-base.if",
      "position": [
        -128,
        320
      ],
      "parameters": {
        "options": {},
        "conditions": {
          "options": {
            "version": 2,
            "leftValue": "",
            "caseSensitive": true,
            "typeValidation": "strict"
          },
          "combinator": "and",
          "conditions": [
            {
              "id": "2aae6f0c-eea2-4402-a2dc-d75f946134ee",
              "operator": {
                "type": "string",
                "operation": "equals"
              },
              "leftValue": "={{ $json[\"5\"] }}",
              "rightValue": "7"
            }
          ]
        }
      },
      "typeVersion": 2.2
    },
    {
      "id": "097be4cb-3a42-413e-99a1-281c5fbd284b",
      "name": "技术支持2?",
      "type": "n8n-nodes-base.if",
      "position": [
        96,
        224
      ],
      "parameters": {
        "options": {},
        "conditions": {
          "options": {
            "version": 2,
            "leftValue": "",
            "caseSensitive": true,
            "typeValidation": "strict"
          },
          "combinator": "and",
          "conditions": [
            {
              "id": "6c4e4a5b-7eda-48dd-8b44-cc66715d3399",
              "operator": {
                "name": "filter.operator.equals",
                "type": "string",
                "operation": "equals"
              },
              "leftValue": "={{ $json[\"5\"] }}",
              "rightValue": "8"
            }
          ]
        }
      },
      "typeVersion": 2.2
    },
    {
      "id": "9143952e-58bd-40ac-aece-3d718e54674b",
      "name": "计划触发器",
      "type": "n8n-nodes-base.scheduleTrigger",
      "position": [
        -1472,
        560
      ],
      "parameters": {
        "rule": {
          "interval": [
            {
              "triggerAtHour": 9
            }
          ]
        }
      },
      "typeVersion": 1.2
    },
    {
      "id": "9a2a292d-4472-4ad2-8c92-ee7ff5989f03",
      "name": "遍历项目",
      "type": "n8n-nodes-base.splitInBatches",
      "position": [
        -352,
        560
      ],
      "parameters": {
        "options": {}
      },
      "typeVersion": 3
    },
    {
      "id": "38834a1f-125c-4aa6-a4e0-63f8fce69d69",
      "name": "分离",
      "type": "n8n-nodes-base.splitOut",
      "position": [
        -576,
        560
      ],
      "parameters": {
        "options": {},
        "fieldToSplitOut": "data"
      },
      "typeVersion": 1
    },
    {
      "id": "0f8bf852-c719-49ed-8400-975c74cdd7cd",
      "name": "便签",
      "type": "n8n-nodes-base.stickyNote",
      "position": [
        -2048,
        -32
      ],
      "parameters": {
        "color": 5,
        "width": 720,
        "height": 496,
        "content": "## 要求:"
      },
      "typeVersion": 1
    },
    {
      "id": "ee77c5c3-03b1-47e2-825f-734f386ae613",
      "name": "便签1",
      "type": "n8n-nodes-base.stickyNote",
      "position": [
        -1312,
        -32
      ],
      "parameters": {
        "color": 4,
        "width": 976,
        "height": 496,
        "content": "## 即将过期的工单节点"
      },
      "typeVersion": 1
    }
  ],
  "pinData": {},
  "connections": {
    "Aggregate": {
      "main": [
        [
          {
            "node": "End session1",
            "type": "main",
            "index": 0
          }
        ]
      ]
    },
    "Split Out": {
      "main": [
        [
          {
            "node": "Loop Over Items",
            "type": "main",
            "index": 0
          }
        ]
      ]
    },
    "End session1": {
      "main": [
        [
          {
            "node": "No Operation, do nothing2",
            "type": "main",
            "index": 0
          }
        ]
      ]
    },
    "Loop Over Items": {
      "main": [
        [
          {
            "node": "Aggregate",
            "type": "main",
            "index": 0
          }
        ],
        [
          {
            "node": "Support Technician 1?",
            "type": "main",
            "index": 0
          }
        ]
      ]
    },
    "Schedule Trigger": {
      "main": [
        [
          {
            "node": "Configuration Variables",
            "type": "main",
            "index": 0
          }
        ]
      ]
    },
    "Get session token": {
      "main": [
        [
          {
            "node": "Tickets about to expire",
            "type": "main",
            "index": 0
          }
        ]
      ]
    },
    "Support Technician 1?": {
      "main": [
        [
          {
            "node": "Send a message to Support Technician 1",
            "type": "main",
            "index": 0
          }
        ],
        [
          {
            "node": "Support Technician 2?",
            "type": "main",
            "index": 0
          }
        ]
      ]
    },
    "Support Technician 2?": {
      "main": [
        [
          {
            "node": "Send a message to Support Technician 2",
            "type": "main",
            "index": 0
          }
        ],
        [
          {
            "node": "No Operation, do nothing3",
            "type": "main",
            "index": 0
          }
        ]
      ]
    },
    "Configuration Variables": {
      "main": [
        [
          {
            "node": "Get session token",
            "type": "main",
            "index": 0
          }
        ]
      ]
    },
    "Tickets about to expire": {
      "main": [
        [
          {
            "node": "Split Out",
            "type": "main",
            "index": 0
          }
        ]
      ]
    },
    "No Operation, do nothing3": {
      "main": [
        [
          {
            "node": "Loop Over Items",
            "type": "main",
            "index": 0
          }
        ]
      ]
    },
    "Send a message to Support Technician 1": {
      "main": [
        [
          {
            "node": "Loop Over Items",
            "type": "main",
            "index": 0
          }
        ]
      ]
    },
    "Send a message to Support Technician 2": {
      "main": [
        [
          {
            "node": "Loop Over Items",
            "type": "main",
            "index": 0
          }
        ]
      ]
    }
  }
}
常见问题

如何使用这个工作流?

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

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

高级 - 工单管理, 多模态 AI

需要付费吗?

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

工作流信息
难度等级
高级
节点数量16
分类2
节点类型10
难度说明

适合高级用户,包含 16+ 个节点的复杂工作流

作者
Luis Hernandez

Luis Hernandez

@integropen

I like solving problems and have a true passion for no-code automation. I'm thoughtful by nature and enjoy finding ways to optimize processes, always guided by my principles and values.

外部链接
在 n8n.io 查看

分享此工作流