Skip to main content
The JsonExtractString node scans a text string for the first valid JSON object and extracts the value associated with a specific key, converted to a string. Any text before or after the JSON object is ignored, so the node also works on Markdown code blocks and on model replies that wrap the JSON in extra prose. If no valid JSON object is found, the key is not found, or the value is null, the node returns an empty string.

Inputs

Note: The node extracts values only from JSON objects (dictionaries). It tries each { in the input in order and decodes from the first position that yields a valid JSON object, so leading or trailing text is skipped. If no JSON object can be decoded or the specified key does not exist within it, the output is an empty string. If the value associated with the key is null, the node also returns an empty string. Values that are not strings are returned as their string representation.

Outputs

This documentation was AI-generated. If you find any errors or have suggestions for improvement, please feel free to contribute! Edit on GitHub

Source fingerprint (SHA-256): ca697fd3bd2d4de764372470ad1102b345d9d60f6df1c151fa0573e85fab2382