FlowiseAI/Flowise · error · Error

Path "${this.path}" not found in JSON. Received: ${preview}

Error message

Path "${this.path}" not found in JSON. Received: ${preview}

What it means

Thrown by JSONPathExtractorTool._call when lodash.get(data, this.path) returns undefined and returnNullOnError is false. The message includes the configured path and a truncated (200-char) pretty-printed preview of the received data, so the developer can see the actual shape and spot the mismatch. This is the 'wrong path / schema drift' signal.

Source

Thrown at packages/components/nodes/tools/JSONPathExtractor/JSONPathExtractor.ts:63

                if (this.returnNullOnError) {
                    return 'null'
                }
                throw new Error(`Invalid JSON string: ${error instanceof Error ? error.message : 'Parse error'}`)
            }
        } else {
            data = json
        }

        // Extract value using lodash get
        const value = get(data, this.path)

        if (value === undefined) {
            if (this.returnNullOnError) {
                return 'null'
            }
            const jsonPreview = JSON.stringify(data, null, 2)
            const preview = jsonPreview.length > 200 ? jsonPreview.substring(0, 200) + '...' : jsonPreview
            throw new Error(`Path "${this.path}" not found in JSON. Received: ${preview}`)
        }

        return typeof value === 'string' ? value : JSON.stringify(value)
    }
}

/**
 * Node implementation for JSON Path Extractor tool
 */
class JSONPathExtractor_Tools implements INode {
    label: string
    name: string
    version: number
    type: string
    icon: string
    category: string
    description: string
    baseClasses: string[]

View on GitHub (pinned to abe4a8601a)

Solutions

  1. Inspect the preview in the error message — it shows the real keys present; correct the path to match an existing key.
  2. If the missing path is a legitimate optional field, enable returnNullOnError.
  3. For arrays, confirm the index is in bounds; for nested paths, walk one segment at a time to find where get diverges.
  4. Guard upstream: if the source is an API, assert its schema (zod) so drift is caught before extraction.

Example fix

// before — path mismatched after API rename
new JSONPathExtractorTool('user.address.zip', false)
// after
new JSONPathExtractorTool('user.location.zip', false)
Defensive patterns

Strategy: validation

Validate before calling

function assertPathExists(data: any, path: string) {
  if (get(data, path) === undefined) {
    throw new Error(`path '${path}' absent in data; keys: ${Object.keys(data ?? {}).slice(0,10).join(', ')}`)
  }
}

Type guard

function pathResolves(data: unknown, path: string): boolean {
  return get(data, path) !== undefined
}

Try / catch

try {
  return await extractor.invoke({ json })
} catch (e) {
  if (e instanceof Error && e.message.includes('not found in JSON')) {
    // inspect the preview, correct the path, or enable returnNullOnError
    return enableNullModeAndRetry(extractor, json)
  }
  throw e
}

Prevention

When it happens

Trigger: Path references a field that doesn't exist (user.address.zipcode when payload has user.location.zip), a numeric index out of bounds (items[5] on a 3-element array), a typo in the path, or upstream schema change where a key was renamed. The preview helps confirm whether data is empty {} vs. mis-shaped.

Common situations: API response schema changed without updating the extractor path; the upstream tool returned an error envelope {error:...} instead of the expected {data:...}; an array path used when the payload is a single object; case mismatch (Name vs name).

Related errors


AI-assisted analysis of FlowiseAI/Flowise@abe4a8601a (2026-08-12). Data as JSON: /api/errors/fb6b00ad0e946638. Report an issue: GitHub.