code: def resolve_workflow_name(obj, name):
      project = current.get("project_name")
      obj._is_workflow_name_modified = False
      if project:
          if name:
              raise MetaflowException(
                  "--name is not supported for @projects. Use --branch instead."
              )
          workflow_name = current.project_flow_name
          project_branch = to_bytes(
              ".".join((project, current.branch_name))
          )
          token_prefix = (
              "mfprj-%s"
              % to_unicode(
                  base64.b32encode(sha1(project_branch).digest())
              )[:16]
          )
          is_project = True
          # Argo Workflow names can't be longer than 253 characters, so we truncate
          # by default. Also, while project and branch allow for underscores, Argo
          # Workflows doesn't (DNS Subdomain names as defined in RFC 1123) - so we will
          # remove any underscores as well as convert the name to lower case.
          # Also remove + and @ as not allowed characters, which can be part of the
          # project branch due to using email addresses as user names.
          if len(workflow_name) > 253:
              name_hash = to_unicode(
                  base64.b32encode(
                      sha1(to_bytes(workflow_name)).digest()
                  )
              )[:8].lower()
              workflow_name = "%s-%s" % (workflow_name[:242], name_hash)
              obj._is_workflow_name_modified = True
          if not VALID_NAME.search(workflow_name):
              workflow_name = sanitize_for_argo(workflow_name)
              obj._is_workflow_name_modified = True
      else:
          if name and not VALID_NAME.search(name):
              raise MetaflowException(
                  "Name '%s' contains invalid characters. The "
                  "name must consist of lower case alphanumeric characters, '-' or '.'"
                  ", and must start and end with an alphanumeric character."
                  % name
              )
  
          workflow_name = name if name else current.flow_name
          token_prefix = workflow_name
          is_project = False
  
          if len(workflow_name) > 253:
              msg = (
                  "The full name of the workflow:\n*%s*\nis longer than 253 "
                  "characters.\n\n"
                  "To deploy this workflow to Argo Workflows, please "
                  "assign a shorter name\nusing the option\n"
                  "*argo-workflows --name <name> create*."
                  % workflow_name
              )
              raise ArgoWorkflowsNameTooLong(msg)
  
          if not VALID_NAME.search(workflow_name):
              workflow_name = sanitize_for_argo(workflow_name)
              obj._is_workflow_name_modified = True
  
      return workflow_name, token_prefix.lower(), is_project
  
imports: import base64
  import json
  import platform
  import re
  import sys
  from hashlib import sha1
  from metaflow import JSONType, current, decorators, parameters
  from metaflow._vendor import click
  from metaflow.exception import MetaflowException, MetaflowInternalError
  from metaflow.metaflow_config import ARGO_WORKFLOWS_UI_URL, KUBERNETES_NAMESPACE, SERVICE_VERSION_CHECK, UI_URL
  from metaflow.package import MetaflowPackage
  from metaflow.plugins.aws.step_functions.production_token import load_token, new_token, store_token
  from metaflow.plugins.environment_decorator import EnvironmentDecorator
  from metaflow.plugins.kubernetes.kubernetes_decorator import KubernetesDecorator
  from metaflow.tagging_util import validate_tags
  from metaflow.util import get_username, to_bytes, to_unicode, version_parse
  from .argo_workflows import ArgoWorkflows
label_desc: Use image node_id 6 for calling a global function with example usage: resolve_workflow_name(obj, name) and returns: workflow_name,  token_prefix,  is_project