OpenClaw is the orchestrator. S2G is the toolbox. Connect to an S2G workflow via WebSocket, auto-discover all nodes, and execute them as tools.
OpenClaw ──WS──▶ S2G (wss://s2g.run/api/openclaw/ws/{nodeId})
├── PasswordGenerator
├── HashGenerator
├── DateMath
├── SqlServer
├── Knowledge Base
└── ... 200+ node types
The OpenClaw node is a built-in S2G node type (category: AI) that acts as a bidirectional bridge between OpenClaw agents and S2G workflows. It appears in the S2G node catalog as "OpenClaw Agent" and serves two roles:
wss://s2g.run/api/openclaw/ws/{nodeId}) that OpenClaw agents connect to. Once connected, the agent can execute any sibling node in the workflow.{"type":"data","data":{...}}.{"type":"auth","secret":"..."} as its first messagePOST https://s2g.run/api/v1/workflows/{id}/start)The OpenClaw node properties panel includes a Live View that shows:
ws module: npm install ws# Copy bridge script to workspace
cp scripts/s2g-bridge.js ~/.openclaw/workspace/s2g-bridge.js
npm install ws
In the S2G designer at s2g.run, click the OpenClaw node → copy the Node ID (UUID) from properties.
# Connect to public S2G
node s2g-bridge.js --s2g wss://s2g.run --node-id YOUR_NODE_UUID [--port 18792] [--secret SECRET]
# Or with environment variables:
S2G_WS_HOST=wss://s2g.run S2G_NODE_ID=abc-123 node s2g-bridge.js
# Self-hosted S2G instance (development)
node s2g-bridge.js --s2g ws://YOUR_HOST:5184 --node-id YOUR_NODE_UUID
curl http://localhost:18792/health
# {"healthy":true,"uptime":42.5}
curl http://localhost:18792/nodes
# Lists all discovered nodes with names, types, and IDs
The bridge exposes a local HTTP API on port 18792 (configurable via --port):
| Method | Endpoint | Description |
|---|---|---|
| -------- | ---------- | ------------- |
GET | /health | 200 if connected to S2G, 503 if not |
GET | /status | Full status: connection state, host, node list, stats, errors |
GET | /nodes | List all available S2G nodes (name, type, ID) |
POST | /execute | Execute by nodeId: { nodeId, params } |
POST | /execute/:name | Execute by name (fuzzy match): { params } |
POST | /refresh | Request fresh node list from S2G |
POST | /reconnect | Force disconnect and reconnect to S2G |
curl -X POST http://localhost:18792/execute/PasswordGenerator \
-H "Content-Type: application/json" \
-d '{"params": {"length": "20", "mode": "strong"}}'
curl -X POST http://localhost:18792/execute \
-H "Content-Type: application/json" \
-d '{"nodeId": "uuid-here", "params": {"length": "20"}}'
{
"success": true,
"output": {
"Password": "xK9!mN...",
"Strength": "Very Strong",
"_TriggeredTags": "[\"success\"]"
}
}
Before using an unfamiliar node, check its exact parameter names via the S2G Catalog API:
# Get schema for any node type
curl -H "X-API-Key: $KEY" "https://s2g.run/api/v1/catalog/nodes/Custom_Base64/schema"
# List all available node categories
curl -H "X-API-Key: $KEY" "https://s2g.run/api/v1/catalog/categories"
# List all nodes in a category
curl -H "X-API-Key: $KEY" "https://s2g.run/api/v1/catalog/categories/AI/nodes"
The fieldName in inputFields is the exact key to use in params. Case-sensitive.
length, mode (strong/pronounceable/passphrase/PIN), countcount, formattext, algorithm (md5/sha1/sha256)count, unit (paragraphs/sentences/words)operation (add/subtract/difference), date1, date2, days, hours...expression, variables, precisionexpression, count, fromDatedatetime, fromTimezone, toTimezonejson, path, returnFirstinputText, mode (encode/decode)inputText, mode (encode/decode)text, targetCase (camelCase/PascalCase/snake_case/kebab-case)markdown, addWrapperoldText, newTextxmlInputjsonInput, rootElementinputText, mode (toJson/toCsv), delimitertokenS2G can push data to connected OpenClaw agents in two ways:
{"type":"data","data":{...}}.For running as a service (systemd/pm2), connection lifecycle, auto-reconnect behavior, monitoring, handling S2G/OpenClaw restarts, security, and multi-bridge setups: see references/operations.md.
Key points:
POST https://s2g.run/api/v1/workflows/{id}/startlogs/s2g-bridge.log with 5MB rotationFull platform API at https://s2g.run/api/v1/ covering workflows, catalog, knowledge base, AI assistant, connections, usage, and logs: see references/api.md.
Key capabilities:
https://s2g.run/api/v1/workflowshttps://s2g.run/api/v1/catalog/nodesPOST https://s2g.run/api/v1/ai/generatehttps://s2g.run/api/v1/connectionshttps://s2g.run/api/v1/usageFor raw protocol details (message types, auth handshake, data push framing): see references/protocol.md.
Connection URL: wss://s2g.run/api/openclaw/ws/{nodeId}
Health check: GET https://s2g.run/api/openclaw/health
_TriggeredTags in output indicates which connection tag fired (success/error).共 1 个版本