feat(skill): finish n8n webhook skill
This commit is contained in:
@@ -4,7 +4,7 @@ set -euo pipefail
|
||||
usage() {
|
||||
cat <<'EOF'
|
||||
Usage:
|
||||
scripts/call-action.sh <action> [--args '{"k":"v"}'] [--args-file args.json] [--request-id <id>] [--path openclaw-action] [--test] [--pretty] [--dry-run]
|
||||
scripts/call-action.sh <action> [--args '{"k":"v"}'] [--args-file args.json] [--request-id <id|auto>] [--path openclaw-action] [--test] [--pretty] [--dry-run]
|
||||
|
||||
Environment:
|
||||
N8N_ACTION_PATH Default router webhook path (default: openclaw-action)
|
||||
@@ -13,7 +13,7 @@ Environment:
|
||||
N8N_SECRET_HEADER Header name (default: x-openclaw-secret)
|
||||
|
||||
Examples:
|
||||
scripts/call-action.sh append_log --args '{"text":"backup complete"}'
|
||||
scripts/call-action.sh append_log --args '{"text":"backup complete"}' --request-id auto
|
||||
scripts/call-action.sh notify --args-file notify.json --test --pretty
|
||||
EOF
|
||||
}
|
||||
@@ -98,6 +98,14 @@ if [[ -n "$ARGS_FILE" ]]; then
|
||||
ARGS="$(cat "$ARGS_FILE")"
|
||||
fi
|
||||
|
||||
if [[ "$REQUEST_ID" == "auto" ]]; then
|
||||
REQUEST_ID="$(python3 - <<'PY'
|
||||
import uuid
|
||||
print(uuid.uuid4())
|
||||
PY
|
||||
)"
|
||||
fi
|
||||
|
||||
PAYLOAD="$({
|
||||
python3 - <<'PY' "$ACTION" "$ARGS" "$REQUEST_ID"
|
||||
import json, sys
|
||||
|
||||
Reference in New Issue
Block a user