feat: improve workflow node configuration

This commit is contained in:
Fu Diwei
2025-01-06 23:46:14 +08:00
parent 155371cdd0
commit 84c36a4eec
70 changed files with 1799 additions and 875 deletions

View File

@@ -45,7 +45,7 @@ type WorkflowNode struct {
Type WorkflowNodeType `json:"type"`
Name string `json:"name"`
Config map[string]any `json:"data"`
Config map[string]any `json:"config"`
Inputs []WorkflowNodeIO `json:"inputs"`
Outputs []WorkflowNodeIO `json:"outputs"`
@@ -71,6 +71,16 @@ func (n *WorkflowNode) GetConfigInt64(key string) int64 {
return maps.GetValueAsInt64(n.Config, key)
}
func (n *WorkflowNode) GetConfigMap(key string) map[string]any {
if val, ok := n.Config[key]; ok {
if result, ok := val.(map[string]any); ok {
return result
}
}
return make(map[string]any)
}
type WorkflowNodeIO struct {
Label string `json:"label"`
Name string `json:"name"`