Beginner level · Module 6: Introduction to Agent Workflows · Lesson 2 of 3
Sequences and Routing
Learners configure a sequential chain (classify, search, answer, check) and a router that sends questions to different handling depending on their category.
In this lesson you will
- Configure a sequential workflow
- Add routing by category
Key concepts
prompt chainintermediate outputclassifier steproutedefault route
The lesson
A sequential chain passes the output of one step to the next: classify the question, search the right documents, draft the answer, check it. Each step is simpler than doing everything at once, and each can be tested separately.
Routing sends inputs down different paths: fees questions to the fees documents, complaints straight to a person, everything else to general search. A default route handles anything unexpected, usually by handing over.
Simple routing can use keywords or the model's category output validated against allowed values.
Step by step
- Configure the four-step chain in the guided notebook.
- Add a router with three routes and a default.
- Test with ten questions of different categories.
- Record which route each took and whether it was correct.
Practice activity
Build and test the sequential and routing workflow for the project.
Expected result: A working workflow that routes correctly in most test cases, with errors recorded.
Check your understanding
-
Why split work into a sequential chain?
Show answer
Each step is simpler and can be tested separately.
-
What should the default route usually do?
Show answer
Hand over to a person or give a safe response.
Further learning
Taught live by an instructor — online or in person. Free course lessons are for self-study and do not lead to a certificate — see registration options.