Ir al contenido principal

Construir automatizaciones

Un tutorial paso a paso para crear una automatización desde cero, utilizando un flujo de trabajo de parches de Windows como ejemplo.

Actualizado hoy

Introducción

Este artículo lo guía a través de la construcción de una automatización desde cero. El ejemplo es una automatización de parches de Windows que se ejecuta según un cronograma, instala actualizaciones de Windows, actualiza aplicaciones de terceros y crea una alerta para cada tipo de fallo.

Cada concepto aquí se aplica a cualquier automatización que construya: reemplace un disparador diferente, acciones diferentes y condiciones diferentes para su propio caso de uso.


Planifique antes de construir

Before clicking + Crear automatización, clava tres cosas:

  1. ¿Qué lo dispara?¿Un cronograma, un evento de dispositivo, un cambio de etiqueta, un webhook? Esta automatización utiliza un cronograma recurrente para el parche sin intervención.

  2. ¿Qué dispositivos apunta?Las condiciones de disparadores limitan la ejecución: por plataforma, tipo de dispositivo, grupo, versión del sistema operativo u otros atributos. Aquí, una condición Plataforma = Windows en el disparador programado la limita a dispositivos Windows.

  3. ¿Qué sucede cuando algo falla?¿Debería la canalización detenerse o continuar? ¿Debería notificarse a alguien? Esta automatización captura la salida de acciones en variables y utiliza alertas condicionales para que los errores aparezcan sin detener toda la ejecución.


Construir automatización de parches

Paso 1: Crear la automatización

  1. Navigate to Automatizaciones in the sidebar.

  2. Click + Crear automatizaciónen la esquina superior derecha.

  3. Name it Parches de Windows.

  4. Click Create.

Windows Patching

La automatización se abre enView modecon una canalización vacía. Nada se ejecuta hasta que agregue un disparador. Cambie aEdit mode by clicking Editaren la esquina superior derecha.


Paso 2: Agregar la acción Instalar actualizaciones de Windows

  1. En el área de acciones, haga clic+ Añadir una acción.

  2. Browse to Seguridad → Instalar actualizaciones de Windows, o búsquelo.

  3. Configure los parámetros de retraso de actualización:

Update type

Setting

Actualizaciones críticas

Retraso de 7 días

Actualizaciones de seguridad

Actualizar inmediatamente

Actualizaciones de definiciones

Actualizar inmediatamente

Update rollups

Retraso de 7 días

Service packs

14 day delay

Tools

Retraso de 7 días

Feature packs

14 day delay

Updates

Retraso de 7 días

Upgrades

Retraso de 7 días

Drivers

Retraso de 7 días

  1. Leave Reiniciar después de actualizaciones (si es necesario) configurado en No.

  2. Leave Bucle hasta completar configurado en No.

Ahora configure el manejo de errores y la variable de salida enOpciones adicionales:

  1. Set En error de acción to Suprimir y continuar.

  2. Set Reintentos to 2.

  3. In the Output variablecampo, creó una variable llamadaPatchingStatus.

  4. Click Guardar.

Windows Update Action Configuration

Por qué estos parámetros:Suprimir y continuar significa que un error de parche en un dispositivo no detiene la canalización: las acciones posteriores aún se ejecutan. La variable de salida captura el resultado de este paso para que una acción Crear alerta posterior pueda verificar si falló. Dos reintentos le dan a los errores transitorios una oportunidad de recuperarse antes de que el paso se marque como fallido.


Paso 3: Agregar la acción Actualizar aplicaciones de terceros

  1. Click + Añadir una acción.

  2. Browse to Gestión de aplicaciones → Actualizar paquete winget.

  3. Leave Packages configurado en Todos los paquetes disponibles y Paquetes excluidos configurado en Sin paquetes excluidos.

Esta acción utiliza winget para actualizar software de terceros. Solo tiene sentido en estaciones de trabajo: agregue una condición para restringirla:

  • In the Condicionessección, agregue una condición paraType, establezca el operador enIgual a, and select Workstation.

Winget Conditions

In the Opciones adicionales section:

  1. Set On failure to Suprimir y continuar.

  2. Set Reintentos to 2.

  3. In the Output variablecampo, crear una variableWingetPatchStatus.

  4. Click Guardar.

Winget Additional Options

NOTA: Devices where Type ≠ Workstation skip this action entirely and show Skipped in the run history — that's expected, not a failure.Step 4: Add the Windows Patching Failed Alert


Add a Create Alert action that only fires when the Install Windows Updates step failed.

