MCPcopy Create free account
hub / github.com/ScrapeGraphAI/Scrapegraph-ai / _get_next_node

Method _get_next_node

scrapegraphai/graphs/base_graph.py:222–234  ·  view source on GitHub ↗

Determines the next node to execute based on current node type and result.

(self, current_node, result)

Source from the content-addressed store, hash-verified

220 return result, node_exec_time, cb_data
221
222 def _get_next_node(self, current_node, result):
223 """Determines the next node to execute based on current node type and result."""
224 if current_node.node_type == "conditional_node":
225 node_names = {node.node_name for node in self.nodes}
226 if result in node_names:
227 return result
228 elif result is None:
229 return None
230 raise ValueError(
231 f"Conditional Node returned a node name '{result}' that does not exist in the graph"
232 )
233
234 return self.edges.get(current_node.node_name)
235
236 def _execute_standard(self, initial_state: dict) -> Tuple[dict, list]:
237 """

Callers 1

_execute_standardMethod · 0.95

Calls 1

getMethod · 0.80

Tested by

no test coverage detected