> For the complete documentation index, see [llms.txt](https://docs.vergeos-demo.com/llms.txt). Markdown versions of documentation pages are available by appending `.md` to page URLs; this page is available as [Markdown](https://docs.vergeos-demo.com/knowledge-base/automation-api/automated-task-example-1.md).

# Automated Task Example - Power on/off VMs Automatically as Needed

## Automated Task Example

{% hint style="info" %}
**Key Points**

* The ***VergeOS Task Engine*** allows you to automate operations, triggered by specific events or scheduled times. Using modular, reusable components (tasks, events, schedules, and webhooks) you can easily configure automation tailored to your environment.
* The following example displays the use of tags, tasks, events and schedules used together to seamlessly bring workloads online and offline as they are needed, improving resource efficiency.
  {% endhint %}

#### Use Case

User JThompson relies on multiple GPU-powered virtual machines to perform 3D modeling and animation work. These VMs consume significant compute and memory resources, and leaving them running when idle is wasteful.

By configuring automation to power them on only when needed - when JThompson logs into the system, and to shut them down when the user logs out or at a scheduled time (for example, every Friday at 6pm), we can ensure that resources are available exactly when needed while avoiding unnecessary usage.

The automation consists of creating tags, defining tasks, and attaching event and schedule triggers. The steps below walk you through the full configuration:

{% hint style="info" %}
**1. Create a Tag Category and Tag**

**A tag category organizes related tags. We then create a specific tag within that category to designate the VMs to control with this automation.**

***System > Tags > New***

<img src="/files/L3ABODAzLqJabzWxDNQ1" alt="Create tag category - Light Mode" data-size="original"><img src="/files/Q5hiCsuUJ0AQOSrA6Lh0" alt="Create tag category - Dark Mode" data-size="original">

**Double-click category created above >** ***New***

<img src="/files/SvqDSCGBYieNrvehtNTJ" alt="New tag - Light Mode" data-size="original">

<img src="/files/TcIQ2ICq2t2BexoWcEiI" alt="New tag - Dark Mode" data-size="original">
{% endhint %}

{% hint style="info" %}
**2. Assign the Tag to the VMs to Automatically Power On/Off**

**This will identify the VMs that should be controlled by the automation.**

***Virtual Machines > List >*** **select VMs >** ***Assign Tags*** **> select the tag from above**

<img src="/files/qDoB5FZIUHf19VU9E06B" alt="Assign tag to VMs - Light Mode" data-size="original">

<img src="/files/U6lm27KNBOPYfkDqBSYM" alt="Assign tag to VMs - Dark Mode" data-size="original">

The VMs will now show the assigned tag in the ***Tags*** column.

<img src="/files/by8ku0sNeR5wrQlIbi3p" alt="VMs with tag - Light Mode" data-size="original">

<img src="/files/hMFe8WyiR1ayeNnAOvhT" alt="VMs with tag - Dark Mode" data-size="original">
{% endhint %}

{% hint style="info" %}
**3. Create a Task to Power On VMs**

**This task defines the action of starting up the tagged virtual machines.**

***System > Tasks Dashboard > New Task***

<img src="/files/QH9C686QAKkvhLSX2mjz" alt="Task to power on tagged VMs - Light Mode" data-size="original">

<img src="/files/g8INpvmi6NPT5Pfdckow" alt="Task to power on tagged VMs  - Dark Mode" data-size="original">
{% endhint %}

{% hint style="info" %}
**4. Configure an Event Trigger for User Login**

**Here we define the activity that will invoke the task (JThompson logs into the system).**

From the new task dashboard: ***Event Triggers > New***

<img src="/files/thGW7xFo5SlFbiOnewaf" alt="Event trigger user login - Light Mode" data-size="original">

<img src="/files/lBj3DXreQDzq8lIQecu3" alt="Event trigger user login - Dark Mode" data-size="original">
{% endhint %}

{% hint style="info" %}
**5. Create a Task to Power Off the VMs**

**This defines the action of powering down the tagged virtual machines.**

***System > Tasks Dashboard > New Task***

<img src="/files/fECIWoFYjohzqlEqqB8r" alt="Task to power off tagged VMs - Light Mode" data-size="original">

<img src="/files/BW0PXoW1SkyOyTzfw5dE" alt="Task to power off tagged VMs - Dark Mode" data-size="original">
{% endhint %}

{% hint style="info" %}
**6. Configure an Event Trigger for User Logout**

**This configures the task to launch when JThompson logs out.**

From the new task dashboard:\
\&#xNAN;***Event Triggers > New***

<img src="/files/MXZ751UD58nf6sNYuD8h" alt="Event trigger user logout - Light Mode" data-size="original">

<img src="/files/58Z3cITyhPE1KUBz97sN" alt="Event trigger user logout - Dark Mode" data-size="original">
{% endhint %}

{% hint style="info" %}
**7. Create a Schedule for Fridays at 6:00pm**

**Creating a schedule allows us to define specific dates/times. After creating the schedule it can be applied to our task and other tasks.**

***System > Tasks Dashboard > New Schedule***

<img src="/files/PtwuJZ4uM6u1tuOHqG1P" alt="Schedule COB - Light Mode" data-size="original">

<img src="/files/CZ4LaOaVYsOVefUEv6iF" alt="Schedule COB - Dark Mode" data-size="original">
{% endhint %}

{% hint style="info" %}
**8. Create a Schedule Trigger for the Power Off**

**We apply the schedule (Fridays at 6pm) to the task to automatically power off the VMs every Friday evening.**

From the dashboard of the new task:\
\&#xNAN;***Schedule Triggers > New***

<img src="/files/53QwS5VRRQmfuvb7PBza" alt="Schedule trigger - Light Mode" data-size="original">

<img src="/files/7HEbL7azCv2YOM9aCEWe" alt="Schedule trigger - Dark Mode" data-size="original">
{% endhint %}

### Verification

* Log in as JThompson → tagged VMs should power on automatically
* Log out → VMs should power off
* At Friday 6:00pm → VMs should power off even if the user is still logged in

### Troubleshooting

* If VMs do not power on, verify the tag is assigned to each VM.
* If schedule triggers do not fire, confirm the system time zone is correct.
* If login/logout triggers fail, ensure the user account name matches exactly.

This automation ensures that the GPU‑powered VMs are only active when the designated user is logged in. When the user logs out, or at the scheduled cutoff time (Friday 6pm), the VMs are powered down to conserve resources. The pattern can be applied to other high‑resource workloads such as integration test environments, interactive machine learning, CAD rendering stations, or financial modeling clusters, or any system that benefits from running only when needed.


---

# Agent Instructions
This documentation is published with GitBook. GitBook is the documentation platform designed so that both humans and AI agents can read, navigate, and reason over technical content effectively. Learn more at gitbook.com.

## Querying This Documentation
If you need additional information that is not directly available in this page, you can query the documentation dynamically by asking a question.

Perform an HTTP GET request on the current page URL with the `ask` query parameter:

```
GET https://docs.vergeos-demo.com/knowledge-base/automation-api/automated-task-example-1.md?ask=<question>
```

The question should be specific, self-contained, and written in natural language.
The response will contain a direct answer to the question and relevant excerpts and sources from the documentation.

Use this mechanism when the answer is not explicitly present in the current page, you need clarification or additional context, or you want to retrieve related documentation sections.
