diff --git a/app/routers/recipes.py b/app/routers/recipes.py index 11bf016..e98859b 100644 --- a/app/routers/recipes.py +++ b/app/routers/recipes.py @@ -374,6 +374,7 @@ async def run_recipe( # Variable inputs can be referenced by: node_id, config.name, config.input (if string) input_name_to_node = {} for node_id, node in nodes.items(): + logger.debug(f"Checking node {node_id}: type={node.get('node_type')}, config={node.get('config')}") if node.get("node_type") == "SOURCE": config = node.get("config", {}) # Only variable inputs (those with 'input' in config, not fixed assets) @@ -391,6 +392,9 @@ async def run_recipe( input_name_to_node[node["name"]] = node_id input_name_to_node[node["name"].replace("-", "_")] = node_id + logger.info(f"Input name to node mapping: {input_name_to_node}") + logger.info(f"User-provided inputs: {req.inputs}") + # Map user-provided input names to content hashes (for variable inputs) for input_name, cid in req.inputs.items(): # Try direct node ID match first @@ -400,6 +404,7 @@ async def run_recipe( if "config" not in node: node["config"] = {} node["config"]["cid"] = cid + logger.info(f"Bound input {input_name} directly to node, cid={cid[:16]}...") # Try input name lookup elif input_name in input_name_to_node: node_id = input_name_to_node[input_name] @@ -407,6 +412,14 @@ async def run_recipe( if "config" not in node: node["config"] = {} node["config"]["cid"] = cid + logger.info(f"Bound input {input_name} via lookup to node {node_id}, cid={cid[:16]}...") + else: + logger.warning(f"Input {input_name} not found in nodes or input_name_to_node") + + # Log final DAG nodes for debugging + for nid, n in nodes.items(): + if n.get("node_type") == "SOURCE": + logger.info(f"Final SOURCE node {nid}: config={n.get('config')}") # Transform output to output_id if "output" in dag_copy: