Windmillワークフロー開発環境の構築結果まとめ。サーバー接続確認、REST APIヘルパースクリプト作成、ワークフロー定義ファイル作成、wmill CLI制限の発見と代替策の実装を記録。
This commit is contained in:
53
.agent/workflows/windmill-new-script.md
Normal file
53
.agent/workflows/windmill-new-script.md
Normal file
@@ -0,0 +1,53 @@
|
||||
---
|
||||
description: 新しいWindmillスクリプトを作成する
|
||||
---
|
||||
|
||||
# 新しいWindmillスクリプトの作成
|
||||
|
||||
Windmillに新しいスクリプトを追加する手順。
|
||||
|
||||
## 手順
|
||||
|
||||
1. **スクリプトファイルの作成**: スクリプトは以下のディレクトリ構造に従って作成する
|
||||
- ユーザースクリプト: `u/<username>/<script_name>/`
|
||||
- フォルダスクリプト: `f/<folder_name>/<script_name>/`
|
||||
|
||||
2. **ファイル構成**: 各スクリプトフォルダには以下のファイルが必要
|
||||
- `script.yaml` — メタデータ(言語、概要、スキーマなど)
|
||||
- スクリプト本体(例: `script.py`, `script.ts`, `script.sh`)
|
||||
|
||||
3. **script.yaml のテンプレート**
|
||||
```yaml
|
||||
summary: '<スクリプトの説明>'
|
||||
description: '<詳細な説明>'
|
||||
lock: []
|
||||
schema:
|
||||
$schema: 'https://json-schema.org/draft/2020-12/schema'
|
||||
type: object
|
||||
properties:
|
||||
param1:
|
||||
type: string
|
||||
description: '<パラメータの説明>'
|
||||
required:
|
||||
- param1
|
||||
kind: script
|
||||
tag: ''
|
||||
```
|
||||
|
||||
4. **Pythonスクリプト (`script.py`) のテンプレート**
|
||||
```python
|
||||
def main(param1: str):
|
||||
"""
|
||||
スクリプトの説明
|
||||
"""
|
||||
return {"result": f"Hello, {param1}!"}
|
||||
```
|
||||
|
||||
5. **TypeScriptスクリプト (`script.ts`) のテンプレート**
|
||||
```typescript
|
||||
export async function main(param1: string): Promise<any> {
|
||||
return { result: `Hello, ${param1}!` };
|
||||
}
|
||||
```
|
||||
|
||||
6. **サーバーに反映**: `/windmill-push` ワークフローを実行してpush
|
||||
Reference in New Issue
Block a user