@staticmethod
def envelope(message_type, input_message, log, success, output, error_message):
    """
        Creates an output message of a step's execution.

        :param message_type: The message type
        :param input_message: The input message
        :param log: The log of the step, as a single string
        :param success: whether or not the step was successful
        :param output: The step data output
        :param error_message: An error message if an error was thrown
        :return: An output message
        """
    output_message = {'log': log, 'status': 'ok' if success else 'error',
        'meta': input_message['body'].get('meta', None)}
    if success:
        output_message['output'] = output
    else:
        output_message['error'] = error_message
    return {'body': output_message, 'version': 'v1', 'type': message_type}
