code: def add_action(
      self, context: AuthedServiceContext, action: Action
  ) -> Union[NodeActionData, SyftError]:
      # Create a node for the action
      (
          input_uids,
          output_uid,
      ) = self._extract_input_and_output_from_action(action=action)
      node = NodeActionData.from_action(
          action=action, credentials=context.credentials
      )
  
      result = self.store.set(
          credentials=context.credentials,
          node=node,
          parent_uids=input_uids,
      )
  
      if result.is_err():
          return SyftError(message=result.err())
  
      action_node = result.ok()
  
      if action_node.is_mutagen:
          # updated non-mutated successor for all nodes between
          # node_id and nm_successor_id
          result = self.store.update_non_mutated_successor(
              node_id=action.remote_self.id,
              nm_successor_id=action_node.id,
              credentials=context.credentials,
          )
      else:
          # Create a node for the result object
          node = NodeActionData(
              id=output_uid,
              user_verify_key=context.credentials,
              type=NodeType.ACTION_OBJECT,
          )
  
          result = self.store.set(
              credentials=context.credentials,
              node=node,
              parent_uids=[action.id],
          )
  
      if result.is_err():
          return SyftError(message=result.err())
  
      result_node = result.ok()
  
      return action_node, result_node
  
imports: from typing import List
  from typing import Tuple
  from typing import Union
  from pydantic.error_wrappers import ValidationError
  from ...node.credentials import SyftVerifyKey
  from ...serde.serializable import serializable
  from ...store.document_store import PartitionKey
  from ...store.document_store import QueryKeys
  from ...types.uid import UID
  from ..code.user_code import UserVerifyKeyPartitionKey
  from ..context import AuthedServiceContext
  from ..response import SyftError
  from ..response import SyftSuccess
  from ..service import AbstractService
  from ..service import service_method
  from .action_graph import ActionGraphStore
  from .action_graph import ExecutionStatus
  from .action_graph import NodeActionData
  from .action_graph import NodeActionDataUpdate
  from .action_graph import NodeType
  from .action_object import Action
  from .action_object import ActionObject
label_desc: Use image node_id 2 for calling the ActionGraphService obj's underlying member method code with example usage: obj.add_action(context, action) and returns: action_node,  result_node, SyftError, SyftError