Skip to main content
This guide walks through the Hello World example — a two-node conversation flow where the bot asks for a favorite color, records the answer, and says goodbye.

Hello World Example

View the full source code on GitHub

Prerequisites

Pipecat Flows is included with Pipecat. Install Pipecat with the services used in this example:
You’ll need API keys for Cartesia (STT + TTS) and Google (LLM) set as environment variables:

Define the Nodes

A flow is a graph of nodes. Each node gives the LLM a task and the functions it needs. This example has two nodes: one to ask a question and one to end the conversation.

Initial Node

The initial node sets the bot’s personality via role_message, gives it a task via task_messages, and lists the function the LLM will call when the user answers:

End Node

The end node thanks the user and ends the conversation via the end_conversation post-action:
Nodes can be defined as plain dicts or as NodeConfig objects — both work identically.

Write the Function

When the LLM calls the function, it processes the result and returns the next node. record_favorite_color is a direct function: its first parameter is flow_manager, the rest (here, color) become the function’s parameters, and Flows derives the schema (advertised to the LLM) from the signature and docstring:
The function returns a tuple of (result, next_node). The result is provided to the LLM as context, and the next node is where the conversation transitions to.

Build the Pipeline and FlowManager

Set up a standard Pipecat pipeline, then create a FlowManager and initialize it when a client connects:
That’s it! When a user connects, the bot greets them, asks for their favorite color, records the answer, thanks them, and ends the conversation.
See the full source code for the complete runnable example.

Next Steps

Nodes & Messages

Learn about node configuration and message types

Functions

Understand node and edge functions

Examples

Explore more complex examples

API Reference

Complete technical reference