def outputs_to_condition(outputs):
    """
    Converts list of automation (script/integration) outputs to condition (for verify outputs task)

    Args:
        outputs: list of dict, contains contextPath for each output

    Returns:
        list of conditions generated from outputs
    """
    conditions = []
    for output in outputs:
        context_output_path = output.get('contextPath')

        operator = 'isExists' if output.get('type', '') == 'Boolean' else 'isNotEmpty'

        conditions.append(
            [
                {
                    "operator": operator,
                    "left": {
                        "value": {
                            "simple": context_output_path
                        },
                        "iscontext": True
                    }
                }
            ]
        )

    condition = [
        {
            'label': 'yes',
            'condition': conditions
        }
    ]
    return condition