feat(workflow): 准确识别工作流延时执行与在途运行状态并补全节点字典

This commit is contained in:
gitea committed 2026-10-21 17:21:35 +08:00
1 parent 36a4d3b27b
commit aea30fbcd5
15 files changed
+615 -78

No files matched your search

+32 -2
View File
@@ -88,9 +88,39 @@ export async function handleWorkflowTest(
}
case "WEBHOOK": {
// 分支 B: Webhook / 外部事件触发器 ── 支持 sample / body / file / empty
// 分支 B: Webhook / 外部事件触发器 ── 支持 flow/bill / sample / body / file / empty
targetId = "";
if (rawBody) {
if (flowCodeOrId && !rawBody && !filePath) {
try {
const { getBillByCodeOrId } = await import("../../../domains/bill/tools.js");
const { createSessionClient } = await import("../../../core/http/index.js");
const sessionClient = await createSessionClient(runtime.selectedCorp!);
const corpId = runtime.selectedCorp?.corpId || runtime.selectedCorp?.id || "";
const bills = await getBillByCodeOrId(sessionClient, corpId, flowCodeOrId);
const bill = bills[0];
if (bill) {
customPayload = {
code: bill.billCode,
flowId: bill.billId,
title: bill.title,
data: bill,
corporationId: corpId,
};
} else {
customPayload = {
code: flowCodeOrId,
flowId: flowCodeOrId,
corporationId: corpId,
};
}
} catch {
customPayload = {
code: flowCodeOrId,
flowId: flowCodeOrId,
corporationId: runtime.selectedCorp?.corpId || runtime.selectedCorp?.id,
};
}
} else if (rawBody) {
try {
customPayload = JSON.parse(rawBody);
} catch (e: any) {