Click

  1. + Añadir una acción.Select

  2. Level → Create alert.Configure the alert:

  3. Title:

    • Description: Windows Patching Failed

    • Severity: Level was unable to patch endpoint after multiple attempts.

    • WarningCustom payload:

    • The ##{{PatchingStatus}}

variable attaches the output from the Install Windows Updates step to the alert. When you review the alert later, the payload shows what actually happened on that device.##{{PatchingStatus}}In the

Windows Patching Alert

  1. Condiciones section, add a condition:Step:

    • Install Windows UpdatesOperator:

    • Igual aValue:

    • FallóLeave

  2. On failure as Error de pipeline y Reintentos at 0.Click

  3. Guardar.This action now only fires on devices where patching failed. Every other device skips it.

Create Alert on Failure

Step 5: Add the Windows 3rd Party Patching Failed Alert


Same pattern as Step 5, but for the winget step.

Click

  1. + Añadir una acción.Select

  2. Level → Create alert.Configure the alert:

  3. Title:

    • Description: Windows 3rd Party Patching Failed

    • Severity: Level was unable to patch some 3rd party software on this endpoint after multiple attempts.

    • WarningCustom payload:

    • In ##{{WingetPatchStatus}}

  4. Condiciones, add: Step Upgrade 3rd Party Applications status Igual aFalló .Leave

  5. On failure as Error de pipeline y Reintentos at 0.Click

  6. Guardar.Step 6: Add Triggers

Winget Create Alert Configuration


Every automation can be run manually. Add a scheduled trigger to also run it automatically on a cadence.

Add the Weekly Trigger

Click

  1. + Add a trigger again.Select

  2. Scheduled → Weekly.Set the schedule to

  3. Monday and Friday at 12:00 AM.Click

  4. Guardar.Now scope the scheduled trigger to Windows devices only:

Weekly Schedule Trigger

Click the

  1. Scheduled → Weekly trigger to open its detail panel.In the

  2. Condiciones section, add a condition.Select

  3. Plataforma, set the operator to Igual a, and select Windows.Click

  4. Guardar.Once a trigger has a condition applied, its pipeline card shows an orange

IF badge. An orange (x) badge on any step means that step is using a variable. You'll see both appear as you build.Step 7: Exit Edit Mode

Action Variables / Conditions


Click

Done in the top right to exit edit mode.The automation is now

Active — the Weekly trigger is live and will fire next on its scheduled day. The status badge in the header updates to Active.How the Pipeline Runs


When the scheduled trigger fires on Monday or Friday at 12 AM:

Level evaluates the trigger condition — Windows devices only

  1. Matching devices enter the pipeline

  2. Install Windows Updates

  3. runs with up to 2 retries on failure; output is captured in Upgrade 3rd Party ApplicationsPatchingStatus

  4. runs next; non-workstation devices skip this step; output is captured in Windows Patching FailedWingetPatchStatus

  5. evaluates its condition — fires only on devices where Install Windows Updates failed, attaching the PatchingStatus output to the alertWindows 3rd Party Patching Failed

  6. does the same for the winget stepEvery device runs through all four steps. The conditional logic on each action determines what actually happens per device.

SUGERENCIA:

After a run, open the Historial tab and click any device row to see per-step outcomes (Success, Skipped, Failed) and duration. Click the > caret on any step to expand its output inline, or the arrow to navigate to the full run detail.Preguntas frecuentesDoes the scheduled trigger run on devices that are offline at 12 AM?


Yes — offline devices are queued and the run starts when they come back online. Add a

  • Status = Online condition to the Weekly trigger if you want to skip offline devices entirely.Can I run this automation on demand without waiting for the scheduled day? Yes — every automation supports manual runs. From the automation's pipeline view, click

  • + Add a device to run it immediately against specific devices, or use the Acciones menu on the device listing to run any automation against a device directly.Why does Upgrade 3rd Party Applications have a Type = Workstation condition? Winget is a Windows package manager typically found on workstations. The condition prevents it from running on servers where winget packages aren't expected, which avoids spurious failures on those devices.

  • The alert actions have "On failure: Fail pipeline" — won't that stop the run? Only after the alert step, which is the last meaningful action in the pipeline. The two patching steps use Suppress and continue so their failures don't block the alert steps from running. If the Create Alert action itself fails, you'd want that flagged — so Fail pipeline is the right setting there.

  • Can I adjust the update delay settings later? Yes. In view mode, click the

  • Install Windows Updates action to open its detail panel, then click Edit act. to reopen the configuration. Adjust and save.Who can run this automation manually? Any technician with access to the devices being targeted. Group-level permissions control which technicians can manage which device groups. See

  • Espacio de trabajo → Permisos for details.Workspace → Permissions for details.

¿Ha quedado contestada tu pregunta?