A Hierarchical Task Network (HTN) is an automated planning formalism that represents a complex problem as a hierarchy of tasks, which are recursively decomposed into subtasks using decomposition methods until a sequence of directly executable primitive actions is found. Unlike classical planners that search for actions to achieve world-state goals, HTN planners are given a high-level compound task and use domain-specific knowledge encoded in methods to break it down, making them highly efficient for structured, procedural domains like manufacturing, logistics, and autonomous agent workflows.
Glossary
Hierarchical Task Network (HTN)

What is Hierarchical Task Network (HTN)?
A core formalism in automated planning and agentic cognitive architectures for structuring complex, goal-oriented behavior.
The core process is task decomposition, guided by a domain description containing task schemas, methods, and operators. A method specifies a valid way to decompose a compound task into a network of subtasks, provided its preconditions hold. This creates a decomposition tree, resulting in a hierarchical plan. Algorithms like SHOP perform this decomposition in a forward-chaining manner, interleaving planning with state progression to ensure executability and enabling replanning when execution fails.
Core Components of an HTN
A Hierarchical Task Network is formally defined by a set of interlocking components that specify tasks, decomposition rules, and executable actions. These elements work together to transform abstract goals into concrete, executable plans.
Compound Task
A Compound Task is a high-level, abstract objective that cannot be executed directly. It serves as a placeholder that must be decomposed into a network of simpler subtasks using applicable methods. Examples include DeliverPackage(city) or DiagnoseSystemFault(). It represents the 'what' without specifying the 'how'.
Primitive Task
A Primitive Task (or Operator) is a directly executable action at the leaves of the decomposition tree. It is defined by:
- Preconditions: Logical conditions that must be true in the world state for the action to be applicable.
- Effects: The changes the action makes to the world state upon execution.
For example,
NavigateTo(location)orOpenValve(id)are primitive tasks with specific preconditions and effects.
Method
A Method (or Decomposition Method) is a schema that defines a possible way to decompose a specific compound task into a network of subtasks. Each method has:
- Applicability Conditions: Preconditions that must hold for this decomposition to be valid.
- Subtasks: The network of (compound or primitive) child tasks.
- Ordering Constraints: Temporal relations between the subtasks (e.g., sequential, parallel). A planner selects among competing methods based on the current world state.
Task Network
A Task Network is a directed graph representing the current set of tasks to be accomplished, along with the ordering constraints between them. It evolves during planning:
- Initial Task Network: Contains the top-level goal compound tasks.
- Intermediate Task Networks: Contain a mix of compound and primitive tasks as decomposition proceeds.
- Final Task Network: Contains only primitive tasks in a valid order, constituting the solution plan.
Domain Description
The Domain Description is the complete formal specification of an HTN planner's knowledge. It is a Task Library containing:
- Task Schemas: Templates for all compound and primitive tasks.
- Method Library: All available decomposition methods.
- Operator Definitions: All primitive actions with their preconditions and effects. This description is domain-specific (e.g., logistics, manufacturing, IT orchestration) and is separate from any specific problem instance.
Planning Problem
A Planning Problem instance is defined by three inputs to the HTN planner:
- Domain Description: The library of tasks and methods.
- Initial State: A complete snapshot of the world before plan execution (e.g.,
RobotAt(Home), ValveStatus(Closed)). - Initial Task Network: The high-level goal tasks to be achieved (e.g.,
[MaintainSystemPressure]). The planner's job is to process this problem and output a solution plan—a sequence of executable primitive actions.
How HTN Planning Works
Hierarchical Task Network (HTN) planning is a problem-solving formalism that generates executable action sequences by recursively decomposing high-level objectives.
HTN planning begins with an initial task network containing abstract compound tasks. The planner selects a compound task and applies a decomposition method—a rule that replaces it with a network of subtasks, given its preconditions are satisfied in the current world state. This task decomposition process repeats recursively. Subtasks can be other compound tasks or primitive tasks, which correspond directly to executable operators with defined effects. The process continues until the entire network is reduced to a sequence of primitive actions, forming a solution plan.
The power of HTN planning lies in its domain knowledge encoding. Instead of searching a vast space of atomic actions, the planner uses methods as procedural knowledge to guide the search directly toward viable solutions. Algorithms like SHOP (Simple Hierarchical Ordered Planner) perform decomposition in a forward-chaining, depth-first manner, interleaving planning with state progression. This makes HTN planning highly efficient for complex, structured domains like logistics, manufacturing, and autonomous agent behavior, where expert knowledge about valid task sequences is available and can be encoded to constrain the search.
Frequently Asked Questions
A Hierarchical Task Network (HTN) is a formal planning paradigm used in artificial intelligence to decompose high-level objectives into executable action sequences. This FAQ addresses core concepts, mechanisms, and applications for engineers building complex, multi-step agent workflows.
A Hierarchical Task Network (HTN) is an AI planning formalism that solves complex problems by recursively breaking down abstract, high-level tasks into networks of smaller subtasks until primitive, directly executable actions are reached. It works through a process called task decomposition. The planner starts with an initial task network containing one or more high-level compound tasks. It then searches through a library of methods—each defining a possible way to decompose a specific compound task into a subtask network given certain preconditions—until all tasks are reduced to primitive tasks (executable operators). The result is a hierarchical plan that is both a sequence of actions and a tree showing the decomposition structure, known as a decomposition tree.
Enabling Efficiency, Speed & Accuracy
Intelligent Analysis, Decision & Execution
We build AI systems for teams that need search across company data, workflow automation across tools, or AI features inside products and internal software.
Talk to Us
Search across company data
Give teams answers from docs, tickets, runbooks, and product data with sources and permissions.
Useful when people spend too long searching or get different answers from different systems.

