[PR #891] [MERGED] v0.4 workflow designer #1068

Closed
opened 2026-03-03 01:07:32 +03:00 by kerem · 0 comments
Owner

📋 Pull Request Information

Original PR: https://github.com/certimate-go/certimate/pull/891
Author: @fudiwei
Created: 7/25/2025
Status: Merged
Merged: 8/11/2025
Merged by: @fudiwei

Base: nextHead: dev


📝 Commits (10+)

  • c37cb4a refactor: clean code
  • bc268df feat(ui): new workflow routers
  • e20cf8f fix(ui): missing bgcolor
  • 7d63313 fix(ui): unsynchronized running status after WorkflowDetail subpage changed
  • 3308bcb dev
  • 2861a61 feat: support configuring node name on deployment to 1panel site
  • 85c3545 feat(ui): update workflow base info editor
  • cd68c49 chore(i18n): improve i18n
  • 396be6f refactor(ui): optimize stores
  • 344e9c7 refactor(ui): extract css

📊 Changes

231 files changed (+18231 additions, -1528 deletions)

View changed files

📝 internal/certificate/service.go (+3 -5)
📝 internal/domain/settings.go (+10 -0)
📝 internal/workflow/service.go (+3 -5)
ui/dist/.gitkeep (+0 -0)
📝 ui/package-lock.json (+1609 -260)
📝 ui/package.json (+19 -16)
📝 ui/src/App.tsx (+4 -0)
📝 ui/src/components/AppVersion.tsx (+4 -2)
📝 ui/src/components/CodeInput.tsx (+1 -1)
📝 ui/src/components/DrawerForm.tsx (+19 -3)
📝 ui/src/components/ModalForm.tsx (+1 -1)
📝 ui/src/components/MultipleInput.tsx (+4 -4)
📝 ui/src/components/MultipleSplitValueInput.tsx (+1 -1)
📝 ui/src/components/TextFileInput.tsx (+2 -2)
ui/src/components/Tips.tsx (+30 -0)
📝 ui/src/components/access/AccessEditDrawer.tsx (+21 -6)
📝 ui/src/components/access/AccessForm.tsx (+2 -6)
📝 ui/src/components/access/AccessFormDiscordBotConfig.tsx (+1 -1)
📝 ui/src/components/access/AccessFormSlackBotConfig.tsx (+1 -1)
📝 ui/src/components/access/AccessFormTelegramBotConfig.tsx (+2 -2)

...and 80 more files

📄 Description

该 PR 包含以下内容变更:

  • feat: 基于 flowgram.ai 实现新的工作流编辑器。
    • 已实现:
      • 画布渲染(暂时只读,仅将 v0.3.x 节点做了一层转换);
      • 自由拖拽及缩放,关闭 #814;
      • 小地图;
      • 移动节点顺序;
      • 新版节点配置抽屉 UI。
    • 待实现:
      • 节点禁用;
      • 新的节点类型:迭代循环;
      • 后端适配及数据库 migration。

备注

1. 新旧工作流节点类型映射关系:

👀 展开查看

flowgram.ai 内置了一些节点类型与旧版编辑器节点类型冲突,需做如下转换:

  • startstart
  • endend
  • branchcondition
  • conditionbranchBlock
  • execute_result_branchtryCatch
  • execute_successtryBlock
  • execute_failurecatchBlock
  • applybizApply
  • uploadbizUpload
  • monitorbizMonitor
  • deploybizDeploy
  • notifybizNotify

(为避免自定义的业务节点与后续 flowgram.ai 迭代时可能新增的节点类型冲突,此类节点类型统一增加前缀 biz

2. 关于 TryCatch 节点

👀 展开查看

v0.3.x 中的 execute_result_branch 节点存在两个缺陷:

  • 问题一:只能针对最近的上一个节点判断执行成功与否,但如果包含多个业务节点时需要复杂的编排。

例如,若存在 “申请” → “部署到 A” → “部署到 B” 这样的业务流程,若希望任一流程失败后均能发送消息通知,则需要:

graph TD
  A(["申请"])
  A --> B1{"成功"}
  A --> B2{"失败"}
  B1 --> C["部署到 A"]
  B2 --> D["通知"]
  C --> E1{"成功"}
  C --> E2{"失败"}
  E1 --> F["部署到 B"]
  E2 --> G["通知"]
  F --> H1["成功"]
  F --> H2["失败"]
  H1 --> I["End"]
  H2 --> J["通知"]
  • 问题二:进入 execute_failure 会隐式中断工作流(见 #641)。

新的 TryCatch 节点旨在解决上述两个问题。

对于问题一,新的编排方案为

graph TD
  A(["Try"])
  A --> B["申请"]
  B --> C["部署到 A"]
  C --> D["部署到 B"]
  D --> E["End"]
  A --> F{"Catch"}
  F --> G["通知"]

对于问题二,新引入 end 类型节点,如需在执行失败时中断,可以显式添加此节点,否则会继续执行 tryCatch 之后的节点。行为类似某些编程语言中的 try-catch-finally 的异常处理流程。


🔄 This issue represents a GitHub Pull Request. It cannot be merged through Gitea due to API limitations.

## 📋 Pull Request Information **Original PR:** https://github.com/certimate-go/certimate/pull/891 **Author:** [@fudiwei](https://github.com/fudiwei) **Created:** 7/25/2025 **Status:** ✅ Merged **Merged:** 8/11/2025 **Merged by:** [@fudiwei](https://github.com/fudiwei) **Base:** `next` ← **Head:** `dev` --- ### 📝 Commits (10+) - [`c37cb4a`](https://github.com/certimate-go/certimate/commit/c37cb4afbac5adcaaaa34cb3b5f0664bfffee357) refactor: clean code - [`bc268df`](https://github.com/certimate-go/certimate/commit/bc268dfb325af7211773b3a00559e453e3d5644c) feat(ui): new workflow routers - [`e20cf8f`](https://github.com/certimate-go/certimate/commit/e20cf8fad320f5b871f06ffffe4f0e74887433c5) fix(ui): missing bgcolor - [`7d63313`](https://github.com/certimate-go/certimate/commit/7d633135bcd6a0db0d6d1b0e6d222b7931e322ee) fix(ui): unsynchronized running status after WorkflowDetail subpage changed - [`3308bcb`](https://github.com/certimate-go/certimate/commit/3308bcb01dc56f5b63c855e781cb68fa4af35654) dev - [`2861a61`](https://github.com/certimate-go/certimate/commit/2861a61df479405b26e889c5970bdac858825d60) feat: support configuring node name on deployment to 1panel site - [`85c3545`](https://github.com/certimate-go/certimate/commit/85c354586816b29d35c660001ed1037db5d3c6a3) feat(ui): update workflow base info editor - [`cd68c49`](https://github.com/certimate-go/certimate/commit/cd68c49a4b9f5b00f46a1a9ce50aa4d563f14289) chore(i18n): improve i18n - [`396be6f`](https://github.com/certimate-go/certimate/commit/396be6f9d58a43370bbe1fba9717f5a31e23eaab) refactor(ui): optimize stores - [`344e9c7`](https://github.com/certimate-go/certimate/commit/344e9c719e48fca3dc7badab35c98bd63799c7ab) refactor(ui): extract css ### 📊 Changes **231 files changed** (+18231 additions, -1528 deletions) <details> <summary>View changed files</summary> 📝 `internal/certificate/service.go` (+3 -5) 📝 `internal/domain/settings.go` (+10 -0) 📝 `internal/workflow/service.go` (+3 -5) ➖ `ui/dist/.gitkeep` (+0 -0) 📝 `ui/package-lock.json` (+1609 -260) 📝 `ui/package.json` (+19 -16) 📝 `ui/src/App.tsx` (+4 -0) 📝 `ui/src/components/AppVersion.tsx` (+4 -2) 📝 `ui/src/components/CodeInput.tsx` (+1 -1) 📝 `ui/src/components/DrawerForm.tsx` (+19 -3) 📝 `ui/src/components/ModalForm.tsx` (+1 -1) 📝 `ui/src/components/MultipleInput.tsx` (+4 -4) 📝 `ui/src/components/MultipleSplitValueInput.tsx` (+1 -1) 📝 `ui/src/components/TextFileInput.tsx` (+2 -2) ➕ `ui/src/components/Tips.tsx` (+30 -0) 📝 `ui/src/components/access/AccessEditDrawer.tsx` (+21 -6) 📝 `ui/src/components/access/AccessForm.tsx` (+2 -6) 📝 `ui/src/components/access/AccessFormDiscordBotConfig.tsx` (+1 -1) 📝 `ui/src/components/access/AccessFormSlackBotConfig.tsx` (+1 -1) 📝 `ui/src/components/access/AccessFormTelegramBotConfig.tsx` (+2 -2) _...and 80 more files_ </details> ### 📄 Description 该 PR 包含以下内容变更: - **feat**: 基于 flowgram.ai 实现新的工作流编辑器。 - 已实现: - 画布渲染(暂时只读,仅将 v0.3.x 节点做了一层转换); - 自由拖拽及缩放,关闭 #814; - 小地图; - 移动节点顺序; - 新版节点配置抽屉 UI。 - 待实现: - 节点禁用; - 新的节点类型:迭代循环; - 后端适配及数据库 migration。 --- ### 备注 #### 1. 新旧工作流节点类型映射关系: <details> <summary>👀 展开查看</summary> flowgram.ai 内置了一些节点类型与旧版编辑器节点类型冲突,需做如下转换: - `start` → `start` - `end` → `end` - `branch` → `condition` - `condition` → `branchBlock` - `execute_result_branch` → `tryCatch` - `execute_success` → `tryBlock` - `execute_failure` → `catchBlock` - `apply` → `bizApply` - `upload` → `bizUpload` - `monitor` → `bizMonitor` - `deploy` → `bizDeploy` - `notify` → `bizNotify` (为避免自定义的业务节点与后续 flowgram.ai 迭代时可能新增的节点类型冲突,此类节点类型统一增加前缀 `biz`) </details> #### 2. 关于 TryCatch 节点 <details> <summary>👀 展开查看</summary> v0.3.x 中的 `execute_result_branch` 节点存在两个缺陷: - 问题一:只能针对最近的上一个节点判断执行成功与否,但如果包含多个业务节点时需要复杂的编排。 例如,若存在 “申请” → “部署到 A” → “部署到 B” 这样的业务流程,若希望任一流程失败后均能发送消息通知,则需要: ```mermaid graph TD A(["申请"]) A --> B1{"成功"} A --> B2{"失败"} B1 --> C["部署到 A"] B2 --> D["通知"] C --> E1{"成功"} C --> E2{"失败"} E1 --> F["部署到 B"] E2 --> G["通知"] F --> H1["成功"] F --> H2["失败"] H1 --> I["End"] H2 --> J["通知"] ``` - 问题二:进入 `execute_failure` 会隐式中断工作流(见 #641)。 新的 `TryCatch` 节点旨在解决上述两个问题。 对于问题一,新的编排方案为 ```mermaid graph TD A(["Try"]) A --> B["申请"] B --> C["部署到 A"] C --> D["部署到 B"] D --> E["End"] A --> F{"Catch"} F --> G["通知"] ``` 对于问题二,新引入 `end` 类型节点,如需在执行失败时中断,可以显式添加此节点,否则会继续执行 `tryCatch` 之后的节点。行为类似某些编程语言中的 `try-catch-finally` 的异常处理流程。 </details> --- <sub>🔄 This issue represents a GitHub Pull Request. It cannot be merged through Gitea due to API limitations.</sub>
kerem 2026-03-03 01:07:32 +03:00
Sign in to join this conversation.
No milestone
No project
No assignees
1 participant
Notifications
Due date
The due date is invalid or out of range. Please use the format "yyyy-mm-dd".

No due date set.

Dependencies

No dependencies set.

Reference
starred/certimate#1068
No description provided.