def add_plugins_to_install(ctx, plugins_to_install, sequence):
    """Adds a task to the sequence that installs the plugins.
    """
    if not sequence or not ctx or not plugins_to_install:
        return
    sequence.add(ctx.send_event(
        'Installing deployment and workflow plugins'), ctx.execute_task(
        task_name='cloudify_agent.operations.install_plugins', kwargs={
        'plugins': plugins_to_install}))