Automate internal workflows
Use AI to route work, draft outputs, trigger actions, and keep approvals and logs in place.
Useful when repetitive work moves across multiple tools and teams.

Add AI to products and internal tools
Build assistants, guided actions, or decision support into the software your team or customers already use.
Useful when AI needs to be part of the product, not a separate tool.
Related Terms
Hierarchical Task Network (HTN) planning is defined by a core set of formal concepts. These terms describe the components and processes that enable the recursive decomposition of abstract goals into executable actions.
Primitive Task
A Primitive Task is a task in an HTN that corresponds directly to an executable action or operator in the planning domain. It is the terminal leaf in a decomposition tree and cannot be broken down further by an HTN method.
- Key Role: Represents the atomic, executable units of a plan.
- Contrast with Compound Tasks: While compound tasks are abstract goals requiring decomposition, primitive tasks are the concrete steps a system (like a robot or software agent) can perform.
- Example: In a logistics domain,
Drive(Truck-A, Warehouse-1, Warehouse-2)orLoad(Package-23, Truck-A)would be primitive tasks.
Compound Task
A Compound Task is a high-level, abstract goal in an HTN that must be decomposed into a network of subtasks before it can be executed. It defines what needs to be achieved, not how.
- Decomposition Required: A compound task is a placeholder that is replaced by a subtask network via an applicable method.
- Hierarchical Structure: Compound tasks enable the representation of complex goals at multiple levels of abstraction.
- Example:
DeliverPackage(Package-23, Customer-45)is a compound task. Its decomposition might involve subtasks likeLoadPackage,TransportPackage, andUnloadPackage.
Method (HTN)
A Method is a schema that defines a possible way to decompose a specific compound task into a network of subtasks, provided its preconditions are satisfied. Methods encode the procedural knowledge of how to achieve an abstract goal.
- Structure: A method typically includes: 1) A head (the compound task it decomposes), 2) Preconditions (logical conditions that must be true), and 3) A task network (the set of subtasks and ordering constraints).
- Choice Point: Multiple methods can exist for the same compound task, giving the planner options. The planner selects a method whose preconditions match the current world state.
- Example: For the compound task
BrewCoffee, one method's preconditions could check ifBeansAvailableis true, and its subtask network might be[GrindBeans, HeatWater, PourWater, Serve].
Task Decomposition
Task Decomposition is the core recursive process in HTN planning where a compound task is replaced by a network of subtasks using an applicable method. This process continues until the entire plan consists solely of primitive tasks.
- Recursive Algorithm: The planner searches through the space of possible decompositions, not sequences of actions.
- Result: Produces a Decomposition Tree (or hierarchical plan) that visually maps high-level goals to low-level actions.
- Contrast with State-Space Search: Unlike classical planning which searches through world states, HTN planning searches through task hierarchies, often making it more efficient for complex, structured domains.
SHOP (Simple Hierarchical Ordered Planner)
SHOP is a seminal, forward-chaining HTN planning algorithm that performs task decomposition in a depth-first manner, interleaving planning with state progression. It assumes tasks within a method are totally ordered.
- Algorithm Principle: SHOP starts with the initial task network and state. It selects the first task in the network; if it's primitive, it's added to the plan and its effects are applied to the current state; if it's compound, an applicable method is chosen and its subtasks are inserted in place.
- Efficiency: By progressing the world state as it plans, SHOP can use current state information to prune irrelevant method choices early.
- Legacy: SHOP and its successor SHOP2 are foundational references in automated planning and influenced modern agent and game AI systems.
Skeletal Plan
A Skeletal Plan is a partially specified, abstract plan generated during the intermediate stages of HTN planning. It contains a mix of compound tasks (awaiting decomposition) and primitive tasks.
- Intermediate Artifact: Represents the planner's current, incomplete solution. It becomes more concrete through successive plan refinement steps.
- Utility: Provides a high-level blueprint that guides further decomposition. It allows for reasoning about abstract plan structure before committing to all low-level details.
- Evolution: A skeletal plan is progressively refined until no compound tasks remain, at which point it becomes a fully executable solution plan.

About the author
Prasad Kumkar
CEO & MD, Inference Systems
Prasad Kumkar is the CEO & MD of Inference Systems and writes about AI systems architecture, LLM infrastructure, model serving, evaluation, and production deployment. Over 5+ years, he has worked across computer vision models, L5 autonomous vehicle systems, and LLM research, with a focus on taking complex AI ideas into real-world engineering systems.
His work and writing cover AI systems, large language models, AI agents, multimodal systems, autonomous systems, inference optimization, RAG, evaluation, and production AI engineering.
Partnered with leading AI, data, and software stack.
How We Work
Custom AI workflows for your Business
One-fit-all AI don't work for modern businesses. At Inferensys, we aim to understand your business & custom requirements; which we use to define most efficient agentic workflows, the data, and the tools for your business.
01
Review the use case
We understand the task, the users, and where AI can actually help.
Read more02
Pick the right approach
We define what needs search, automation, or product integration.
Read more03
Build the first useful version
We implement the part that proves the value first.
Read more04
Improve from there
We add the checks and visibility needed to keep it useful.
Read moreThe first call is a practical review of your use case and the right next step.
Talk to Us