JSON Escape Action

The JSON Escape Action node escapes a JSON payload so it can safely be embedded inside another string, request body, or API call.

It converts special characters (such as line breaks, quotes, and formatting characters) into escaped representations. This is especially useful when JSON must be passed as a string parameter to another system (for example inside another JSON object, XML document, or HTTP request).

Input Parameters

Payload The JSON object to be escaped.

The payload can be provided in multiple ways:

The input must be valid JSON.

JSON Escape Action

Output and Wildcards

The escaped JSON string is returned as the node result and can be accessed using:

Behavior

  • Reads a valid JSON payload

  • Escapes special characters (e.g., quotes and line breaks)

  • Returns the escaped JSON as a string

  • Fails if the provided JSON is invalid

Typical Use Cases

  • embedding JSON inside another JSON structure

  • sending JSON as a parameter in an HTTP request

  • integrating with APIs requiring stringified payloads

  • passing structured metadata to third-party systems

  • preparing payloads for webhooks

Example

Input

Output

The result can now be safely inserted into another string-based payload.

Practical Tip

If an API expects JSON but returns errors like invalid character, malformed body, or unexpected token, the problem is often an unescaped JSON string. This node is commonly placed before the HTTP Request Action when JSON must be nested inside another request body.

Last updated