e8bd518efa
改前四種寫法並存、沒一個是 credential,而執行端只認 {{credential.X}}
(graph-executor.ts:247→resolveCredentialRefs)⇒ 用戶照抄必踩坑:
{{api_key}} 13/{{gitea_token}} 2/{{secret.GITHUB_BOT_TOKEN}} 2/{{kbdb_api_key}} 1
改後(19 處統一):
{{credential.arcrun_namespace}} 15/{{credential.gitea_token}} 2/{{credential.github_bot_token}} 2
⚠️ 中途修正一次錯誤命名:我先改成 kbdb_partner_key(照零件契約舊敘述 ak_xxx),
leo 當場指正「現在沒有 partner key,改用 namespace,沒有發 API key 的機制」——
實際機制確為 X-Arcrun-API-Key: <namespace>(實例上活的 workflow 為證)。
不動:{{secret.LEO_TELEGRAM_CHAT_ID}} 3 處——chat_id 是聊天室 ID 不是金鑰,
無腦套規則會引進「找不到 credential」的錯誤。
驗:違規寫法歸零/12 個範例 YAML 全可解析。
殘:kbdb_upsert_block 契約仍寫『KBDB partner key(ak_xxx)』=假資訊源(我就是被它騙的),
修它被 component-guard 擋(正確),需 leo 跑 scripts/component-arm.sh。
39 lines
1.1 KiB
YAML
39 lines
1.1 KiB
YAML
name: cron_watcher_example
|
|
description: 每 5 分鐘掃 KBDB 未處理的 note → 對每筆觸發子 workflow
|
|
|
|
flow:
|
|
- "watch_cron >> ON_SUCCESS >> list_unprocessed"
|
|
- "list_unprocessed >> ON_SUCCESS >> filter_new"
|
|
- "filter_new >> 對每個 item >> trigger_processor"
|
|
|
|
config:
|
|
watch_cron:
|
|
component: cron
|
|
cron_expr: "*/5 * * * *"
|
|
description: "每 5 分鐘掃一次"
|
|
|
|
list_unprocessed:
|
|
component: kbdb_get
|
|
api_key: "{{credential.arcrun_namespace}}"
|
|
type: "note"
|
|
source: "user-input"
|
|
limit: 20
|
|
|
|
filter_new:
|
|
component: filter
|
|
items: "{{list_unprocessed.blocks}}"
|
|
condition:
|
|
key: "tags_json"
|
|
op: "eq"
|
|
value: "[]"
|
|
|
|
# trigger_workflow 是內建 orchestration 零件,in-process call 另一個 workflow
|
|
# **千萬不要用 http_request 自打 cypher-executor 自己的 webhook** — 會撞 CF self-fetch 死鎖
|
|
trigger_processor:
|
|
component: trigger_workflow
|
|
workflow_name: "your_processor_workflow" # ← 改成你的處理 workflow 名
|
|
api_key: "{{credential.arcrun_namespace}}"
|
|
input:
|
|
api_key: "{{credential.arcrun_namespace}}"
|
|
block_id: "{{item.id}}"
|