code: def add_node(self, node):
          
          node._finalize()
          node.in_workflow = self
          self._adag.addJob(node._dax_node)
  
          # Determine the parent child relationships based on the inputs that
          # this node requires.
          added_nodes = []
          for inp in node._inputs:
              if inp.node is not None and inp.node.in_workflow == self:
                  if inp.node not in added_nodes:
                      parent = inp.node._dax_node
                      child = node._dax_node
                      dep = dax.Dependency(parent=parent, child=child)
                      self._adag.addDependency(dep)
                      added_nodes.append(inp.node)
  
              elif inp.node is not None and not inp.node.in_workflow:
                  raise ValueError('Parents of this node must be added to the '
                                   'workflow first.')
  
              elif inp.node is None and not inp.workflow_input:
                  self._inputs += [inp]
                  inp.workflow_input = True
  
              elif inp.node is not None and inp.node.in_workflow != self and inp not in self._inputs:
                  self._inputs += [inp]
                  self._external_workflow_inputs += [inp]
  
  
          # Record the outputs that this node generates
          self._outputs += node._outputs
  
          # Record the executable that this node uses
          if not node.executable.in_workflow:
              node.executable.in_workflow = True
              self._executables += [node.executable]
  
          return self
docs: Add a node to this workflow
  
          This function adds nodes to the workflow. It also determines
          parent/child relations from the DataStorage inputs to this job.
  
          Parameters
          ----------
          node : pycbc.workflow.pegasus_workflow.Node
              A node that should be executed as part of this workflow.