Code Execution Node
执行自定义函数代码的节点。
配置字段
| 字段 | 类型 | 说明 |
|---|---|---|
runtime | string | 运行时 |
code | string | 代码 |
entryPoint | string | 入口函数 |
dependencies | List<string> | 依赖列表 |
timeout | Integer | 超时时间(毫秒) |
memory | Integer | 内存限制(MB) |
示例
- id: calc_score
name: 计算评分
type: CODE_EXECUTION
config:
_nodeConfigType: CODE_EXECUTION
runtime: python3.11
entryPoint: main
code: |
def main(ctx):
return {"score": ctx["amount"] * 0.1}
timeout: 30000
memory: 256