docs: complete workflow.yaml quick reference

This commit is contained in:
2026-07-15 15:20:27 +00:00
parent 89253741cb
commit 79fce5659c
+27 -7
View File
@@ -15,25 +15,45 @@
## Workflow.yaml 核心规则 ## Workflow.yaml 核心规则
### 步骤定义 ### 完整结构
```yaml ```yaml
name: 套件名称
description: 功能描述
version: 1.0.0
author: 作者
tags: [标签1]
category: 业务分类
params:
input_path:
type: string
required: true
desc: 输入文件路径
base_image: gis-base:latest
steps: steps:
- id: my-step - id: step1
name: 我的步骤 name: 步骤1
script_id: run # ✅ script_id 优先 script_id: run
params: params:
input: $params.input_path # ✅ 使用 $params.xxx input: $params.input_path
``` ```
### 引用语法
| 语法 | 说明 | 示例 |
|------|------|------|
| `$params.xxx` | 引用套件输入参数 | `$params.input_path` |
| `$steps.step_id.output_name` | 引用前一步骤输出 | `$steps.step1.result_path` |
### 常见错误 ### 常见错误
| ❌ 错误 | ✅ 正确 | | ❌ 错误 | ✅ 正确 |
|---------|--------| |---------|--------|
| `script: run.py` | `script_id: run` | | `script: run.py` | `script_id: run` |
| `script: run` | `script_id: run` |
| `params_mapping: {...}` | `params: {...}` | | `params_mapping: {...}` | `params: {...}` |
| `$params.xxx` | `$params.xxx` |
| `$inputs.xxx` | `$params.xxx` | | `$inputs.xxx` | `$params.xxx` |
### 跨步骤文件共享 ### 跨步骤文件共享