CustomJE icon

CustomJE

Custom operations

Overview

The node provides a custom operation called Split Messages under the Data Processing resource. It takes JSON data containing multiple messages and splits them into individual message items. This is useful when you have a batch of messages bundled together in one JSON object and want to process or analyze each message separately in your workflow.

Common scenarios:

  • Parsing chat logs or conversation histories where multiple messages are stored as an array.
  • Breaking down bulk message data for further processing, filtering, or routing.
  • Preparing message data for integrations that require single-message inputs.

Example:
You provide a JSON input with a key like "allmessage" containing an array of message objects. The node sends this data to an external API which returns the messages split into individual items. Each item can then be processed independently downstream in the workflow.


Properties

Name Meaning
CJ Token Your CJ Token (API key) used for authenticating requests to the external service.
JSON Data JSON data containing messages to split. Example format: {"allmessage": [{...}, {...}]}

Output

The output is a JSON array where each element represents a single message extracted from the input JSON data. The structure of each message depends on the response from the external API but typically includes fields such as message content, type, and metadata.

If the API response contains nested arrays under keys like data.items, data, or messages, the node flattens these arrays and outputs each message item individually.

No binary data output is produced by this operation.


Dependencies

  • Requires an active internet connection to call the external API endpoint at https://api.customje.com/split-messages.php.
  • Requires a valid CJ Token (API key) credential to authenticate API requests.
  • The node uses HTTP POST requests with JSON payloads and expects JSON responses.
  • No additional n8n environment variables or configurations are needed beyond providing the API key.

Troubleshooting

  • Invalid or missing CJ Token: The API will reject requests without a valid token. Ensure the CJ Token property is correctly set.
  • Malformed JSON Data: If the input JSON is not properly formatted or does not contain the expected message array, the API may return errors or empty results.
  • API Errors or Downtime: Network issues or API service downtime will cause request failures. Check connectivity and API status.
  • Unexpected Response Structure: If the API changes its response format, the node might not correctly parse messages. Verify the API documentation or contact support if output is empty or incorrect.
  • Error Handling: If the node encounters an error during execution, it either throws an error or, if "Continue On Fail" is enabled, outputs an error object with the message.

Links and References


This summary is based solely on static analysis of the provided source code and property definitions.

Discussion