Passer au contenu principal

Construire des automations

Un guide étape par étape pour construire une automatisation à partir de zéro, utilisant un flux de travail de correctif Windows comme exemple.

Mis à jour aujourd’hui

Introduction

Cet article vous guide dans la construction d'une automation à partir de zéro. L'exemple est une automation de patching Windows qui s'exécute selon un calendrier, installe les mises à jour Windows, met à niveau les applications tierces et crée une alerte pour chaque type d'échec.

Chaque concept ici s'applique à toute automation que vous créez — remplacez par un déclencheur différent, des actions différentes et des conditions différentes pour votre propre cas d'utilisation.


Planifiez avant de construire

Before clicking + Créer automation, clou bas trois choses:

  1. Qu'est-ce qui le déclenche?Un calendrier, un événement d'appareil, un changement d'étiquette, un webhook? Cette automation utilise un calendrier récurrent pour le patching sans intervention.

  2. Quels appareils cible-t-il?Les conditions de déclencheur limitent l'exécution — par plateforme, type d'appareil, groupe, version du système d'exploitation ou autres attributs. Ici, une condition Plateforme = Windows sur le déclencheur programmé la limite aux appareils Windows.

  3. Que se passe-t-il en cas d'échec?Le pipeline doit-il s'arrêter ou continuer? Quelqu'un doit-il être notifié? Cette automation capture la sortie d'action dans des variables et utilise des alertes conditionnelles afin que les échecs remontent sans arrêter l'ensemble de l'exécution.


Construire une automation de patching

Étape 1: Créer l'automation

  1. Navigate to Automatisations in the sidebar.

  2. Click + Créer automationdans le coin supérieur droit.

  3. Name it Patching Windows.

  4. Click Create.

Windows Patching

L'automation s'ouvre dansView modeavec un pipeline vide. Rien ne s'exécute jusqu'à ce que vous ajoutiez un déclencheur. Basculez versEdit mode by clicking Modifierdans le coin supérieur droit.


Étape 2: Ajouter l'action Installer les mises à jour Windows

  1. Dans la zone des actions, cliquez sur+ Ajouter une action.

  2. Browse to Sécurité → Installer les mises à jour Windows, ou cherchez-la.

  3. Configurez les paramètres de délai de mise à jour:

Update type

Setting

Mises à jour critiques

Délai de 7 jours

Mises à jour de sécurité

Mettre à jour immédiatement

Mises à jour des définitions

Mettre à jour immédiatement

Update rollups

Délai de 7 jours

Service packs

14 day delay

Tools

Délai de 7 jours

Feature packs

14 day delay

Updates

Délai de 7 jours

Upgrades

Délai de 7 jours

Drivers

Délai de 7 jours

  1. Leave Redémarrer après les mises à jour (si nécessaire) défini sur No.

  2. Leave Boucler jusqu'à complétion défini sur No.

Maintenant, configurez la gestion des échecs et la variable de sortie sousOptions supplémentaires:

  1. Set En cas d'échec d'action to Supprimer et continuer.

  2. Set Tentatives to 2.

  3. In the Output variablechamp, créé une variable appeléePatchingStatus.

  4. Click Enregistrer.

Windows Update Action Configuration

Pourquoi ces paramètres:Supprimer et continuer signifie qu'un échec de patching sur un appareil n'arrête pas le pipeline — les actions ultérieures s'exécutent toujours. La variable de sortie capture le résultat de cette étape afin qu'une action Créer une alerte ultérieure puisse vérifier si elle a échoué. Deux tentatives donnent aux pannes transitoires une chance de se rétablir avant que l'étape ne soit marquée comme échouée.


Étape 3: Ajouter l'action Mettre à niveau les applications tierces

  1. Click + Ajouter une action.

  2. Browse to Gestion des applications → Mettre à niveau le paquet winget.

  3. Leave Packages défini sur Tous les paquets disponibles et Paquets exclus défini sur Aucun paquet exclu.

Cette action utilise winget pour mettre à niveau les logiciels tiers. Cela n'a de sens que sur les stations de travail — ajoutez une condition pour le restreindre:

  • In the Conditionssection, ajouter une condition pourType, définir l'opérateur surÉgal à, and select Workstation.

Winget Conditions

In the Options supplémentaires section:

  1. Set On failure to Supprimer et continuer.

  2. Set Tentatives to 2.

  3. In the Output variablechamp, créer une variableWingetPatchStatus.

  4. Click Enregistrer.

Winget Additional Options

REMARQUE : 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. + Ajouter une action.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. Conditions section, add a condition:Step:

    • Install Windows UpdatesOperator:

    • Égal àValue:

    • ÉchouéLeave

  2. On failure as Échouer le pipeline et Tentatives at 0.Click

  3. Enregistrer.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. + Ajouter une action.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. Conditions, add: Step Upgrade 3rd Party Applications status Égal àÉchoué .Leave

  5. On failure as Échouer le pipeline et Tentatives at 0.Click

  6. Enregistrer.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. Enregistrer.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. Conditions section, add a condition.Select

  3. Plateforme, set the operator to Égal à, and select Windows.Click

  4. Enregistrer.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.

CONSEIL :

After a run, open the Historique 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.FAQDoes 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 Actions 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

  • Espace de travail → Autorisations for details.Workspace → Permissions for details.

Avez-vous trouvé la réponse à votre question ?