Upgrade to Pro — share decks privately, control downloads, hide ads and more …

Cloudflare Workflowsを使いたい倒したい

sugar-cat
January 31, 2025
420

Cloudflare Workflowsを使いたい倒したい

sugar-cat

January 31, 2025
Tweet

Transcript

  1. 5 2024年4月のCloudflare Developer Weekで発表されたCloudflare Worker上で実行されるワークフロー機能(現在Public beta) 概要 Cloudflare Workflows Data

    Anywhere with Pipelines, Event Notifications, and Workflows https://blog.cloudflare.com/data-anywhere-events-pipelines-durable-execution-workflows/#durable-execution
  2. 7 マルチステップの実行状態の保持のためにDurable Objects+SQLiteが使 用されている 仕組み(簡易版) Cloudflare Workflows Build durable applications

    on Cloudflare Workers: you write the Workflows, we take care of the rest https://blog.cloudflare.com/building-workflows-durable-execution-on-workers/#durability
  3. 8 マルチステップの実行状態の保持のためにDurable Objects+SQLiteが使 用されている 仕組み(簡易版) Cloudflare Workflows Build durable applications

    on Cloudflare Workers: you write the Workflows, we take care of the rest https://blog.cloudflare.com/building-workflows-durable-execution-on-workers/#durability ワークフローが失敗すると DOのSQLiteに対してステップの実行 状態が記録される
  4. 9 マルチステップの実行状態の保持のためにDurable Objects+SQLiteが使 用されている 仕組み(簡易版) Cloudflare Workflows Build durable applications

    on Cloudflare Workers: you write the Workflows, we take care of the rest https://blog.cloudflare.com/building-workflows-durable-execution-on-workers/#durability 同じインスタンス ID(ワークフローの実行単位 )を指定し再度実行 すると前回成功したステップはキャッシュされている
  5. 10 マルチステップの実行状態の保持のためにDurable Objects+SQLiteが使 用されている 仕組み(簡易版) Cloudflare Workflows Build durable applications

    on Cloudflare Workers: you write the Workflows, we take care of the rest https://blog.cloudflare.com/building-workflows-durable-execution-on-workers/#durability 冪等性を保ったままワークフローの特定のステップの処理を再開 できる
  6. 16 脱線: Bindingsについて Cloudflare Workflows Cloudflare Workersから他のCloudflarのリソース(D1, Queue… etc)へ のアクセスはBinding経由で行うことができる

    wrangler.tomlに設定を記載するのみで、同一ゾーンであれば認証等の設 定なし環境変数経由でアクセスが可能(Cloudflare 内部のネットワークを 通るので公衆インターネット網は通らない)
  7. 17 脱線: Service Bindingsについて Cloudflare Workflows Workersの別のWorkersの呼び出しの際に使用できるService Bindingsと いう仕組みがある RPC機能を使用することで実体としてはリモートのWorkersにアクセスし

    ているが、シリアライズ等不要でローカルに定義された関数と同等に扱う ことができる(!?) Introducing Services: Build Composable, Distributed Applications on Cloudflare Workers https://blog.cloudflare.com/introducing-worker-services/