# Key Components

## Executable

Every task is compiled into a single JavaScript executable file that contains all of the functions required to run the task. We go into detail throughout the tutorial. Three functions are required to be defined:

* **Task function** — This function contains the core logic of the task executable and submits the proof of the work done by participating nodes to K2. [Learn more](/getting-started/microservices-and-tasks/task-development-guide/how-to-create-a-task/task-function.md)
* **Audit function** — This function audits other participating nodes. [Learn More](/getting-started/microservices-and-tasks/task-development-guide/executable-structure/validate-node.md)
* **Distribution function** — This function creates the distribution list and submits it on-chain. [Learn More](/getting-started/microservices-and-tasks/task-development-guide/how-to-create-a-task/submit-distribution.md)

## Metadata

The task metadata is structured data that contains information about a Koii task. Node operators can easily learn more details about a specific task by looking at its metadata.

Task Metadata Sample:

```javascript
{
  name: 'Sample Task',
  description: 'This a demo task',
  author: 'KOII-networks',
  githubURL: 'https://github.com',
  imageURL: 'image.png',
  createdAt: '',
  nodeSpec: {
    storage: '',
    cpu: '4',
    memory: '8',
    os: [ 'Linux', 'Windows', 'MacOS' ],
    network: '20'
  }
}
```

There are two types of task metadata:

1. Data that is stored in an IPFS Metadata file - which is done on task creation
   * Task Manager — K2 wallet address of [task creator](/getting-started/koii-software-toolkit-sdk/using-the-cli.md#create-a-koii-wallet).
   * Task description — An optional field for adding a detailed description of the task.
   * Task Name — Name of the task.\\
2. Data that are stored on K2 - updated over time and reflect the latest state of the task


---

# 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/what-are-tasks/key-components.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.
