# tasks

In the previous section, we saw that tasks needs to have two parameters: `tasks`, and `hooks`:

{% tabs %}
{% tab title="Class-based tasks" %}

```python
# tasks/hello_world.py

import prism.task
import prism.target

class HelloWorld(prism.task.PrismTask):
    
    def run(self, tasks, hooks):
        test_str = "Hello, world!"
        return test_str
```

{% endtab %}

{% tab title="Function-based tasks" %}

```python
# tasks/hello_world.py

from prism.decorators import task

@task()
def hello_world(tasks, hooks):
    test_str = "Hello, world!"
    return test_str
```

{% endtab %}
{% endtabs %}

Both are critical for Prism to run, and Prism **will throw an error if it finds a task without both parameters**.

`tasks` is an instance of the `prism.infra.task_manager.TaskManager` class. At the moment this class has the following functions (see the [API reference](https://docs.runprism.com/v0.2.2/api-reference/taskmanager) for more information):

* [`tasks.ref()`](https://docs.runprism.com/v0.2.2/fundamentals/tasks/tasks/tasks.ref): for referencing the output of other tasks in your project

Next, we'll cover exactly what these functions do.
