0CodeKit icon

0CodeKit

A toolbox of no-code utilities

Actions108

Overview

The node provides a utility to convert a message into JSON format. It supports input as either a URL pointing to the message or a raw buffer containing the message data. This conversion is useful when you have message content in different formats (e.g., fetched from a URL or received as binary data) and want to parse it into structured JSON for further processing within an n8n workflow.

Common scenarios include:

  • Converting API responses or webhook payloads available via URLs into JSON.
  • Parsing raw message buffers (e.g., from files or streams) into JSON objects.
  • Preparing message data for downstream nodes that require JSON input.

Example: You receive a message stored at a specific URL and want to convert its content into JSON to extract fields or perform conditional logic.

Properties

Name Meaning
Type of Message Choose the type of input message to convert. Options: URL (provide a URL where the message is located), Buffer (provide the raw buffer content of the message).
URL The URL of the message to convert. Required if "Type of Message" is set to URL.
Buffer The raw buffer string of the message to convert. Required if "Type of Message" is set to Buffer.
Code Variables A collection of code variables defined in the code editor for the selected function. Each variable has:
- Variable Name or ID: Select from a list or specify an expression.
- Value: The value assigned to the variable.

Output

The node outputs a JSON object representing the converted message content. The exact structure depends on the original message but will be a parsed JSON representation suitable for use in subsequent workflow steps.

If the input was a buffer, the node interprets it accordingly and converts it into JSON.

No binary output is produced by this operation.

Dependencies

  • Requires an API key credential for the external service powering the conversion (referred generically as "an API key credential").
  • The node internally calls an API endpoint with the resource path convert/msgtojson using POST method.
  • No additional environment variables are explicitly required beyond the API authentication.

Troubleshooting

  • Invalid URL or inaccessible resource: If the provided URL is incorrect or the resource is not reachable, the node will fail. Verify the URL and network accessibility.
  • Malformed buffer input: If the buffer string does not represent valid message data, the conversion may fail or produce errors. Ensure the buffer content is correctly formatted.
  • API authentication errors: Missing or invalid API credentials will cause authentication failures. Confirm that the API key credential is properly configured.
  • Unexpected response format: If the message content cannot be parsed into JSON, the node might throw parsing errors. Validate the source message format before conversion.

Links and References

  • n8n Expressions Documentation — for using expressions in variable names or IDs.
  • Refer to the external service's API documentation for details on the convert/msgtojson endpoint (not included here due to static analysis constraints).

Discussion