def build_workflow_definition()

in src/stepfunctions/template/pipeline/train.py [0:0]


    def build_workflow_definition(self):
        """
        Build the workflow definition for the training pipeline with all the states involved.

        Returns:
            :class:`~stepfunctions.steps.states.Chain`: Workflow definition as a chain of states involved in the the training pipeline.
        """
        default_name = self.pipeline_name

        instance_type = self.estimator.instance_type
        instance_count = self.estimator.instance_count

        training_step = TrainingStep(
            StepId.Train.value,
            estimator=self.estimator,
            job_name=default_name + '/estimator-source',
            data=self.inputs,
        )

        model = self.estimator.create_model()
        model_step = ModelStep(
            StepId.CreateModel.value,
            instance_type=instance_type,
            model=model,
            model_name=default_name
        )

        endpoint_config_step = EndpointConfigStep(
            StepId.ConfigureEndpoint.value,
            endpoint_config_name=default_name,
            model_name=default_name,
            initial_instance_count=instance_count,
            instance_type=instance_type
        )
        deploy_step = EndpointStep(
            StepId.Deploy.value,
            endpoint_name=default_name,
            endpoint_config_name=default_name,
        )

        return Chain([training_step, model_step, endpoint_config_step, deploy_step])