> For the complete documentation index, see [llms.txt](https://docs.workersforlabview.io/llms.txt). Markdown versions of documentation pages are available by appending `.md` to page URLs; this page is available as [Markdown](https://docs.workersforlabview.io/fundamental-concepts/the-workers-main-vi/default-framework-cases.md).

# Default Framework Cases

The MHL of a Worker's Main VI is required to have these four cases for its proper functioning in the framework (see below).

![The four required framework cases in a Workers MHL](/files/7FEsoObraJXiGsYiZLru)

{% hint style="info" %}
All VIs referenced in this page can be found in the Workers palette in LabVIEW.
{% endhint %}

## Initialize

![MHL \<Initialize> case](/files/dXe6nNkbVTVFDDOUdD9v)

The \<Initialize> case is the first case that is called by the framework in a Workers application. This case receives user-defined initialization data that the Worker requires, sent from the Worker's Caller in the Worker's *Initialization Data.ctl* typedef.

In this case you can perform any initial tasks that requires data received from the Workers *Initialization Data.ctl* typedef.

This case should also be used to write data into the *Initialization Data.ctl* data clusters of this Worker's statically-linked subworkers (if this Worker has any).

The final step required to be performed by this case (or sequence of cases) is for *Initialize subWorkers.vi* to be called, which will call the \<Initialize> case of the Worker's statically-linked subWorkers.

{% hint style="info" %}
**Worker without statically linked subWorkers**

If the Worker contains no statically-linked subWorkers, then the *Initialize subWorkers.vi* will instead call the \<All subWorkers Initialized> case of the Worker.
{% endhint %}

## All subWorkers Initialized

![MHL \<All subWorkers Initialized> case](/files/yHvetvGziOcYuEKGq8Ix)

This case is called by the framework when all of a Worker's statically-linked subWorkers have been successfully initialized. (A Worker will notify its Caller that it has been successfully initialized when its *Initialized Notify.vi* has been called). You can now perform any tasks that are required to be performed now that all the Worker’s statically-linked subWorkers have been initialized.

The final step required to be called by this case (or sequence of cases) is to call *Initialized Notify.vi*. This VI will notify the Worker’s Caller that the Worker has been successfully initialized.

## Start Exiting

![MHL \<Start Exiting> case](/files/KhKs5W2fInQe7zynTvQJ)

Calling the \<Start Exiting> case of a Worker will start the shutdown sequence of the Worker and its subWorkers. This can be done by use of *Worker Start Exiting.vi*.

In this case you can perform any tasks that are required before the shutting down of the Worker's subWorkers.

The final step required to be performed by this case (or sequence of cases) is for *Start Exiting subWorkers.vi* to be called, which will call the \<Start Exiting> case of the Worker's subWorkers.

{% hint style="info" %}
**Worker without subWorkers**

If the Worker contains no subWorkers, then the *Start Exiting subWorkers.vi* will instead call the \<All subWorkers Exiting> case of the Worker.
{% endhint %}

## All subWorkers Exited

![MHL \<All subWorkers Exited> case](/files/fhAipGVYmg3cuWt2Hrfe)

This case is called by the framework when all of a Worker's subWorkers have successfully exited. (A Worker will notify its Caller that it has exited when its *Exited Notify and Cleanup.vi* has been called.) You can now perform any tasks that are required to be performed now that all the Worker’s subWorkers have exited.

The final step required to be called by this case (or sequence of cases) is to call *Exit.vi.* This VI will stop both a Workers MHL and EHL, and then Worker will then exit.


---

# 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, and the optional `goal` query parameter:

```
GET https://docs.workersforlabview.io/fundamental-concepts/the-workers-main-vi/default-framework-cases.md?ask=<question>&goal=<endgoal>
```

`ask` is the immediate question: it should be specific, self-contained, and written in natural language.
`goal` is optional and describes the broader end goal you are ultimately trying to accomplish on behalf of the user. GitBook uses it to tailor the answer towards what is most useful for that goal.

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.
