# Machine Link Events

In a Machine Link project the script code is executed as events that happens during different phases of the project execution.

There two types of event - per telegram and global. The telegram events must be named with the telegram name post fixed. Ie. `PostParseMain_T1` where T1 is the telegram name.

The events are:

<table><thead><tr><th width="301">Name</th><th width="145" data-type="checkbox">Per telegram</th><th>Description</th></tr></thead><tbody><tr><td><a href="/pages/v27Sq6Lm0xsJH3OG56zO">Initialization</a></td><td>false</td><td>Called before anything else</td></tr><tr><td><a href="/pages/v27Sq6Lm0xsJH3OG56zO">Finalization</a></td><td>false</td><td>Called after the execution is complete</td></tr><tr><td><a href="/pages/02jIgnisUUrRgM3GYUIa">OnBeforeOptimization</a></td><td>false</td><td>Only on Optimization G2</td></tr><tr><td><a href="/pages/XoY2sQDap87WMmSvTBcp">PreParseMain</a></td><td>true</td><td></td></tr><tr><td><a href="/pages/l6ibcYrXVkIICsvNOav1">PostParseMain</a></td><td>true</td><td></td></tr><tr><td><a href="/pages/KtWnbyZUipDCi2ecLPR2">ParseChild</a></td><td>true</td><td></td></tr><tr><td><a href="/pages/k5ZoXwnc0py6Z48PALT3">BeforeOutput</a></td><td>true</td><td></td></tr></tbody></table>


---

# Agent Instructions: 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.calwincloud.com/calwin-script/machine-link/machine-link-events.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.
