Actions108
- AI Actions
- Transcribe
- Detect Brand
- Extract Contact Information
- Mood Detection
- Detect Adult Content
- Enitity Detection
- Language Detection
- Too Long To Read
- Check Content Policy
- Detect Faces
- Generate Python Code
- Picture Text Recognition
- Detect Color
- Generate Image
- PDF OCR
- Translation
- Detect Email Type
- Generate Javascript Code
- Picture Object Recognition
- Business Actions
- Calculate Actions
- Code Actions
- Convert Actions
- Crypto Actions
- Date & Time Actions
- Generate Actions
- Image Actions
- Operator Actions
- PDF Actions
- Storage Actions
- Text Actions
- User Actions
Overview
The node provides a "Compare String" operation under the "Text" resource, which compares two input strings using a specified algorithm. This functionality is useful in scenarios where you need to measure similarity or differences between text snippets, such as validating user input, detecting duplicates, or performing fuzzy matching.
For example, you might use this node to:
- Compare two product descriptions to check if they are similar.
- Validate if a user's entered string closely matches a stored reference string.
- Implement text-based filters or triggers based on string similarity scores.
Properties
| Name | Meaning |
|---|---|
| Code Variables | A collection of code variables defined in an external code editor environment; each variable has a name (or ID) and a value. Useful for dynamic inputs or referencing predefined variables. |
| First String | The first string to compare. |
| Second String | The second string to compare. |
| Algorithm | The algorithm used to compare the two strings. This determines how similarity or difference is calculated. (The exact algorithms supported are not listed in the provided code.) |
Output
The output is a JSON array containing the result(s) of the string comparison operation. Each item in the output corresponds to one execution iteration and includes the comparison result returned by the underlying API.
The exact structure of the output JSON depends on the API response but typically would include similarity scores, distance metrics, or boolean indicators depending on the chosen algorithm.
This node does not output binary data.
Dependencies
- Requires an API key credential for authentication with the external "0CodeKit" service.
- The node sends requests to the "text/comparestring" endpoint of the external API.
- The node relies on helper functions to perform HTTP POST requests to the API.
Troubleshooting
Common issues:
- Missing or invalid API key credential will cause authentication failures.
- Providing empty or invalid strings may lead to errors or unexpected results.
- Using an unsupported or misspelled algorithm name could cause the API to reject the request.
Error messages:
- Errors from the external API will be thrown unless "Continue On Fail" is enabled, in which case error details are included in the output.
- Network or connectivity issues can cause request failures.
Resolutions:
- Ensure the API key credential is correctly configured and valid.
- Validate input strings before running the node.
- Verify the algorithm parameter against supported options documented by the external service.
Links and References
- n8n Expressions Documentation — for using expressions in property values.
- External API documentation for the "0CodeKit" service (not provided here) would contain details about supported algorithms and response formats.