8
n8n 中文网amn8n.com

我的工作流19

高级

这是一个DevOps领域的自动化工作流,包含 21 个节点。主要使用 If, Code, Jira, HttpRequest, StopAndError 等节点。 通过Git提交命令自动化GitHub PR和JIRA更新

前置要求
  • 可能需要目标 API 的认证凭证
  • GitHub Personal Access Token
工作流预览
可视化展示节点连接关系,支持缩放和平移
导出工作流
复制以下 JSON 配置到 n8n 导入,即可使用此工作流
{
  "id": "B9XHO1B8oUR04nOu",
  "meta": {
    "instanceId": "1a54c41d9050a8f1fa6f74ca858828ad9fb97b9fafa3e9760e576171c531a787",
    "templateCredsSetupCompleted": true
  },
  "name": "我的工作流19",
  "tags": [],
  "nodes": [
    {
      "id": "8465e817-4dec-4d5e-b607-6e46db16b6e7",
      "name": "提交消息分解",
      "type": "n8n-nodes-base.code",
      "position": [
        800,
        1160
      ],
      "parameters": {},
      "typeVersion": 2
    },
    {
      "id": "6046dbdd-8494-4e58-966d-83b8fdae1759",
      "name": "检查PR命令",
      "type": "n8n-nodes-base.if",
      "position": [
        1220,
        1160
      ],
      "parameters": {},
      "typeVersion": 2.2
    },
    {
      "id": "1d931b22-aaae-4afe-8f20-4478944eef1a",
      "name": "请求创建PR",
      "type": "n8n-nodes-base.httpRequest",
      "position": [
        2160,
        1000
      ],
      "parameters": {},
      "typeVersion": 4.2
    },
    {
      "id": "8d200a8c-de05-4bce-9150-88a34749b09a",
      "name": "Github触发器",
      "type": "n8n-nodes-base.githubTrigger",
      "position": [
        320,
        1160
      ],
      "webhookId": "a4b6341d-99ea-424c-afcc-35f320a7e2bf",
      "parameters": {},
      "typeVersion": 1
    },
    {
      "id": "9e61e558-fbf3-4cef-96f4-a6732ffd8373",
      "name": "无效的提交消息",
      "type": "n8n-nodes-base.stopAndError",
      "position": [
        2140,
        1760
      ],
      "parameters": {},
      "typeVersion": 1
    },
    {
      "id": "f3a3d76c-6713-407a-92a2-117a6cef4674",
      "name": "JIRA任务不存在",
      "type": "n8n-nodes-base.stopAndError",
      "position": [
        3080,
        1100
      ],
      "parameters": {},
      "typeVersion": 1
    },
    {
      "id": "45ffc321-9cf6-4d63-a303-5cbd9fcc9f5a",
      "name": "检查任务完成命令",
      "type": "n8n-nodes-base.if",
      "position": [
        1540,
        1400
      ],
      "parameters": {},
      "typeVersion": 2.2
    },
    {
      "id": "805644e9-e934-4e8e-8d2d-0a0340ae1313",
      "name": "获取PR的任务详情",
      "type": "n8n-nodes-base.jira",
      "position": [
        1720,
        780
      ],
      "parameters": {},
      "typeVersion": 1,
      "alwaysOutputData": false
    },
    {
      "id": "3588f1d5-d44c-429f-84d4-2d59b9df9d19",
      "name": "获取无PR的任务详情",
      "type": "n8n-nodes-base.jira",
      "position": [
        2160,
        1260
      ],
      "parameters": {},
      "typeVersion": 1
    },
    {
      "id": "37f80bcc-bdcd-440f-86a5-d71e7c6084fa",
      "name": "检查任务是否存在",
      "type": "n8n-nodes-base.if",
      "position": [
        2960,
        800
      ],
      "parameters": {},
      "typeVersion": 2.2
    },
    {
      "id": "5fa57725-9731-415a-b6c9-3468ba3cc294",
      "name": "PR后更新任务状态",
      "type": "n8n-nodes-base.jira",
      "position": [
        3380,
        780
      ],
      "parameters": {},
      "typeVersion": 1
    },
    {
      "id": "4d6f5d00-df3c-477b-b6e1-561502851cc8",
      "name": "检查PR是否已存在",
      "type": "n8n-nodes-base.if",
      "position": [
        2500,
        620
      ],
      "parameters": {},
      "typeVersion": 2.2
    },
    {
      "id": "e8c58c09-0d35-4928-867d-441f894bcd0d",
      "name": "无PR更新任务状态",
      "type": "n8n-nodes-base.jira",
      "position": [
        3080,
        1420
      ],
      "parameters": {},
      "typeVersion": 1
    },
    {
      "id": "d8c0c38a-fdd3-49c1-b566-bb35ecaa9f92",
      "name": "检查PR是否存在",
      "type": "n8n-nodes-base.httpRequest",
      "position": [
        2060,
        620
      ],
      "parameters": {},
      "typeVersion": 4.2,
      "alwaysOutputData": true
    },
    {
      "id": "67f8edcb-4647-4ee1-8fff-e25a0482528b",
      "name": "检查任务是否存在",
      "type": "n8n-nodes-base.if",
      "position": [
        2500,
        1140
      ],
      "parameters": {},
      "typeVersion": 2.2
    },
    {
      "id": "f9064e43-40d4-4d1d-aefa-ed15879831f2",
      "name": "便签",
      "type": "n8n-nodes-base.stickyNote",
      "position": [
        80,
        900
      ],
      "parameters": {
        "content": "Emelia 触发器"
      },
      "typeVersion": 1
    },
    {
      "id": "fe66429f-1fc9-4e06-9072-849c4c848a5e",
      "name": "便签1",
      "type": "n8n-nodes-base.stickyNote",
      "position": [
        540,
        1300
      ],
      "parameters": {
        "content": "Emelia 触发器"
      },
      "typeVersion": 1
    },
    {
      "id": "d2b4e8e4-1b05-4ee2-b14d-8084fed4f82c",
      "name": "便签2",
      "type": "n8n-nodes-base.stickyNote",
      "position": [
        980,
        820
      ],
      "parameters": {
        "content": "Emelia 触发器"
      },
      "typeVersion": 1
    },
    {
      "id": "b165e11c-5cfe-426f-997d-3a4df5cb0fe4",
      "name": "便签3",
      "type": "n8n-nodes-base.stickyNote",
      "position": [
        1280,
        1600
      ],
      "parameters": {
        "content": "Emelia 触发器"
      },
      "typeVersion": 1
    },
    {
      "id": "50536438-518e-431c-93a2-9d416b14d5a4",
      "name": "便签说明4",
      "type": "n8n-nodes-base.stickyNote",
      "position": [
        80,
        460
      ],
      "parameters": {
        "content": "Emelia 触发器"
      },
      "typeVersion": 1
    },
    {
      "id": "7e0eeb44-d1c8-430c-9fab-519662e898cd",
      "name": "便签 9",
      "type": "n8n-nodes-base.stickyNote",
      "position": [
        2380,
        1520
      ],
      "parameters": {
        "content": "Emelia 触发器"
      },
      "typeVersion": 1
    }
  ],
  "active": false,
  "pinData": {},
  "settings": {
    "executionOrder": "v1"
  },
  "versionId": "dd6e80c1-5de1-44b3-b946-54550b64e807",
  "connections": {
    "Github Trigger": {
      "main": [
        [
          {
            "node": "Commit Message Breakdown",
            "type": "main",
            "index": 0
          }
        ]
      ]
    },
    "Check if PR exists": {
      "main": [
        [
          {
            "node": "Check whether a PR already exists",
            "type": "main",
            "index": 0
          }
        ]
      ]
    },
    "Check if task exist": {
      "main": [
        [
          {
            "node": "Update task status after PR",
            "type": "main",
            "index": 0
          }
        ],
        [
          {
            "node": "JIRA Task does not exist",
            "type": "main",
            "index": 0
          }
        ]
      ]
    },
    "Check if task exists": {
      "main": [
        [
          {
            "node": "Update the task status without PR",
            "type": "main",
            "index": 0
          }
        ],
        [
          {
            "node": "JIRA Task does not exist",
            "type": "main",
            "index": 0
          }
        ]
      ]
    },
    "Request to create PR": {
      "main": [
        [
          {
            "node": "Check if task exist",
            "type": "main",
            "index": 0
          }
        ]
      ]
    },
    "Check for PR commands": {
      "main": [
        [
          {
            "node": "Get task details for PR",
            "type": "main",
            "index": 0
          }
        ],
        [
          {
            "node": "Check for task completed command",
            "type": "main",
            "index": 0
          }
        ]
      ]
    },
    "Get task details for PR": {
      "main": [
        [
          {
            "node": "Check if PR exists",
            "type": "main",
            "index": 0
          }
        ]
      ]
    },
    "Commit Message Breakdown": {
      "main": [
        [
          {
            "node": "Check for PR commands",
            "type": "main",
            "index": 0
          }
        ]
      ]
    },
    "Get Task Details without PR.": {
      "main": [
        [
          {
            "node": "Check if task exists",
            "type": "main",
            "index": 0
          }
        ]
      ]
    },
    "Check for task completed command": {
      "main": [
        [
          {
            "node": "Get Task Details without PR.",
            "type": "main",
            "index": 0
          }
        ],
        [
          {
            "node": "Invalid commit message",
            "type": "main",
            "index": 0
          }
        ]
      ]
    },
    "Check whether a PR already exists": {
      "main": [
        [
          {
            "node": "Check if task exist",
            "type": "main",
            "index": 0
          }
        ],
        [
          {
            "node": "Request to create PR",
            "type": "main",
            "index": 0
          }
        ]
      ]
    }
  }
}
常见问题

如何使用这个工作流?

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

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

高级 - 开发运维

需要付费吗?

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

工作流信息
难度等级
高级
节点数量21
分类1
节点类型7
难度说明

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

作者
Intuz

Intuz

@intuz

Workflow automation can help automate your routine activities and help saves $$$, as well as hours of time. As a boutique tech consulting company, Intuz help businesses with custom AI/ML, AI Workflow Automations, and software development. Automate your business workflow for: Sales Marketing Accounting Finance Operations E-Commerce Customer Support Admin & Backoffice Logistics & Supply Chain

外部链接
在 n8n.io 查看

分享此工作流