{"record":{"id":"fc7f1d9dbecc7e03","repo":"ScrapeGraphAI/Scrapegraph-ai","slug":"the-graphviz-library-is-required-for-this-functi","errorCode":null,"errorMessage":"The 'graphviz' library is required for this functionality. Please install it from 'https://graphviz.org/download/'.","messagePattern":"The 'graphviz' library is required for this functionality\\. Please install it from 'https://graphviz\\.org/download/'\\.","errorType":"exception","errorClass":"ImportError","httpStatus":null,"severity":"error","filePath":"scrapegraphai/builders/graph_builder.py","lineNumber":150,"sourceCode":"            dict: A JSON representation of the graph configuration.\n        \"\"\"\n        return self.chain.invoke(self.prompt)\n\n    @staticmethod\n    def convert_json_to_graphviz(json_data, format: str = \"pdf\"):\n        \"\"\"\n        Converts a JSON graph configuration to a Graphviz object for visualization.\n\n        Args:\n            json_data (dict): A JSON representation of the graph configuration.\n\n        Returns:\n            graphviz.Digraph: A Graphviz object representing the graph configuration.\n        \"\"\"\n        try:\n            import graphviz\n        except ImportError:\n            raise ImportError(\n                \"The 'graphviz' library is required for this functionality. \"\n                \"Please install it from 'https://graphviz.org/download/'.\"\n            )\n\n        graph = graphviz.Digraph(\n            comment=\"ScrapeGraphAI Generated Graph\",\n            format=format,\n            node_attr={\"color\": \"lightblue2\", \"style\": \"filled\"},\n        )\n\n        graph_config = json_data[\"text\"][0]\n\n        # Retrieve nodes, edges, and the entry point from the JSON data\n        nodes = graph_config.get(\"nodes\", [])\n        edges = graph_config.get(\"edges\", [])\n        entry_point = graph_config.get(\"entry_point\")\n\n        for node in nodes:","sourceCodeStart":132,"sourceCodeEnd":168,"githubUrl":"https://github.com/ScrapeGraphAI/Scrapegraph-ai/blob/532dfffbf6ee823a6c9cf8cfedc24a93bf026780/scrapegraphai/builders/graph_builder.py#L132-L168","documentation":"GraphIteratorNode raises this ValueError in its async execution path when node_config has no 'graph_instance'. The node fans out one graph instance per URL for concurrent scraping, so it must be told which graph class to clone; without it there is nothing to execute.","triggerScenarios":"Configuring GraphIteratorNode without node_config['graph_instance'], passing None explicitly, or passing an instance instead of the class (though the None check here fires only when the key is missing/None).","commonSituations":"Copy-pasting a SmartScraperGraph config into a ScriptScraperMultisourceGraph or similar iterator-based graph and dropping the graph_instance entry; assuming the node reuses the parent graph automatically.","solutions":["Provide the graph class under node_config['graph_instance'] (e.g. a lambda/class reference like SmartScraperGraph).","Also pass 'scraper_config' with the LLM/embeddings config so the cloned graphs are fully configured.","Check the examples/ folder for the specific iterator graph to confirm the expected config shape."],"exampleFix":"# before\nnode_config = {\"scraper_config\": scraper_config}\n\n# after\nfrom scrapegraphai.graphs import SmartScraperGraph\nnode_config = {\n    \"graph_instance\": SmartScraperGraph,\n    \"scraper_config\": scraper_config,\n}","handlingStrategy":"validation","validationCode":"if not node_config.get(\"graph_instance\"):\n    raise ValueError(\"node_config['graph_instance'] must be the graph class to fan out\")","typeGuard":"def has_graph_instance(node_config: dict) -> bool:\n    return callable(node_config.get(\"graph_instance\"))","tryCatchPattern":"try:\n    result = iterator_graph.run()\nexcept ValueError as e:\n    if \"graph instance is required\" in str(e):\n        # add graph_instance to node_config and retry\n        ...","preventionTips":["Always pair GraphIteratorNode with both 'graph_instance' and 'scraper_config' in node_config.","Copy config shapes from the official examples/ folder for iterator-based graphs."],"tags":["config","graph-pipeline","concurrency","missing-config"],"backgroundTag":"missing-config-value","analyzedSha":"532dfffbf6ee823a6c9cf8cfedc24a93bf026780","analyzedAt":"2026-08-28T15:19:38.821Z","schemaVersion":2},"datasetVersion":"2026-08-28T16:17:29.566Z"}