{"record":{"id":"4711ed8e396f04fa","repo":"ScrapeGraphAI/Scrapegraph-ai","slug":"error-parsing-input-keys-for-self-node-name","errorCode":null,"errorMessage":"Error parsing input keys for {self.node_name}","messagePattern":"Error parsing input keys for (.+?)","errorType":"exception","errorClass":"ValueError","httpStatus":null,"severity":"error","filePath":"scrapegraphai/nodes/base_node.py","lineNumber":117,"sourceCode":"        \"\"\"\n        Determines the necessary state keys based on the input specification.\n\n        Args:\n            state (dict): The current state of the graph used to parse input keys.\n\n        Returns:\n            List[str]: A list of input keys required for node operation.\n\n        Raises:\n            ValueError: If error occurs in parsing input keys.\n        \"\"\"\n\n        try:\n            input_keys = self._parse_input_keys(state, self.input)\n            self._validate_input_keys(input_keys)\n            return input_keys\n        except ValueError as e:\n            raise ValueError(f\"Error parsing input keys for {self.node_name}\") from e\n\n    def _validate_input_keys(self, input_keys):\n        \"\"\"\n        Validates if the provided input keys meet the minimum length requirement.\n\n        Args:\n            input_keys (List[str]): The list of input keys to validate.\n\n        Raises:\n            ValueError: If the number of input keys is less than the minimum required.\n        \"\"\"\n\n        if len(input_keys) < self.min_input_len:\n            raise ValueError(\n                f\"\"\"{self.node_name} requires at least {self.min_input_len} input keys,\n                  got {len(input_keys)}.\"\"\"\n            )\n","sourceCodeStart":99,"sourceCodeEnd":135,"githubUrl":"https://github.com/ScrapeGraphAI/Scrapegraph-ai/blob/532dfffbf6ee823a6c9cf8cfedc24a93bf026780/scrapegraphai/nodes/base_node.py#L99-L135","documentation":"get_input_keys wraps _parse_input_keys and _validate_input_keys in a try/except ValueError and re-raises with the node name prefixed. So the real cause (empty input expression, expression matching no state keys, or too few input keys) is in the __cause__ exception; the message itself only tells you which node failed.","triggerScenarios":"A node whose input expression (e.g. 'url| local_dir') contains no keys present in the current state, or a state key referenced by the expression was renamed upstream; raised during execute/_async_execute when the node asks for its inputs.","commonSituations":"Custom graphs where an earlier node does not emit the key a later node expects; typos in the input pipe expression; reusing a node with a state produced by a different graph; passing the wrong initial state dict to graph.execute.","solutions":["Inspect the chained exception (e.__cause__) or enable debug logging to see the underlying parse error.","Compare the node's input expression against the keys actually present in state at that step (log state.keys()).","Fix the upstream node so it writes the expected key, or update the input expression to use the correct key name.","Ensure graph.execute receives the required initial keys (e.g. user_prompt, url)."],"exampleFix":"# before\nparse_node = ParseNode(input='user_promt| doc', ...)  # typo, state has user_prompt\n\n# after\nparse_node = ParseNode(input='user_prompt| doc', ...)","handlingStrategy":"validation","validationCode":"def input_keys_resolvable(node, state: dict) -> bool:\n    try:\n        keys = node._parse_input_keys(state, node.input)\n        node._validate_input_keys(keys)\n        return True\n    except ValueError:\n        return False\n\nassert input_keys_resolvable(node, expected_state), f'{node.node_name} input expression won\\'t match state'","typeGuard":null,"tryCatchPattern":"try:\n    final_state, info = graph.execute(inputs)\nexcept ValueError as e:\n    if 'Error parsing input keys' in str(e):\n        logger.error('state keys at failure: %s', set(inputs))\n        raise","preventionTips":["Align input expressions with the exact state keys produced upstream.","Log state.keys() in custom nodes before consuming inputs.","Unit-test nodes with realistic state dicts."],"tags":["state-keys","input-parsing","node","wrapper-exception"],"backgroundTag":"missing-state-key","analyzedSha":"532dfffbf6ee823a6c9cf8cfedc24a93bf026780","analyzedAt":"2026-08-28T15:19:38.821Z","schemaVersion":2},"datasetVersion":"2026-08-28T16:17:29.566Z"}