code: def run_pipeline(pipeline,
                   context,
                   pipeline_context_input=None,
                   parse_input=True):
      
      logger.debug("starting")
  
      try:
          if parse_input:
              logger.debug("executing context_parser")
              prepare_context(pipeline=pipeline,
                              context_in_string=pipeline_context_input,
                              context=context)
          else:
              logger.debug("skipping context_parser")
  
          # run main steps
          pypyr.stepsrunner.run_step_group(
              pipeline_definition=pipeline,
              step_group_name='steps',
              context=context)
  
          # if nothing went wrong, run on_success
          logger.debug("pipeline steps complete. Running on_success steps now.")
          pypyr.stepsrunner.run_step_group(
              pipeline_definition=pipeline,
              step_group_name='on_success',
              context=context)
      except Exception:
          # yes, yes, don't catch Exception. Have to, though, to run the failure
          # handler. Also, it does raise it back up.
          logger.error("Something went wrong. Will now try to run on_failure.")
  
          # failure_step_group will log but swallow any errors
          pypyr.stepsrunner.run_failure_step_group(
              pipeline=pipeline,
              context=context)
          logger.debug("Raising original exception to caller.")
          raise
  
      logger.debug("done")
docs: Run the specified pypyr pipeline.
  
      This function runs the actual pipeline. If you are running another
      pipeline from within a pipeline, call this, not main(). Do call main()
      instead for your 1st pipeline if there are pipelines calling pipelines.
  
      Pipeline and context should be already loaded.
  
      Args:
          pipeline (dict): Dictionary representing the pipeline.
          context (pypyr.context.Context): Reusable context object.
          pipeline_context_input (str): Initialize the pypyr context with this
                                  string.
          parse_input (bool): run context_parser in pipeline.
  
      Returns:
          None