docs(skill): warn --config must be flat action config

Wrapping --config in {"config":{...}} deploys a silent empty script
(succeeds in ~1ms, result {}). Document the trap + verification recipe
(workflow get --json, nodes[].config.code non-empty).
This commit is contained in:
yeuimu
2026-08-18 07:49:51 +00:00
parent 70f8372fbc
commit 9ec7dcb15a
2 changed files with 20 additions and 0 deletions
@@ -96,6 +96,24 @@ inkreach-teable action update <wfId> <nodeId> --dependencies '[]' # clear
- `timeout`: default 60000 (120000 in batch mode).
- `dependencies`: optional npm packages; `require('axios')` works in-sandbox. Install is cached by `name@version` hash; first run downloads, later runs reuse. CLI accepts JSON `[{"name","version?"}]` or shorthand `name@version,name`. `update` replaces the whole array (not append).
> ⚠️ **`--config` must be the FLAT action config itself** — the JSON above, exactly as shown. It is assigned directly to `node.config` (CLI does `config = JSON.parse(opts.config)`).
> Do **NOT** wrap it in a node envelope like `{"config": {...}}` or `{"type": "script", "config": {...}}` — the engine then reads `config.code` as `undefined` and the node becomes a **silent empty script**: it "succeeds" in ~1ms with empty stdout and `result: {}`, and every downstream `{{nodeId.result.*}}` variable reference breaks (e.g. sendNotification fails with `Missing required fields: message`).
>
> Correct: `--config '{"code":"return 1","timeout":120000}'` · Wrong: `--config '{"config":{"code":"return 1"}}'`
>
> **Verify after every `--config` deploy** (also guards against the automation editor overwriting CLI changes with a stale draft — close the editor before CLI updates):
> ```bash
> inkreach-teable workflow get <wfId> --base-id <bseId> --json | python3 -c "
> import json,sys
> d=json.load(sys.stdin)
> for n in d.get('nodes',[]):
> if n.get('id')=='<nodeId>':
> c=n.get('config') or {}
> print('keys:',list(c.keys()),'code-len:',len(c.get('code') or ''))"
> # expect keys ['code','timeout',...] and code-len > 0
> ```
> Symptom cheat-sheet: script "succeeded" but `executionTime` ≈ 1ms, `stdout` empty, `result` `{}` → config shape was wrong (code never deployed).
**Output:**
```json
{ "result": "<return value>", "logs": { "stdout": "...", "stderr": "..." }, "executionTime": 123 }
@@ -67,6 +67,8 @@ Full config details: [trigger-types.md](../api-reference/trigger-types.md).
Full config details: [action-types.md](../api-reference/action-types.md).
> ⚠️ `action update --config '<json>'` takes the **flat action config** (e.g. `{"code":"...","timeout":120000}`), NOT `{"config":{...}}`. A wrapped config deploys an empty script that "succeeds" in ~1ms with `result: {}` and breaks downstream `{{nodeId.result.*}}` references. After any `--config` deploy, verify with `workflow get --json` that `nodes[].config.code` is non-empty. Details: [action-types.md § script](../api-reference/action-types.md).
## Creation Workflow
```bash