Files
dify-docs/ja-jp/guides/workflow/node/schedule-trigger.mdx
Riskey 53c4c93b1e add docs for trigger (#504)
* draft

* draft

* draft

* refine dev docs

* almost

* update

* remove sys.file and sys.query; add sys.timestamp

* update the end node to output

* modify the introduction section of variable

* fix typo

* adjust image size

* remove unnecessary list

* feedback fix

* remove example

* feedback fix & add en/ja dev docs

* correct description

* fix typos

* replace UI text

* refinements & add zh-ja translation

* feedback fixes

* fix punctuation

* refine heading-reference

* typo

* adjust casing & remove sys.timestamp from chatflow

* Docs tools: 2 succeeded, some failed

Rename operation failed: - Lang 'zh': File 'dify-docs/plugin-dev-zh/0211-getting-started-dify-tool.mdx' - Renaming error: Unexpected error: 'str' object has no attribute 'get'
- Lang 'zh': File 'dify-docs/plugin-dev-zh/0222-datasource-plugin.mdx' - Skipped (non-compliant):
Missing/empty critical frontmatter fields for renaming: dimensions.type.primary, dimensions.type.detail, dimensions.level, standard_title, language (expected for metadata, though not used in filename suffix anymore).
- Lang 'zh': File 'dify-docs/plugin-dev-zh/0222-tool-oauth.mdx' - Skipped (non-compliant):
Missing/empty critical frontmatter fields for renaming: dimensions.type.primary, dimensions.type.detail, dimensions.level, standard_title, language (expected for metadata, though not used in filename suffix anymore).
- Lang 'zh': File 'dify-docs/plugin-dev-zh/0222-trigger-plugin.mdx' - Skipped (non-compliant):
Missing/empty critical frontmatter fields for renaming: dimensions.type.primary, dimensions.type.detail, dimensions.level, standard_title, language (expected for metadata, though not used in filename suffix anymore).
- Lang 'en': File 'dify-docs/plugin-dev-en/0211-getting-started-dify-tool.mdx' - Renaming error: Unexpected error: 'str' object has no attribute 'get'
- Lang 'en': File 'dify-docs/plugin-dev-en/0222-datasource-plugin.mdx' - Skipped (non-compliant):
Missing/empty critical frontmatter fields for renaming: dimensions.type.primary, dimensions.type.detail, dimensions.level, standard_title, language (expected for metadata, though not used in filename suffix anymore).
- Lang 'en': File 'dify-docs/plugin-dev-en/0222-tool-oauth.mdx' - Skipped (non-compliant):
Missing/empty critical frontmatter fields for renaming: dimensions.type.primary, dimensions.type.detail, dimensions.level, standard_title, language (expected for metadata, though not used in filename suffix anymore).
- Lang 'en': File 'dify-docs/plugin-dev-en/0222-trigger-plugin.mdx' - Skipped (non-compliant):
Missing/empty critical frontmatter fields for renaming: dimensions.type.primary, dimensions.type.detail, dimensions.level, standard_title, language (expected for metadata, though not used in filename suffix anymore).
- Lang 'ja': File 'dify-docs/plugin-dev-ja/0211-getting-started-dify-tool.mdx' - Renaming error: Unexpected error: 'str' object has no attribute 'get'
- Lang 'ja': File 'dify-docs/plugin-dev-ja/0222-datasource-plugin.mdx' - Skipped (non-compliant):
Missing/empty critical frontmatter fields for renaming: dimensions.type.primary, dimensions.type.detail, dimensions.level, standard_title, language (expected for metadata, though not used in filename suffix anymore).
- Lang 'ja': File 'dify-docs/plugin-dev-ja/0222-trigger-plugin.mdx' - Skipped (non-compliant):
Missing/empty critical frontmatter fields for renaming: dimensions.type.primary, dimensions.type.detail, dimensions.level, standard_title, language (expected for metadata, though not used in filename suffix anymore).

---------

Co-authored-by: Riskey <riskey47@dify.ai>
Co-authored-by: alterxyz <88554920+alterxyz@users.noreply.github.com>
2025-10-30 21:11:33 +08:00

116 lines
6.5 KiB
Plaintext

---
title: スケジュールトリガー
---
## 概要
<Info>
トリガーは workflow アプリケーションでのみ利用可能です。
</Info>
スケジュールトリガーを使用すると、指定した時刻または間隔で workflow を実行できます。これは、日次レポートの生成やスケジュールされた通知の送信など、繰り返し発生するタスクに最適です。
## スケジュールトリガーの追加
workflow キャンバスで右クリックし、**ブロックを追加** > **始める** > **スケジュールトリガー** を選択します。
<Tip>
1 つの workflow は、並行して実行される複数のスケジュールトリガーで開始できます。並行分岐に同一の連続したノードが含まれている場合、共通セクションの前に[変数集約](/ja-jp/guides/workflow/node/variable-aggregator)ノードを追加して分岐をマージできます。これにより、各分岐で同じノードを個別に重複して追加することを回避できます。
</Tip>
## スケジュールトリガーの設定
トリガーのスケジュールは、デフォルトのビジュアル設定または Cron 式を使用して設定できます。
設定後、次の 5 回のスケジュール実行時刻を確認できます。
<Info>
スケジュールトリガーは出力変数を生成しませんが、workflow をトリガーするたびにシステム変数 `sys.timestamp`(各 workflow 実行の開始時刻)を更新します。
</Info>
### ビジュアル設定を使用
単純な毎時、毎日、毎週、または毎月のスケジュールに使用します。毎週および毎月の頻度では、複数の曜日や日付を選択できます。
### Cron 式を使用
平日の午前 9 時から午後 5 時まで 15 分ごと、といったより複雑で正確なタイミングパターンに使用します。
<Tip>
LLM を使用して Cron 式を生成できます。
</Tip>
#### 標準フォーマット
Cron 式は、workflow の実行スケジュールを定義する文字列です。スペースで区切られた 5 つのフィールドで構成され、それぞれが異なる時間単位を表します。
<Note>
各フィールド間に 1 つのスペースがあることを確認してください。
</Note>
```
* * * * *
| | | | |
| | | | |── 曜日 (0-7 または SUN-SAT、0 と 7 は両方とも日曜日)
| | | |──── 月 (1-12 または JAN-DEC)
| | |────── 日 (1-31)
| |──────── 時間 (0-23)
|────────── 分 (0-59)
```
<Info>
**日**と**曜日**の両方のフィールドが指定されている場合、トリガーは*どちらか*のフィールドに一致する日付でアクティブになります。
例えば、`1 2 3 4 4` は、4 月 3 日*および* 4 月の毎週木曜日に workflow をトリガーします。4 月 3 日が木曜日である場合に限定されません。
</Info>
#### 特殊文字
| <div style={{width: '50px'}}>文字</div> | 説明 | 例 |
|:-----------|:-------------|:---------|
| `*` | 「毎」を意味します。 | **時間**フィールドの `*` は「毎時」を意味します。 |
| `,` | 複数の値を区切ります。 | **曜日**フィールドの `1,3,5` は「月曜日、水曜日、金曜日」を意味します。 |
| `-` | 値の範囲を定義します。 | **時間**フィールドの `9-17` は「午前 9 時から午後 5 時まで」を意味します。 |
| `/` | ステップ値を指定します。 | **分**フィールドの `*/15` は「15 分ごと」を意味します。 |
| `L` | 「最後」を意味します。<br /><br />**日**フィールドでは、「その月の最終日」を意味します。<br /><br />**曜日**フィールドでは:<ul><li>単独で使用すると、「週の最終日」を意味します。</li><li>数字と組み合わせると、「その月の最後の指定された曜日」を意味します。</li></ul>| **日**フィールドの `L` は「1 月 31 日、4 月 30 日、または閏年でない年の 2 月 28 日」を意味します。<br /><br />**曜日**フィールドの `L` は日曜日を意味します。<br /><br />**曜日**フィールドの `5L` は「その月の最後の金曜日」を意味します。 |
| `?` | 「任意」または「特定の値なし」を意味します。<br /><br />**曜日**フィールドに値を指定した場合、**日**フィールドを無視するために `?` を使用できます。逆も同様です。<br /><br />必須ではありません。`*` も同様に機能するためです。 | 毎週月曜日にタスクを実行するには、**日**フィールドを `*` の代わりに `?` に設定する方がより正確です。 |
#### 定義済み表現
- `@yearly`:年に一度、1 月 1 日の午前 0 時に実行。
- `@monthly`:月に一度、月の初日の午前 0 時に実行。
- `@weekly`:週に一度、日曜日の午前 0 時に実行。
- `@daily`:日に一度、午前 0 時に実行。
- `@hourly`:毎正時に実行。
#### 例
| スケジュール | Cron 式 |
|:----------|:-----------------|
| 平日の午前 9 時 | `0 9 * * MON-FRI` または `0 9 * * 1-5` |
| 毎週水曜日の午後 2 時 30 分 | `30 14 * * WED` |
| 毎週日曜日の午前 0 時 | `0 0 * * 0` |
| 毎週火曜日の 2 時間ごと | `0 */2 * * 2` |
| 毎月初日の午前 0 時 | `0 0 1 * *` |
| 1 月 1 日と 6 月 1 日の午後 12 時 | `0 12 1 JAN,JUN *` |
| 毎月最終日の午後 5 時 | `0 17 L * *` |
| 毎月最終金曜日の午後 10 時 | `0 22 * * 5L` |
## スケジュールトリガーのテスト
スケジュールトリガーをテストする場合(**このステップ実行**をクリックするか、workflow のテスト実行で選択するかにかかわらず)、トリガーは設定されたスケジュールを無視して即座に実行されます。
ただし、**テスト実行** > **すべてのトリガーを実行**をクリックして workflow のすべてのトリガーを同時にテストする場合、スケジュールトリガーは即座に実行されるのではなく、次のスケジュールされた実行時刻を待ちます。
{/*
Contributing Section
DO NOT edit this section!
It will be automatically generated by the script.
*/}
---
[このページを編集する](https://github.com/langgenius/dify-docs/edit/main/ja-jp/guides/workflow/node/schedule-trigger.mdx) | [問題を報告する](https://github.com/langgenius/dify-docs/issues/new?template=docs.yml)