Workflows
Last updated on September 15, 2026
注釈:本資料はAI技術を用いて翻訳されています。
概要
ワークフローは、型付き入力、順序付きステップ、明示的なステップ依存関係を持つ YAML ファイルです。あるステップが生成した値は、参照によって次のステップに渡されます。変更が適用される前に、ドライランモードでワークフローを実行して、すべての呼び出しとその入力を確認できます。
組み込みワークフロー
AGS CLI には、よく使われるタスク向けに 5 つの組み込みワークフローが含まれています。
| ワークフロー ID | ags workflow list での名前 | 実行内容 |
|---|---|---|
competitive-multiplayer | Set up competitive multiplayer | AccelByte Multiplayer Servers (AMS) がホストする専用サーバーを使用し、レーティングスタットでプレイヤーを組み合わせるスキルベースのマッチメイキングをセットアップします。 |
player-overview | Investigate a player | 1 人のプレイヤーについて、AGS の各サービスにまたがる読み取り専用の概要を収集します。 |
in-game-store | Create an in-game store | 仮想通貨で価格を設定したゲーム内ストアを作成し、公開します。 |
season-pass | Create a season pass | 既存のドラフトストアに、無料トラックとプレミアムトラック、アイテム報酬、ティアを備えたシーズンパスを作成し、公開します。 |
docker-login | Docker registry login | Extend アプリのコンテナレジストリの認証情報を取得し、ローカルの Docker CLI をそのレジストリにサインインさせます。 |
ワークフローの作成
スターターテンプレートの生成
ags workflow template
編集可能なスターター YAML ファイルを出力します。このファイルには、ags workflow add で必須の workflow_protocol_version があらかじめ宣言されています。
追加前のバリデーション
ags workflow add <file> --validate-only
ファイルを追加せずに、スキーマエラーや不足している入力を確認します。
バリデーション済みワークフローの追加
ags workflow add <file>
ドライランモードでの実行
ags workflow run <id> --dry-run
変更は適用されません。CLI はすべてのステップ、そのコマンド、解決済みの入力を出力するので、コミットする前に計画を確認できます。
ワークフローの削除
ags workflow remove <id>
ags workflow add で追加したワークフローを削除します。組み込みワークフローは削除できません。
例: シーズナルリーダーボード
この例では、2 つのサービスにわたる 3 つの順序付き管理者呼び出しを使用して、シーズナルリーダーボードをセットアップします。
- スタットサイクルを作成します。 これによりリセットスケジュールが定義されます。AGS はステップ 2 と 3 の両方が使用するサイクル ID を返します。
- スタットを作成します。 これはリーダーボードがプレイヤーをランク付けする値です。ステップ 1 のサイクル ID を使用して、スタットをリセットスケジュールに紐付けます。
- リーダーボードを作成します。 これはステップ 2 のスタットでプレイヤーをランク付けし、同じサイクルにスコープされます。ステップ 1 のサイクル ID とステップ 2 のスタットを入力として使用します。
完全なワークフローファイル
id: seasonal-leaderboard
name: Set up a seasonal leaderboard
workflow_protocol_version: "1.0.0"
intent: leaderboard stat cycle seasonal reset ranking social
description: >-
Set up a leaderboard that resets every season: a stat cycle, a stat
tied to that cycle, and a leaderboard scoped to the same cycle.
briefing:
overview: >-
This workflow sets up a seasonal leaderboard, such as "Most Matches Won
This Season", instead of an all-time ranking.
Doing this manually takes three ordered admin API calls across two
services, Stats and Leaderboard. The id returned by the first call has
to be passed into the other two. This workflow creates all three
resources and passes that id along.
prerequisites:
- >-
**A namespace** already created. Everything this workflow creates
lives inside that namespace.
- >-
**Admin credentials** with permission to create resources in
`social` and `leaderboard`. The workflow uses your current `ags`
login session.
creates:
- "**A seasonal stat cycle.** Defines the reset schedule used below."
- "**A stat.** The value the leaderboard ranks players by, tied to that cycle."
- "**A leaderboard.** Ranked by that stat and scoped to the same cycle."
is_reviewed_by_default: true
inputs:
- name: namespace
description: >-
Your game's AccelByte namespace. This is the same value used by the
global --namespace flag.
required: true
schema: {type: string}
- name: leaderboardCode
description: >-
Unique code for the leaderboard, lowercase and up to 48 characters.
Also used as its display name.
required: true
schema: {type: string}
- name: statCode
description: >-
Unique code for the stat the leaderboard ranks players by, for
example matches won this season. Also used as its display name.
required: true
schema: {type: string}
steps:
- id: create-stat-cycle
description: >-
Creates the seasonal reset schedule. The stat and leaderboard below
both use the id returned by this step.
operation: {service: social, operation: social/admin/stat-cycles/v1/create}
inputs:
- {field: namespace, source: {from: "workflow/namespace"}}
- {field: cycleType, source: {const: "SEASONAL"}, show_in_review: true}
- {field: name, source: {const: "Seasonal Reset"}, show_in_review: true}
- {field: resetTime, source: {const: "00:00"}, show_in_review: true}
- {field: start, source: {const: "2025-01-01T00:00:00Z"}, show_in_review: true}
- {field: seasonPeriod, source: {const: 90}, show_in_review: true, description: "Season length in days"}
outputs:
- {name: cycleId, source: responseBody, path: "$.id"}
- id: create-stat
description: >-
Creates the stat the leaderboard ranks players by, tied to the
seasonal cycle above so it resets at the same time.
dependencies: [create-stat-cycle]
operation: {service: social, operation: social/admin/stat-definitions/v1/create}
inputs:
- {field: namespace, source: {from: "workflow/namespace"}}
- {field: statCode, source: {from: "workflow/statCode"}}
- {field: name, source: {from: "workflow/statCode"}, show_in_review: true}
- {field: defaultValue, source: {const: 0}, show_in_review: true}
- {field: setBy, source: {const: "SERVER"}}
- {field: "cycleIds[0]", source: {from: "step/create-stat-cycle", output: cycleId}}
- id: create-leaderboard
description: >-
Creates the leaderboard, ranked by the stat above and scoped to the
same seasonal cycle.
dependencies: [create-stat-cycle, create-stat]
operation: {service: leaderboard, operation: leaderboard/admin/leaderboards/v3/create}
inputs:
- {field: namespace, source: {from: "workflow/namespace"}}
- {field: leaderboardCode, source: {from: "workflow/leaderboardCode"}}
- {field: name, source: {from: "workflow/leaderboardCode"}, show_in_review: true}
- {field: statCode, source: {from: "workflow/statCode"}}
- {field: descending, source: {const: true}, show_in_review: true}
- {field: allTime, source: {const: false}, show_in_review: true}
- {field: "cycleIds[0]", source: {from: "step/create-stat-cycle", output: cycleId}}
completion:
created:
- {label: "Stat cycle", value: "Seasonal Reset"}
- {label: "Stat", value: "{statCode}"}
- {label: "Leaderboard", value: "{leaderboardCode}"}
next_steps:
- {description: "Inspect the leaderboard", command: "ags leaderboard leaderboards get --namespace {namespace} --leaderboard-code {leaderboardCode}"}
- {description: "Review the stat", command: "ags social stat-definitions get --namespace {namespace} --stat-code {statCode}"}
- {description: "List your stat cycles", command: "ags social stat-cycles list --namespace {namespace}"}
ファイルに示された入力でこれを実行します。例: ags workflow run seasonal-leaderboard --namespace <your-namespace> --leaderboard-code weekly-wins --stat-code matches-won-season。