# Compile Task

After you've created a task using the K2 task template as a guide, you'll need to compile it with Webpack into a single executable file.

Open up your terminal, and in the directory of your task:

* Run `yarn` to install all dependencies
* Run `yarn webpack` to compile code
* You should see a new directory `/dist`
* Your compiled executable is located in `/dist/main.js`

That's it! You've successfully compiled your task into a single executable file.


---

# 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://koii-network.gitbook.io/getting-started/microservices-and-tasks/task-development-guide/task-development-flow/compile-task.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.
