Skip to main content

Overview

OpenClaw is a specialized HTTP adapter for integrating with OpenClaw remote agent platforms. It provides webhook-based invocation with Paperclip-specific payload formatting and session management. OpenClaw adapters are ideal for:
  • Remote agent execution on OpenClaw infrastructure
  • Distributed teams of agents across multiple environments
  • Cloud-hosted agents separate from Paperclip server
OpenClaw uses the same HTTP adapter foundation but includes specialized payload formatting and error handling for OpenClaw endpoints.

Configuration Schema

Configuration Fields

Request Payload

OpenClaw adapters send a nested payload structure:

Key Differences from Generic HTTP Adapter

  1. Nested structure: Paperclip fields are under paperclip key
  2. Context duplication: Full context object is included alongside flattened fields
  3. Custom template merge: payloadTemplate fields are merged at root level

Authentication

OpenClaw adapters support authentication via:
Simplest method - set the Authorization header directly:
This is automatically added as the Authorization header if not present in headers.
Always use secret references (${secrets.name}) instead of hardcoding tokens in configuration.

Example Configurations

Basic OpenClaw Agent

OpenClaw with Custom Payload

Multi-Region OpenClaw Setup

Response Handling

OpenClaw endpoints should return standard HTTP responses:

Success (Synchronous)

Accepted (Asynchronous)

For asynchronous execution, the OpenClaw platform should callback to Paperclip when finished (see HTTP Adapter callbacks).

Error Response

Paperclip detects unknown_session errors and clears the saved session automatically.

Session Management

OpenClaw supports session continuity across invocations:
  1. First invocation: OpenClaw returns sessionId in response
  2. Subsequent invocations: Paperclip includes sessionId in wake context
  3. Session invalidation: OpenClaw returns unknown_session error
  4. Auto-recovery: Paperclip clears session and retries with fresh context

Session Response

Next Invocation

Paperclip automatically includes session in context:

Error Codes

OpenClaw adapter recognizes these error codes:

Testing OpenClaw Integration

Test your OpenClaw webhook:
Check the heartbeat run result:
Look for:
  • exitCode: 0 for success
  • errorCode: "openclaw_http_error" for failures
  • resultJson.response for OpenClaw response body

Monitoring and Debugging

View Recent Heartbeat Runs

Check Agent Session State

Look for runtime.sessionId and runtime.sessionParams.

View Logs

Heartbeat run logs include OpenClaw request/response:
Access via:

Best Practices

Prefer webhookAuthHeader over manual header configuration:
This is automatically added to the Authorization header.
Match timeoutSec to your OpenClaw endpoint’s expected response time:
For multi-region setups, include region metadata:
Check that sessions persist across invocations:

When NOT to Use OpenClaw

Don’t use OpenClaw adapter if:
  • You need local CLI execution → Use process adapters
  • Your endpoint is not reachable from Paperclip server → Fix networking or use VPN
  • You need generic HTTP webhook → Use HTTP adapter instead
  • You want synchronous subprocess → Use claude_local or codex_local

Troubleshooting

Webhook URL not reachable

Test connectivity from Paperclip server:
Check for:
  • DNS resolution failures
  • Firewall/network blocking
  • SSL/TLS certificate errors

Authentication failures

Verify the auth token is valid:
Ensure the secret reference is correct:

Session not persisting

Check that OpenClaw returns sessionId in response:
Verify Paperclip saves it:

Unknown session errors

OpenClaw should return:
Paperclip automatically clears the session and retries.

Next Steps

HTTP Adapter

Learn about generic HTTP webhook adapters

Custom Adapters

Build your own adapter for custom platforms