feat(server): implement workflow triggering and enhance script execution

- Added support for triggering workflows via a new triggerWorkflow function, allowing for fire-and-forget execution of workflows with optional data transformation using JSONata.
- Introduced a $workflows API in the script sandbox for accessing workflow triggers.
- Enhanced existing script execution functions to accommodate the new workflow triggering capabilities.
- Updated workflow-mermaid.js and WorkflowsPage to reflect the new workflow type in labels for better clarity.
This commit is contained in:
2026-08-14 22:12:34 +07:00
parent 3e4d5f443d
commit b8bbd56035
5 changed files with 303 additions and 35 deletions
+1
View File
@@ -47,6 +47,7 @@ function mermaidLabel(text) {
function triggerLabel(t) {
const type = String(t?.type ?? "").toLowerCase();
if (type === "cron") return `cron ${t.schedule ?? ""}`.trim();
if (type === "workflow") return "workflow";
const method = t?.method ?? "POST";
const path = t?.path ?? "";
return `${method} ${path}`.trim();