OpenAICloudflare Developer PlatformMar 23, 2026, 12:00 PM

Workflows, Workers - Workflow instances now support pause(), resume(), restart(), and terminate() methods in local development

A condensed section focused on the key takeaways first.

Original Post

Quick Digest

Summary

A condensed section focused on the key takeaways first.

openaienmodel: gpt-5-mini-2025-08-07

Workflow instances now support pause(), resume(), restart(), and terminate() methods in local development

Key Points

  • pause/resume/restart/terminate available locally
  • Test full workflow lifecycle with wrangler dev
  • TypeScript instance API supported

Summary

Workflow instance methods pause(), resume(), restart(), and terminate() are now supported in local development when running wrangler dev. Engineers can create workflow instances locally and test full lifecycle transitions before deploying to production.

Key Points

  • Available only in local dev via wrangler dev.
  • Methods and effects:
    • pause() — pauses a running workflow instance.
    • resume() — resumes a paused instance.
    • restart() — restarts the instance from the beginning.
    • terminate() — stops the instance immediately.
  • Quick usage (TypeScript): const instance = await env.MY_WORKFLOW.create({ id: "my-instance-id" }); await instance.pause(); await instance.resume(); await instance.restart(); await instance.terminate();
  • Practical tips:
    • Await each call and handle errors to avoid unexpected states.
    • Use this to validate lifecycle handling, timeouts, and cleanup logic locally before deploying.

Full Translation

Translations

A translation section that keeps the flow of the original article.

openaijamodel: gpt-5-mini-2025-08-07

Workflows、Workers — ローカル開発で Workflow インスタンスが pause(), resume(), restart(), terminate() をサポート

Workflows、Workers — ローカル開発で Workflow インスタンスが pause(), resume(), restart(), terminate() をサポート

公開日: 2026-03-23T12:00:00.000Z

概要

pause(), resume(), restart(), terminate() の各 Workflow インスタンスメソッドが、wrangler dev を使用したローカル開発環境で利用可能になりました。これにより、Workflow インスタンスのライフサイクル(実行 → 一時停止 → 再開 → 再起動 → 終了)をローカルで完全にテストできます。

利用可能なメソッド

  • pause() — 実行中のインスタンスを一時停止します。
  • resume() — 一時停止中のインスタンスを再開します。
  • restart() — インスタンスを最初から再起動します。
  • terminate() — インスタンスを即座に終了します。

使用例(TypeScript)

TypeScript

const instance = await env . MY_WORKFLOW . create ( { id : "my-instance-id" , } ) ;
await instance . pause () ; // 実行中の Workflow インスタンスを一時停止します
await instance . resume () ; // 一時停止中のインスタンスを再開します
await instance . restart () ; // インスタンスを最初から再起動します
await instance . terminate () ; // インスタンスを即座に終了します

備考

  • ローカルでのテストには wrangler dev を使用してください。
  • API の詳細や追加のドキュメントは Cloudflare の API ドキュメントを参照してください。

リソース

  • API
  • Help Center
  • System Status

Was this helpful? Yes / No

© 2026 Cloudflare, Inc. Privacy Policy | Terms of Use | Report Security Issues | Cookie Settings

Workflows, Workers - Workflow instances now support pause(), resume(), restart(), and terminate() methods in local development | Cloudflare Developer Platform | DocsDigest