canonical_id: cf_worker_deploy_simple display_name: Cloudflare Worker Deploy (single-file, classic format) description: >- PUT /accounts/{account_id}/workers/scripts/{script_name} 部署單檔 Worker(CF 「classic Service Worker」格式,非 ES module)。_path 帶 /{account_id}/workers/scripts/{script_name}。 auth: cloudflare_workers static_key(Bearer token)。 ⚠️ 已知限制(誠實記錄,非隱藏債):這個 recipe 走 arcrun 的「recipe body 一律 JSON.stringify」 引擎行為(cypher-executor/src/lib/component-loader.ts makeRecipeRunner),CF 這支 API 卻要求 body 是「原始 JS 原始碼」或(現代 ES module + bindings 情境)multipart/form-data——兩者都不是 JSON。純 recipe 模型在這支 API 上天生對不上,這不是可以在 recipe schema 裡修的事。 正解=07-thin-shell §3.5 自力救濟階梯「第三方 API 缺能力→ workflow/code-node 補丁」: 用 http_request 零件直接打(body 走它的原生 string 模式,不透過本 recipe wrapper), header 用 {{credential.cf_api_token}} 直接內插(D36 credential 模板,不必經過 recipe/auth_service 間接層);若目標 Worker 需要 bindings/compatibility_flags(現代 ES module 格式常態), 上游加一個 code 節點組出 multipart/form-data body(純資料編碼,非業務邏輯,合法局部整形)。 本 recipe 保留給「目標帳號仍接受 classic 格式」的簡單場景;不保證覆蓋所有部署情境。 endpoint: https://api.cloudflare.com/client/v4/accounts{{_path}} method: PUT auth_service: cloudflare_workers headers: Content-Type: application/javascript