#!/bin/bash
export LC_ALL=C.UTF-8
python3 - <<'PY'
import json, sqlite3
c = sqlite3.connect('/tmp/n8n_exec.db')
name, nodes_json = c.execute("select name,nodes from workflow_entity where active=1").fetchone()
for n in json.loads(nodes_json):
    if n.get('type','').endswith(('webhook','code')):
        print(f"=== {n.get('name')} ({n.get('type')})")
        p = n.get('parameters',{})
        keep = {k: v for k, v in p.items() if k in ('path','httpMethod','responseMode','options','jsCode','mode')}
        print(json.dumps(keep, ensure_ascii=False)[:900])
        print()
PY
