Cron ジョブ
Gateway スケジューラの cron ジョブと wake。
Tutorial.alert.info
Cron はゲートウェイの組み込みスケジューラです。ジョブを保持し、エージェントを起動します
正しい時間に、オプションで出力をチャットにパイプバックできます。
_"毎朝これを実行する"_や_"20分後にエージェントをポークする"_が必要な場合、
cron はメカニズムです。
The long and short; TL;DR
- Cron は<strong>ゲートウェイ内</strong>で実行されます(モデル内ではありません)。
- ジョブは '<code className="bg-white/10 px-1.5 py-0.5 rounded text-emerald-300 text-sm">'~/.openclaw/cron/'</code>' の下で永続化されるため、再起動してもスケジュールは失われません。
- 2つの実行モード:
- <strong>メインセッション</strong>:システムイベントをキューに入れ、次のハートビートで実行します。
- '<strong>'Isolated'</strong>': runs a dedicated agent turn in '<code className="bg-white/10 px-1.5 py-0.5 rounded text-emerald-300 text-sm">'cron:<jobId>'</code>', optionally delivering output.
- Wake はファーストクラスです:ジョブは「今すぐ起動」または「次のハートビート」をリクエストできます。
クイックスタート(アクション可能)
ワンタイムリマインダーを作成し、存在を確認し、すぐに実行します:
openclaw cron add --name "Reminder" --at "2026-02-01T16:00:00Z" --session main --system-event "Reminder: check the cron docs draft" --wake now --delete-after-run openclaw cron list openclaw cron run <job-id> --force openclaw cron runs --id <job-id>
繰り返される分離ジョブを配信付きでスケジュールします:
openclaw cron add --name "Morning brief" --cron "0 7 * * *" --tz "America/Los_Angeles" --session isolated --message "Summarize overnight updates." --deliver --channel slack --to "channel:C1234567890"
ツール呼び出し相当(ゲートウェイ cron ツール)
正規の JSON 形状と例については、'<a href="/automation/cron-jobs#json-schema-for-tool-calls" className="text-emerald-400 hover:text-emerald-300 transition-colors">'ツール呼び出しの JSON スキーマ'</a>' を参照してください。
cron ジョブの保存場所
デフォルトでは、cron ジョブは '<code className="bg-white/10 px-1.5 py-0.5 rounded text-emerald-300 text-sm">'~/.openclaw/cron/jobs.json'</code>' のゲートウェイホストに永続化されます。
ゲートウェイはファイルをメモリにロードし、変更時に書き戻すため、手動編集は
ゲートウェイが停止している場合のみ安全です。'<code className="bg-white/10 px-1.5 py-0.5 rounded text-emerald-300 text-sm">'openclaw cron add/edit'</code>' または cron
ツール呼び出し API を優先して変更してください。
初心者に優しい概要
cron ジョブを次のように考えてください:<strong>いつ</strong>実行する + <strong>何をする</strong>。
1. <strong>スケジュールを選択</strong>
- ワンタイムリマインダー → '<code className="bg-white/10 px-1.5 py-0.5 rounded text-emerald-300 text-sm">'schedule.kind = "at"'</code>' (CLI: '<code className="bg-white/10 px-1.5 py-0.5 rounded text-emerald-300 text-sm">'--at'</code>')
- 繰り返しジョブ → '<code className="bg-white/10 px-1.5 py-0.5 rounded text-emerald-300 text-sm">'schedule.kind = "every"'</code>' または '<code className="bg-white/10 px-1.5 py-0.5 rounded text-emerald-300 text-sm">'schedule.kind = "cron"'</code>'
- ISO タイムスタンプがタイムゾーンを省略している場合、<strong>UTC</strong> として扱われます。
2. <strong>実行場所を選択</strong>
- '<code className="bg-white/10 px-1.5 py-0.5 rounded text-emerald-300 text-sm">'sessionTarget: "main"'</code>' → 次のハートビート中にメインコンテキストで実行されます。
- '<code className="bg-white/10 px-1.5 py-0.5 rounded text-emerald-300 text-sm">'sessionTarget: "isolated"'</code>' → runs a dedicated agent turn in '<code className="bg-white/10 px-1.5 py-0.5 rounded text-emerald-300 text-sm">'cron:<jobId>'</code>'.
3. <strong>ペイロードを選択</strong>
- メインセッション → '<code className="bg-white/10 px-1.5 py-0.5 rounded text-emerald-300 text-sm">'payload.kind = "systemEvent"'</code>'
- 分離セッション → '<code className="bg-white/10 px-1.5 py-0.5 rounded text-emerald-300 text-sm">'payload.kind = "agentTurn"'</code>'
オプション:'<code className="bg-white/10 px-1.5 py-0.5 rounded text-emerald-300 text-sm">'deleteAfterRun: true'</code>' は、成功したワンタイムジョブをストレージから削除します。
Concepts
#
ジョブ
cron ジョブは次の保存されたレコードです:
- <strong>スケジュール</strong>(いつ実行するか)、
- <strong>ペイロード</strong>(何をするべきか)、
オプションの<strong>配信</strong>(出力を送信する場所)。
- オプションの'<strong>'エージェントバインディング'</strong>' ('<code className="bg-white/10 px-1.5 py-0.5 rounded text-emerald-300 text-sm">'agentId'</code>'):特定のエージェントの下でジョブを実行します;もし
欠落または不明な場合、ゲートウェイはデフォルトエージェントにフォールバックします。
ジョブは安定した '<code className="bg-white/10 px-1.5 py-0.5 rounded text-emerald-300 text-sm">'jobId'</code>' で識別されます(CLI/ゲートウェイ API で使用)。
エージェントツール呼び出しでは、'<code className="bg-white/10 px-1.5 py-0.5 rounded text-emerald-300 text-sm">'jobId'</code>' が正規です;互換性のためにレガシー '<code className="bg-white/10 px-1.5 py-0.5 rounded text-emerald-300 text-sm">'id'</code>' が受け入れられます。
ジョブは、'<code className="bg-white/10 px-1.5 py-0.5 rounded text-emerald-300 text-sm">'deleteAfterRun: true'</code>' を介して、成功したワンタイム実行後にオプションで自動削除できます。
#
スケジュール
Cron は3つのスケジュールタイプをサポートします:
- '<code className="bg-white/10 px-1.5 py-0.5 rounded text-emerald-300 text-sm">'at'</code>':ワンタイムタイムスタンプ(エポックからのミリ秒)。ゲートウェイは ISO 8601 を受け入れ、UTC に強制します。
- '<code className="bg-white/10 px-1.5 py-0.5 rounded text-emerald-300 text-sm">'every'</code>':固定間隔(ミリ秒)。
- '<code className="bg-white/10 px-1.5 py-0.5 rounded text-emerald-300 text-sm">'cron'</code>':オプションの IANA タイムゾーンを持つ5フィールド cron 式。
Cron 式は '<code className="bg-white/10 px-1.5 py-0.5 rounded text-emerald-300 text-sm">'croner'</code>' を使用します。タイムゾーンが省略されている場合、ゲートウェイホストの
ローカルタイムゾーンが使用されます。
#
メイン vs 分離実行
##
メインセッションジョブ(システムイベント)
メインジョブはシステムイベントをキューに入れ、オプションでハートビートランナーを起動します。
これらは '<code className="bg-white/10 px-1.5 py-0.5 rounded text-emerald-300 text-sm">'payload.kind = "systemEvent"'</code>' を使用する必要があります。
- '<code className="bg-white/10 px-1.5 py-0.5 rounded text-emerald-300 text-sm">'wakeMode: "next-heartbeat"'</code>'(デフォルト):イベントは次のスケジュールされたハートビートを待ちます。
- '<code className="bg-white/10 px-1.5 py-0.5 rounded text-emerald-300 text-sm">'wakeMode: "now"'</code>':イベントは即時のハートビート実行をトリガーします。
これは、通常のハートビートプロンプト + メインセッションコンテキストが必要な場合に最適です。
'<a href="/gateway/heartbeat" className="text-emerald-400 hover:text-emerald-300 transition-colors">'ハートビート'</a>' を参照してください。
##
分離ジョブ(専用 cron セッション)
Isolated jobs run a dedicated agent turn in session '<code className="bg-white/10 px-1.5 py-0.5 rounded text-emerald-300 text-sm">'cron:<jobId>'</code>'.
主要な動作:
- Prompts are prefixed with '<code className="bg-white/10 px-1.5 py-0.5 rounded text-emerald-300 text-sm">'[cron:<jobId> <job name>]'</code>' for traceability.
- 各実行は<strong>新しいセッション ID</strong>を開始します(以前の会話の引き継ぎなし)。
- 要約はメインセッションに投稿されます(プレフィックス '<code className="bg-white/10 px-1.5 py-0.5 rounded text-emerald-300 text-sm">'Cron'</code>'、設定可能)。
- '<code className="bg-white/10 px-1.5 py-0.5 rounded text-emerald-300 text-sm">'wakeMode: "now"'</code>' は、要約を投稿した後すぐにハートビートをトリガーします。
- '<code className="bg-white/10 px-1.5 py-0.5 rounded text-emerald-300 text-sm">'payload.deliver: true'</code>' の場合、出力はチャネルに配信されます;それ以外の場合は内部に留まります。
分離ジョブを使用して、ノイズの多い、頻繁な、または「バックグラウンド雑用」でスパムすべきではない
メインチャット履歴を処理します。
#
ペイロード形状(実行内容)
2つのペイロードタイプがサポートされています:
- '<code className="bg-white/10 px-1.5 py-0.5 rounded text-emerald-300 text-sm">'systemEvent'</code>':メインセッションのみ、ハートビートプロンプトを介してルーティングされます。
- '<code className="bg-white/10 px-1.5 py-0.5 rounded text-emerald-300 text-sm">'agentTurn'</code>':分離セッションのみ、専用エージェントターンを実行します。
一般的な '<code className="bg-white/10 px-1.5 py-0.5 rounded text-emerald-300 text-sm">'agentTurn'</code>' フィールド:
- '<code className="bg-white/10 px-1.5 py-0.5 rounded text-emerald-300 text-sm">'message'</code>':必須のテキストプロンプト。
- '<code className="bg-white/10 px-1.5 py-0.5 rounded text-emerald-300 text-sm">'model'</code>' / '<code className="bg-white/10 px-1.5 py-0.5 rounded text-emerald-300 text-sm">'thinking'</code>':オプションのオーバーライド(以下を参照)。
- '<code className="bg-white/10 px-1.5 py-0.5 rounded text-emerald-300 text-sm">'timeoutSeconds'</code>':オプションのタイムアウトオーバーライド。
- '<code className="bg-white/10 px-1.5 py-0.5 rounded text-emerald-300 text-sm">'deliver'</code>':'<code className="bg-white/10 px-1.5 py-0.5 rounded text-emerald-300 text-sm">'true'</code>' は出力をチャネルターゲットに送信します。
- '<code className="bg-white/10 px-1.5 py-0.5 rounded text-emerald-300 text-sm">'channel'</code>':'<code className="bg-white/10 px-1.5 py-0.5 rounded text-emerald-300 text-sm">'last'</code>' または特定のチャネル。
- '<code className="bg-white/10 px-1.5 py-0.5 rounded text-emerald-300 text-sm">'to'</code>':チャネル固有のターゲット(電話/チャット/チャネル ID)。
- '<code className="bg-white/10 px-1.5 py-0.5 rounded text-emerald-300 text-sm">'bestEffortDeliver'</code>':配信失敗時のジョブ失敗を回避します。
分離オプション('<code className="bg-white/10 px-1.5 py-0.5 rounded text-emerald-300 text-sm">'session=isolated'</code>' のみ):
- '<code className="bg-white/10 px-1.5 py-0.5 rounded text-emerald-300 text-sm">'postToMainPrefix'</code>' (CLI: '<code className="bg-white/10 px-1.5 py-0.5 rounded text-emerald-300 text-sm">'--post-prefix'</code>'):メインのシステムイベントのプレフィックス。
- '<code className="bg-white/10 px-1.5 py-0.5 rounded text-emerald-300 text-sm">'postToMainMode'</code>':'<code className="bg-white/10 px-1.5 py-0.5 rounded text-emerald-300 text-sm">'summary'</code>'(デフォルト)または '<code className="bg-white/10 px-1.5 py-0.5 rounded text-emerald-300 text-sm">'full'</code>'。
- '<code className="bg-white/10 px-1.5 py-0.5 rounded text-emerald-300 text-sm">'postToMainMaxChars'</code>':'<code className="bg-white/10 px-1.5 py-0.5 rounded text-emerald-300 text-sm">'postToMainMode=full'</code>' の場合の最大文字数(デフォルト 8000)。
#
モデルと思考オーバーライド
分離ジョブ('<code className="bg-white/10 px-1.5 py-0.5 rounded text-emerald-300 text-sm">'agentTurn'</code>')は、モデルと思考レベルをオーバーライドできます:
- '<code className="bg-white/10 px-1.5 py-0.5 rounded text-emerald-300 text-sm">'model'</code>':プロバイダ/モデル文字列(例:'<code className="bg-white/10 px-1.5 py-0.5 rounded text-emerald-300 text-sm">'anthropic/claude-sonnet-4-20250514'</code>')またはエイリアス(例:'<code className="bg-white/10 px-1.5 py-0.5 rounded text-emerald-300 text-sm">'opus'</code>')
- '<code className="bg-white/10 px-1.5 py-0.5 rounded text-emerald-300 text-sm">'thinking'</code>':思考レベル('<code className="bg-white/10 px-1.5 py-0.5 rounded text-emerald-300 text-sm">'off'</code>'、'<code className="bg-white/10 px-1.5 py-0.5 rounded text-emerald-300 text-sm">'minimal'</code>'、'<code className="bg-white/10 px-1.5 py-0.5 rounded text-emerald-300 text-sm">'low'</code>'、'<code className="bg-white/10 px-1.5 py-0.5 rounded text-emerald-300 text-sm">'medium'</code>'、'<code className="bg-white/10 px-1.5 py-0.5 rounded text-emerald-300 text-sm">'high'</code>'、'<code className="bg-white/10 px-1.5 py-0.5 rounded text-emerald-300 text-sm">'xhigh'</code>';GPT-5.2 + Codex モデルのみ)
注:メインセッションジョブに '<code className="bg-white/10 px-1.5 py-0.5 rounded text-emerald-300 text-sm">'model'</code>' を設定することもできますが、共有メインセッション
セッションモデルを変更します。予期しないコンテキスト変更を回避するために、
分離ジョブに対してのみモデルオーバーライドをお勧めします。
解像度の優先順位:
1. ジョブペイロードオーバーライド(最高)
2. フック固有のデフォルト(例:'<code className="bg-white/10 px-1.5 py-0.5 rounded text-emerald-300 text-sm">'hooks.gmail.model'</code>')
3. エージェント設定のデフォルト
#
配信(チャネル + ターゲット)
- '<code className="bg-white/10 px-1.5 py-0.5 rounded text-emerald-300 text-sm">'channel'</code>': '<code className="bg-white/10 px-1.5 py-0.5 rounded text-emerald-300 text-sm">'whatsapp'</code>' / '<code className="bg-white/10 px-1.5 py-0.5 rounded text-emerald-300 text-sm">'telegram'</code>' / '<code className="bg-white/10 px-1.5 py-0.5 rounded text-emerald-300 text-sm">'discord'</code>' / '<code className="bg-white/10 px-1.5 py-0.5 rounded text-emerald-300 text-sm">'slack'</code>' / '<code className="bg-white/10 px-1.5 py-0.5 rounded text-emerald-300 text-sm">'mattermost'</code>' (プラグイン) / '<code className="bg-white/10 px-1.5 py-0.5 rounded text-emerald-300 text-sm">'signal'</code>' / '<code className="bg-white/10 px-1.5 py-0.5 rounded text-emerald-300 text-sm">'imessage'</code>' / '<code className="bg-white/10 px-1.5 py-0.5 rounded text-emerald-300 text-sm">'last'</code>'
- '<code className="bg-white/10 px-1.5 py-0.5 rounded text-emerald-300 text-sm">'to'</code>':チャネル固有の受信者ターゲット
'<code className="bg-white/10 px-1.5 py-0.5 rounded text-emerald-300 text-sm">'channel'</code>' または '<code className="bg-white/10 px-1.5 py-0.5 rounded text-emerald-300 text-sm">'to'</code>' が省略されている場合、cron はメインセッションの「最後のルート」にフォールバックできます
(エージェントが最後に返信した場所)。
配信ノート:
- '<code className="bg-white/10 px-1.5 py-0.5 rounded text-emerald-300 text-sm">'to'</code>' が設定されている場合、'<code className="bg-white/10 px-1.5 py-0.5 rounded text-emerald-300 text-sm">'deliver'</code>' が省略されていても、cron はエージェントの最終出力を自動的に配信します。
- 明示的な '<code className="bg-white/10 px-1.5 py-0.5 rounded text-emerald-300 text-sm">'to'</code>' なしで最後のルート配信が必要な場合は、'<code className="bg-white/10 px-1.5 py-0.5 rounded text-emerald-300 text-sm">'to'</code>' を使用してください。
- '<code className="bg-white/10 px-1.5 py-0.5 rounded text-emerald-300 text-sm">'to'</code>' が存在していても、'<code className="bg-white/10 px-1.5 py-0.5 rounded text-emerald-300 text-sm">'to'</code>' を使用して出力を内部に保持してください。
ターゲット形式のリマインダー:
- Slack/Discord/Mattermost (plugin) targets should use explicit prefixes (e.g., '<code className="bg-white/10 px-1.5 py-0.5 rounded text-emerald-300 text-sm">'channel:<id>'</code>', '<code className="bg-white/10 px-1.5 py-0.5 rounded text-emerald-300 text-sm">'user:<id>'</code>') to avoid ambiguity.
- Telegram トピックは '<code className="bg-white/10 px-1.5 py-0.5 rounded text-emerald-300 text-sm">':topic:'</code>' 形式を使用する必要があります(以下を参照)。
##
Telegram 配信ターゲット(トピック/フォーラムスレッド)
Telegram は '<code className="bg-white/10 px-1.5 py-0.5 rounded text-emerald-300 text-sm">'message_thread_id'</code>' を介してフォーラムトピックをサポートします。cron 配信の場合、次をエンコードできます
トピック/スレッドを '<code className="bg-white/10 px-1.5 py-0.5 rounded text-emerald-300 text-sm">'to'</code>' フィールドに:
- '<code className="bg-white/10 px-1.5 py-0.5 rounded text-emerald-300 text-sm">'-1001234567890'</code>'(チャット ID のみ)
- '<code className="bg-white/10 px-1.5 py-0.5 rounded text-emerald-300 text-sm">'-1001234567890:topic:123'</code>'(推奨:明示的なトピックマーカー)
- '<code className="bg-white/10 px-1.5 py-0.5 rounded text-emerald-300 text-sm">'-1001234567890:123'</code>'(短縮形:数値サフィックス)
'<code className="bg-white/10 px-1.5 py-0.5 rounded text-emerald-300 text-sm">'telegram:...'</code>' / '<code className="bg-white/10 px-1.5 py-0.5 rounded text-emerald-300 text-sm">'telegram:group:...'</code>' のようなプレフィックス付きターゲットも受け入れられます:
- '<code className="bg-white/10 px-1.5 py-0.5 rounded text-emerald-300 text-sm">'telegram:group:-1001234567890:topic:123'</code>'
ツール呼び出しの JSON スキーマ
ReferenceAutomationCronJobsPage step 16: P1
ReferenceAutomationCronJobsPage step 16: P2
ReferenceAutomationCronJobsPage step 16: Content
Examples
ワンタイムリマインダー:
{
"name": "Reminder",
"schedule": { "kind": "at", "atMs": 1738262400000 },
"sessionTarget": "main",
"wakeMode": "now",
"payload": { "kind": "systemEvent", "text": "Reminder text" },
"deleteAfterRun": true
}繰り返される、分離配信ジョブ:
{
"name": "Morning brief",
"schedule": { "kind": "cron", "expr": "0 7 * * *", "tz": "America/Los_Angeles" },
"sessionTarget": "isolated",
"wakeMode": "next-heartbeat",
"payload": {
"kind": "agentTurn",
"message": "Summarize overnight updates.",
"deliver": true,
"channel": "slack",
"to": "channel:C1234567890",
"bestEffortDeliver": true
},
"isolation": { "postToMainPrefix": "Cron", "postToMainMode": "summary" }
}ノート:
- '<code className="bg-white/10 px-1.5 py-0.5 rounded text-emerald-300 text-sm">'schedule.kind'</code>': '<code className="bg-white/10 px-1.5 py-0.5 rounded text-emerald-300 text-sm">'at'</code>' ('<code className="bg-white/10 px-1.5 py-0.5 rounded text-emerald-300 text-sm">'atMs'</code>')、'<code className="bg-white/10 px-1.5 py-0.5 rounded text-emerald-300 text-sm">'every'</code>' ('<code className="bg-white/10 px-1.5 py-0.5 rounded text-emerald-300 text-sm">'everyMs'</code>') または '<code className="bg-white/10 px-1.5 py-0.5 rounded text-emerald-300 text-sm">'cron'</code>' ('<code className="bg-white/10 px-1.5 py-0.5 rounded text-emerald-300 text-sm">'expr'</code>'、オプション '<code className="bg-white/10 px-1.5 py-0.5 rounded text-emerald-300 text-sm">'tz'</code>')。
- '<code className="bg-white/10 px-1.5 py-0.5 rounded text-emerald-300 text-sm">'atMs'</code>' と '<code className="bg-white/10 px-1.5 py-0.5 rounded text-emerald-300 text-sm">'everyMs'</code>' はエポックミリ秒です。
- '<code className="bg-white/10 px-1.5 py-0.5 rounded text-emerald-300 text-sm">'sessionTarget'</code>' は '<code className="bg-white/10 px-1.5 py-0.5 rounded text-emerald-300 text-sm">'"main"'</code>' または '<code className="bg-white/10 px-1.5 py-0.5 rounded text-emerald-300 text-sm">'"isolated"'</code>' である必要があり、'<code className="bg-white/10 px-1.5 py-0.5 rounded text-emerald-300 text-sm">'payload.kind'</code>' と一致する必要があります。
- オプションフィールド:'<code className="bg-white/10 px-1.5 py-0.5 rounded text-emerald-300 text-sm">'agentId'</code>'、'<code className="bg-white/10 px-1.5 py-0.5 rounded text-emerald-300 text-sm">'description'</code>'、'<code className="bg-white/10 px-1.5 py-0.5 rounded text-emerald-300 text-sm">'enabled'</code>'、'<code className="bg-white/10 px-1.5 py-0.5 rounded text-emerald-300 text-sm">'deleteAfterRun'</code>'、'<code className="bg-white/10 px-1.5 py-0.5 rounded text-emerald-300 text-sm">'isolation'</code>'。
- '<code className="bg-white/10 px-1.5 py-0.5 rounded text-emerald-300 text-sm">'wakeMode'</code>' は省略時に '<code className="bg-white/10 px-1.5 py-0.5 rounded text-emerald-300 text-sm">'"next-heartbeat"'</code>' にデフォルト設定されます。
#
cron.update パラメータ
{
"jobId": "job-123",
"patch": {
"enabled": false,
"schedule": { "kind": "every", "everyMs": 3600000 }
}
}ノート:
- '<code className="bg-white/10 px-1.5 py-0.5 rounded text-emerald-300 text-sm">'jobId'</code>' が正規です;互換性のために '<code className="bg-white/10 px-1.5 py-0.5 rounded text-emerald-300 text-sm">'id'</code>' が受け入れられます。
- パッチで '<code className="bg-white/10 px-1.5 py-0.5 rounded text-emerald-300 text-sm">'agentId: null'</code>' を使用してエージェントバインディングをクリアします。
#
cron.run および cron.remove パラメータ
{ "jobId": "job-123", "mode": "force" }{ "jobId": "job-123" }ストレージと履歴
- ジョブストレージ:'<code className="bg-white/10 px-1.5 py-0.5 rounded text-emerald-300 text-sm">'~/.openclaw/cron/jobs.json'</code>'(ゲートウェイ管理 JSON)。
- Run history: '<code className="bg-white/10 px-1.5 py-0.5 rounded text-emerald-300 text-sm">'~/.openclaw/cron/runs/<jobId>.jsonl'</code>' (JSONL, auto-trimmed).
- 設定でストレージパスをオーバーライド:'<code className="bg-white/10 px-1.5 py-0.5 rounded text-emerald-300 text-sm">'cron.store'</code>'。
Configuration
{
cron: {
enabled: true, // default true
store: "~/.openclaw/cron/jobs.json",
maxConcurrentRuns: 1, // default 1
},
}cron を完全に無効にする:
- '<code className="bg-white/10 px-1.5 py-0.5 rounded text-emerald-300 text-sm">'cron.enabled: false'</code>' (config)
- '<code className="bg-white/10 px-1.5 py-0.5 rounded text-emerald-300 text-sm">'OPENCLAW_SKIP_CRON=1'</code>' (environment)
CLI クイックスタート
ワンタイムリマインダー(UTC ISO、成功後に自動削除):
openclaw cron add --name "Send reminder" --at "2026-01-12T18:00:00Z" --session main --system-event "Reminder: submit expense report." --wake now --delete-after-run
ワンタイムリマインダー(メインセッション、即時起動):
openclaw cron add --name "Calendar check" --at "20m" --session main --system-event "Next heartbeat: check calendar." --wake now
繰り返される分離ジョブ(WhatsApp に送信):
openclaw cron add --name "Morning status" --cron "0 7 * * *" --tz "America/Los_Angeles" --session isolated --message "Summarize inbox + calendar for today." --deliver --channel whatsapp --to "+15551234567"
繰り返される分離ジョブ(Telegram トピックに送信):
openclaw cron add --name "Nightly summary (topic)" --cron "0 22 * * *" --tz "America/Los_Angeles" --session isolated --message "Summarize today; send to the nightly topic." --deliver --channel telegram --to "-1001234567890:topic:123"
モデルと思考オーバーライド付きの分離ジョブ:
openclaw cron add --name "Deep analysis" --cron "0 6 * * 1" --tz "America/Los_Angeles" --session isolated --message "Weekly deep analysis of project progress." --model "opus" --thinking high --deliver --channel whatsapp --to "+15551234567"
エージェント選択(マルチエージェント設定):
openclaw cron add --name "Ops sweep" --cron "0 6 * * *" --session isolated --message "Check ops queue" --agent ops openclaw cron edit <jobId> --agent ops openclaw cron edit <jobId> --clear-agent
手動実行(デバッグ):
openclaw cron run <jobId> --force
既存のジョブを編集(パッチフィールド):
openclaw cron edit <jobId> --message "Updated prompt" --model "opus" --thinking low
Run history:
openclaw cron runs --id <jobId> --limit 50
ジョブを作成せずに即時のシステムイベント:
openclaw system event --mode now --text "Next heartbeat: check battery."
ゲートウェイ API
- '<code className="bg-white/10 px-1.5 py-0.5 rounded text-emerald-300 text-sm">'cron.list'</code>'、'<code className="bg-white/10 px-1.5 py-0.5 rounded text-emerald-300 text-sm">'cron.status'</code>'、'<code className="bg-white/10 px-1.5 py-0.5 rounded text-emerald-300 text-sm">'cron.add'</code>'、'<code className="bg-white/10 px-1.5 py-0.5 rounded text-emerald-300 text-sm">'cron.update'</code>'、'<code className="bg-white/10 px-1.5 py-0.5 rounded text-emerald-300 text-sm">'cron.remove'</code>'
- '<code className="bg-white/10 px-1.5 py-0.5 rounded text-emerald-300 text-sm">'cron.run'</code>'(強制または期限)、'<code className="bg-white/10 px-1.5 py-0.5 rounded text-emerald-300 text-sm">'cron.runs'</code>'
ジョブなしの即時システムイベントについては、'<a href="/cli/system" className="text-emerald-400 hover:text-emerald-300 transition-colors">''<code className="bg-white/10 px-1.5 py-0.5 rounded text-emerald-300 text-sm">'openclaw system event'</code>''</a>' を使用してください。
トラブルシューティング
#
"何も実行されない"
- cron が有効かどうかを確認してください:'<code className="bg-white/10 px-1.5 py-0.5 rounded text-emerald-300 text-sm">'cron.enabled'</code>' と '<code className="bg-white/10 px-1.5 py-0.5 rounded text-emerald-300 text-sm">'OPENCLAW_SKIP_CRON'</code>'。
- ゲートウェイが継続的に実行されているかを確認してください(cron はゲートウェイプロセス内で実行されます)。
- '<code className="bg-white/10 px-1.5 py-0.5 rounded text-emerald-300 text-sm">'cron'</code>' スケジュールの場合:タイムゾーン ('<code className="bg-white/10 px-1.5 py-0.5 rounded text-emerald-300 text-sm">'--tz'</code>') がホストタイムゾーンと一致することを確認してください。
#
Telegram が間違った場所に送信する
- For forum topics, use '<code className="bg-white/10 px-1.5 py-0.5 rounded text-emerald-300 text-sm">'-100…:topic:<id>'</code>' to be explicit and unambiguous.
- ログまたは保存された「最後のルート」ターゲットで '<code className="bg-white/10 px-1.5 py-0.5 rounded text-emerald-300 text-sm">'telegram:...'</code>' プレフィックスが表示されている場合、これは正常です;
cron 配信はそれらを受け入れ、トピック ID を正しく解析します。