> For the complete documentation index, see [llms.txt](https://docs.litwizlabs.ai/wizstudio/llms.txt). Markdown versions of documentation pages are available by appending `.md` to page URLs; this page is available as [Markdown](https://docs.litwizlabs.ai/wizstudio/kubeflow/kf-pipelines/hello-world-pipeline.md).

# Hello World Pipeline

Create your first pipeline

To get started with the tutorials, pip install `kfp` v2:

```sh
pip install kfp
```

Here is a simple pipeline that prints a greeting:

```python
from kfp import dsl

@dsl.component
def say_hello(name: str) -> str:
    hello_text = f'Hello, {name}!'
    print(hello_text)
    return hello_text

@dsl.pipeline
def hello_pipeline(recipient: str) -> str:
    hello_task = say_hello(name=recipient)
    return hello_task.output
```

You can [compile the pipeline](https://www.kubeflow.org/docs/components/pipelines/v2/compile-a-pipeline/) to YAML with the KFP SDK DSL [`Compiler`](https://kubeflow-pipelines.readthedocs.io/en/stable/source/compiler.html#kfp.compiler.Compiler):

```python
from kfp import compiler

compiler.Compiler().compile(hello_pipeline, 'pipeline.yaml')
```

The [`dsl.component`](https://kubeflow-pipelines.readthedocs.io/en/stable/source/dsl.html#kfp.dsl.component) and [`dsl.pipeline`](https://kubeflow-pipelines.readthedocs.io/en/stable/source/dsl.html#kfp.dsl.pipeline) decorators turn your type-annotated Python functions into components and pipelines, respectively. The KFP SDK compiler compiles the domain-specific language (DSL) objects to a self-contained pipeline [YAML file](https://www.kubeflow.org/docs/components/pipelines/v2/compile-a-pipeline#ir-yaml).

You can submit the YAML file to a KFP-conformant backend for execution. If you have already deployed a [KFP open source backend instance](https://www.kubeflow.org/docs/components/pipelines/v2/installation/) and obtained the endpoint for your deployment, you can submit the pipeline for execution using the KFP SDK [`Client`](https://kubeflow-pipelines.readthedocs.io/en/stable/source/client.html#kfp.client.Client). The following submits the pipeline for execution with the argument `recipient='World'`:

```python
from kfp.client import Client

client = Client(host='<MY-KFP-ENDPOINT>')
run = client.create_run_from_pipeline_package(
    'pipeline.yaml',
    arguments={
        'recipient': 'World',
    },
)
```

The client will print a link to view the pipeline execution graph and logs in the UI. In this case, the pipeline has one task that prints and returns `'Hello, World!'`.

In the next few sections, you’ll learn more about the core concepts of authoring pipelines and how to create more expressive, useful pipelines.
