code: def trigger(obj, run_id_file=None, **kwargs):
      def _convert_value(param):
          # Swap `-` with `_` in parameter name to match click's behavior
          val = kwargs.get(param.name.replace("-", "_").lower())
          if param.kwargs.get("type") == JSONType:
              val = json.dumps(val)
          elif isinstance(val, parameters.DelayedEvaluationParameter):
              val = val(return_str=True)
          return val
  
      params = {
          param.name: _convert_value(param)
          for _, param in obj.flow._get_parameters()
          if kwargs.get(param.name.replace("-", "_").lower())
          is not None
      }
  
      response = StepFunctions.trigger(obj.state_machine_name, params)
  
      id = response["executionArn"].split(":")[-1]
      run_id = "sfn-" + id
  
      if run_id_file:
          with open(run_id_file, "w") as f:
              f.write(str(run_id))
  
      obj.echo(
          "Workflow *{name}* triggered on AWS Step Functions "
          "(run-id *{run_id}*).".format(
              name=obj.state_machine_name, run_id=run_id
          ),
          bold=True,
      )
  
      run_url = (
          "%s/%s/%s" % (UI_URL.rstrip("/"), obj.flow.name, run_id)
          if UI_URL
          else None
      )
  
      if run_url:
          obj.echo(
              "See the run in the UI at %s" % run_url,
              bold=True,
          )
  
imports: import base64
  from metaflow._vendor import click
  from hashlib import sha1
  import json
  import re
  from metaflow import current, decorators, parameters, JSONType
  from metaflow.metaflow_config import SERVICE_VERSION_CHECK, SFN_STATE_MACHINE_PREFIX, UI_URL
  from metaflow.exception import MetaflowException, MetaflowInternalError
  from metaflow.package import MetaflowPackage
  from metaflow.plugins.aws.batch.batch_decorator import BatchDecorator
  from metaflow.tagging_util import validate_tags
  from metaflow.util import get_username, to_bytes, to_unicode, version_parse
  from .step_functions import StepFunctions
  from .production_token import load_token, store_token, new_token
label_desc: Use image node_id 8 for calling a global function with example usage: trigger(obj, run_id_file) and returns: val