> ## Documentation Index
> Fetch the complete documentation index at: https://interlocklabsinc.mintlify.site/llms.txt
> Use this file to discover all available pages before exploring further.

# DAG

### set\_logger

<ParamField body="logger" type="logging.Logger" required>
  Sets a logger for this DAG. Throws error if not a valid logger.
</ParamField>

### is\_node

<ParamField body="node" type="Node" required>
  The node to check.
</ParamField>

<ResponseField name="" type="bool">
  Returns boolean indicating whether the node is a `Node`.
</ResponseField>

### add\_node

<ParamField body="node" type="Node" required>
  The node to set as the root. Adds to `nodes` if not added already. Throws error if not a valid node.
</ParamField>

### remove\_node

<ParamField body="node" type="Node" required>
  The node to remove. Throws errors if not a valid node or if the node is not in the graph.
</ParamField>

### get\_node

<ParamField body="node_id" type="str" required>
  The node id to get. Throws error if not a valid id or if node not in graph.
</ParamField>

### add\_edge

<ParamField body="from_node" type="Node" required>
  The node to add the edge from. Throws error if not a valid node or if node not in graph.
</ParamField>

<ParamField body="to_node" type="Node" required>
  The node to add the edge to. Throws error if not a valid node, if node not in graph, or if there's a cycle.
</ParamField>

<ParamField body="fn" type="Callable[[dict[str:type]], dict[str:type]]">
  A function to transform the outputs of `from_node` for `to_node`. Defaults to `lambda x: x`.
</ParamField>

### remove\_edge

<ParamField body="from_node" type="Node" required>
  The node to add the edge from. Throws error if not a valid node or if node not in graph.
</ParamField>

<ParamField body="to_node" type="Node" required>
  The node to add the edge to. Throws error if not a valid node, if node not in graph, or if there's a cycle.
</ParamField>

### execute

Topologically sorts the graph and runs it.

<ParamField body="init_source_nodes" type="dict[str:type]" required>
  A dictionary of node\_id keys -> its initial args and kwargs, which will be set to `execute_args` once the DAG runs.

  ```
      init_source_nodes = {
          node_1.get_id(): {
              "kwargs": {
                  "limit": 1
              }
          },
          node_2.get_id(): {
              "kwargs": {
                  "color": "red",
                  "fill_in": False
              }
          },
      }
  ```
</ParamField>
