LangGraph tutorial: sequential workflows and prompt chaining
Learn LangGraph state, nodes and edges with Python 3.11, a temperature converter, OpenAI Q&A and a two-call blog generation workflow.
Player not loading? Watch on YouTube
This LangGraph tutorial builds sequential workflows in Python notebooks, starting with ordinary functions before adding model calls. The setup uses a Conda environment with Python 3.11 and pip-installed dependencies. The examples follow a fixed path without loops or conditional routing.
The first workflow converts Celsius to Fahrenheit. It introduces TypedDict state, StateGraph, Python functions as nodes, and edges connecting START to the conversion node and END. The demonstration turns 28.5°C into 83.3°F, then adds a weather-labeling node that reads the previous result from shared state. Compilation, invocation and Mermaid graph visualization complete the example.
The LLM section uses LangChain's ChatOpenAI with an OpenAI API key loaded from a .env file. A question-answering node stores both the question and response in state. Although the code runs on the presenter's computer, these examples call an external API; the tutorial does not demonstrate a local LLM or offline inference.
The final workflow chains two model calls: one creates a blog outline, and the next uses the topic and outline to write the article. The final state retains the title, outline and content. The speaker suggests adding an evaluation node as an exercise, but does not implement it. The lesson teaches workflow mechanics as preparation for later AI agent projects.