code: def test_pipeline_interpolates_callback_outputs(
      sagemaker_session_mock,
  ):
      parameter = ParameterString("MyStr")
      custom_step = CustomStep("TestStep")
      outputParam1 = CallbackOutput(
          output_name="output1",
          output_type=CallbackOutputTypeEnum.String,
      )
      outputParam2 = CallbackOutput(
          output_name="output2",
          output_type=CallbackOutputTypeEnum.String,
      )
      cb_step1 = CallbackStep(
          name="MyCallbackStep1",
          depends_on=["TestStep"],
          sqs_queue_url="https://sqs.us-east-2.amazonaws.com/123456789012/MyQueue",
          inputs={"arg1": "foo"},
          outputs=[outputParam1],
      )
      cb_step2 = CallbackStep(
          name="MyCallbackStep2",
          depends_on=["TestStep"],
          sqs_queue_url="https://sqs.us-east-2.amazonaws.com/123456789012/MyQueue",
          inputs={"arg1": outputParam1},
          outputs=[outputParam2],
      )
  
      pipeline = Pipeline(
          name="MyPipeline",
          parameters=[parameter],
          steps=[cb_step1, cb_step2, custom_step],
          sagemaker_session=sagemaker_session_mock,
      )
  
      assert json.loads(pipeline.definition()) == {
          "Version": "2020-12-01",
          "Metadata": {},
          "Parameters": [{"Name": "MyStr", "Type": "String"}],
          "PipelineExperimentConfig": {
              "ExperimentName": {"Get": "Execution.PipelineName"},
              "TrialName": {"Get": "Execution.PipelineExecutionId"},
          },
          "Steps": [
              {
                  "Name": "MyCallbackStep1",
                  "Type": "Callback",
                  "Arguments": {"arg1": "foo"},
                  "DependsOn": ["TestStep"],
                  "SqsQueueUrl": "https://sqs.us-east-2.amazonaws.com/123456789012/MyQueue",
                  "OutputParameters": [
                      {"OutputName": "output1", "OutputType": "String"}
                  ],
              },
              {
                  "Name": "MyCallbackStep2",
                  "Type": "Callback",
                  "Arguments": {
                      "arg1": {
                          "Get": "Steps.MyCallbackStep1.OutputParameters['output1']"
                      }
                  },
                  "DependsOn": ["TestStep"],
                  "SqsQueueUrl": "https://sqs.us-east-2.amazonaws.com/123456789012/MyQueue",
                  "OutputParameters": [
                      {"OutputName": "output2", "OutputType": "String"}
                  ],
              },
              {
                  "Name": "TestStep",
                  "Type": "Training",
                  "Arguments": {},
              },
          ],
      }
      adjacency_list = PipelineGraph.from_pipeline(
          pipeline
      ).adjacency_list
      assert ordered(adjacency_list) == ordered(
          {
              "MyCallbackStep1": [],
              "MyCallbackStep2": [],
              "TestStep": ["MyCallbackStep1", "MyCallbackStep2"],
          }
      )
  
file_path: sagemaker-python-sdk/tests/unit/sagemaker/workflow/test_callback_step.py
imports: from __future__ import absolute_import
  import json
  import pytest
  from mock import Mock
  from sagemaker.workflow.parameters import ParameterInteger, ParameterString
  from sagemaker.workflow.pipeline import Pipeline, PipelineGraph
  from sagemaker.workflow.callback_step import CallbackStep, CallbackOutput, CallbackOutputTypeEnum
  from tests.unit.sagemaker.workflow.helpers import CustomStep, ordered
label_desc: Use image node_id 5 for calling a global function with example usage: test_pipeline_interpolates_callback_outputs(sagemaker_session_mock) without return types