code: def test_successful_workflow(workflow_start_regular):
      user_task_metadata = {"k1": "v1"}
      user_run_metadata = {"k2": "v2"}
      task_id = "simple_task"
      workflow_id = "simple"
  
      @workflow.options(task_id=task_id, metadata=user_task_metadata)
      @ray.remote
      def simple():
          time.sleep(2)
          return 0
  
      workflow.run(
          simple.bind(),
          workflow_id=workflow_id,
          metadata=user_run_metadata,
      )
  
      workflow_metadata = workflow.get_metadata("simple")
      assert workflow_metadata["status"] == "SUCCESSFUL"
      assert workflow_metadata["user_metadata"] == user_run_metadata
      assert "start_time" in workflow_metadata["stats"]
      assert "end_time" in workflow_metadata["stats"]
      assert (
          workflow_metadata["stats"]["end_time"]
          >= workflow_metadata["stats"]["start_time"] + 2
      )
  
      task_metadata = workflow.get_metadata("simple", "simple_task")
      assert task_metadata["user_metadata"] == user_task_metadata
      assert "start_time" in task_metadata["stats"]
      assert "end_time" in task_metadata["stats"]
      assert (
          task_metadata["stats"]["end_time"]
          >= task_metadata["stats"]["start_time"] + 2
      )
  
file_path: ray/python/ray/workflow/tests/test_metadata.py
imports: import time
  from ray.tests.conftest import *
  import pytest
  import ray
  from ray import workflow
label_desc: Use image node_id 6 for calling a global function with example usage: test_successful_workflow(workflow_start_regular) and returns: int