922a57fe34
Self-hosted 開源:WASM 零件 + recipe + cypher-executor,跑在你自己的 Cloudflare。 此為重建的乾淨歷史起點(移除曾誤 commit 的 GCP SA 金鑰,舊歷史保留在 richblack/arcrun 與本地 backup 分支)。含: - acr init --self-hosted installer(建 KV/R2 + codeload 拉預編譯 wasm + wrangler deploy + seed recipe) - recipe push 把關(資料外流提醒 + 打通檢查) - 19 個正當零件預編譯 wasm(claude_api/km_writer/kbdb_upsert_block 排除:違反 DECISIONS §1) - CLI / cypher-executor / registry / 完整 SDD Co-Authored-By: Claude Opus 4.8 <noreply@anthropic.com>
44 lines
1.1 KiB
YAML
44 lines
1.1 KiB
YAML
name: error_retry
|
|
description: try_catch + wait + retry 模式:外部 API 偶發掛掉時自動重試
|
|
|
|
flow:
|
|
- "input >> ON_SUCCESS >> try_call"
|
|
- "try_call >> ON_SUCCESS >> done"
|
|
- "try_call >> ON_FAIL >> wait_a_bit"
|
|
- "wait_a_bit >> ON_SUCCESS >> retry_call"
|
|
- "retry_call >> ON_SUCCESS >> done"
|
|
- "retry_call >> ON_FAIL >> final_fail_notify"
|
|
|
|
config:
|
|
try_call:
|
|
component: http_request
|
|
url: "{{input.target_url}}"
|
|
method: POST
|
|
body_json:
|
|
payload: "{{input.payload}}"
|
|
|
|
wait_a_bit:
|
|
component: wait
|
|
seconds: 5
|
|
|
|
# 第二次嘗試。生產環境通常 retry 2-3 次配指數 backoff
|
|
retry_call:
|
|
component: http_request
|
|
url: "{{input.target_url}}"
|
|
method: POST
|
|
body_json:
|
|
payload: "{{input.payload}}"
|
|
_retry: 1
|
|
|
|
done:
|
|
component: comp_passthrough
|
|
# 純記錄成功,下游若需要可繼續鏈
|
|
|
|
final_fail_notify:
|
|
component: telegram
|
|
chat_id: "{{secret.LEO_TELEGRAM_CHAT_ID}}"
|
|
text: |
|
|
⚠️ workflow {{input.workflow_name}} 兩次重試都失敗
|
|
target: {{input.target_url}}
|
|
last error: {{retry_call.error}}
|