04. Agentic Workflows
Task Planning, Decomposition and Scheduling
Task planning sets milestones toward a goal. Decomposition breaks work into executable units with dependencies. Scheduling decides order, parallelism, priority, and timing so the agent actually runs the plan.
What you will learn
- Separate planning, decomposition, and scheduling cleanly
- Model tasks with dependencies and done checks
- Choose sequential, parallel, priority, or timed schedules
- Represent task status the orchestrator can advance
- Answer interview questions with short, solid answers
Definition
In agentic workflows, planning answers what milestones get us to done. Decomposition answers what atomic tasks make up those milestones. Scheduling answers which ready task runs next (or when), including parallel joins and delays.
Module 03 covered reasoning and decomposition as decision skills. This lesson focuses on the workflow layer: durable task lists, dependency graphs, and schedulers that drive the loop.
Introduction
This lesson (#4 in Agentic Workflows) follows ReAct. ReAct picks the next micro-step; planning/scheduling maintains the backlog of work those micro-steps serve.
Next: Workflow Patterns (Sequential, Parallel, Conditional, Iterative).
Why this trio matters
- Stops agents from improvising without a backlog
- Enables parallelism safely when deps allow
- Makes progress visible to users and ops
- Supports pause/resume across long jobs
Task planning
A plan is a structured set of milestones tied to a goal and constraints (deadline, cost, risk). Keep it short enough to revise.
- Inputs - goal, verifiers, tools available, budgets
- Output - ordered or partially ordered milestones
- Good plan - each milestone has a done check
- Bad plan - vague stages nobody can verify
Decomposition
Split milestones until leaves are one tool call, one code step, or one HITL gate β with explicit dependencies.
- Vertical split - investigate β fix β verify
- Horizontal split - independent research streams
- Dependency edges - B waits on Aβs artifact
- Acceptance - every leaf has a success/fail signal
- Stop splitting when coordination cost exceeds value
Scheduling
The scheduler selects among Ready tasks. Policies differ by product needs.
- Sequential - run one ready task at a time (simple, safe)
- Parallel - run independent ready tasks; join before dependents
- Priority - SLA or severity orders the queue
- Timed - cron, debounce, or wait-until windows for proactive agents
- Resource limits - max concurrent tool calls / token budget
Task state model
Store tasks as data. Prompts may propose updates; the orchestrator owns status transitions.
- Pending - created, deps not met
- Ready - eligible for the scheduler
- Running - worker/agent step in flight
- Blocked - needs human, lock, or external event
- Done / Failed - terminal for that leaf (may trigger replan)
Planning + ReAct together
- Planner writes/updates the task graph
- Scheduler picks the next Ready task
- ReAct (or code) executes that taskβs micro-loop
- Verifier marks Done/Failed and unlocks dependents
- On Failed - reflect, replan subtree, or escalate
Program / implementation notes
Use a Task table/JSON: id, parent, deps, status, owner, payload, result. Do not keep the only plan inside free-form chat text.
- Idempotent task execution when retries are allowed
- Lock a task while Running to avoid double-schedule
- Expose todo tools to the model carefully β validate writes
- Metric: time in Ready vs Running vs Blocked
- Next: Workflow Patterns (Sequential, Parallel, Conditional, Iterative)
Advantages and limitations
- Advantage: clear progress and resumability
- Advantage: safe parallelism with dependency awareness
- Advantage: better ops visibility than pure ReAct thrash
- Limitation: over-planning delays first useful action
- Limitation: stale plans need active replanning
- Limitation: bad schedulers starve low-priority but critical work
Key points
- Plan milestones; decompose into dependent tasks; schedule ready work.
- Scheduling covers order, parallelism, priority, and time.
- Persist task status: Pending β Ready β Running β Done/Failed/Blocked.
- Combine a task graph with ReAct for micro-execution.
- Verifiers unlock dependents; failures trigger replan or escalate.
- Keep the plan in structured state, not only chat prose.
FAQs
Is scheduling the same as planning?
No. Planning decides what work exists; scheduling decides which ready unit runs when and with what concurrency.
Do I need a fancy scheduler for every agent?
No. Many agents use a simple sequential queue. Add priority/parallel/time only when requirements demand them.
How does this relate to todo lists in coding agents?
Todo lists are a lightweight task graph. Treat updates as state transitions with validation, not unchecked free text.
When should tasks run in parallel?
Only when they do not share conflicting side effects and their dependency edges allow β then join before dependent work.
Interview questions
- What is task decomposition in agent workflows?
Answer Breaking milestones into executable tasks with dependencies and acceptance checks the orchestrator can track.
- Planning vs scheduling?
Answer Planning defines the work breakdown toward a goal; scheduling selects which ready tasks run next, in what order or parallel slots.
- Name common scheduling strategies for agents.
Answer Sequential, parallel with join, priority queues, and timed/cron triggers β often combined with concurrency caps.
- What states should a task have?
Answer At least Pending, Ready, Running, Blocked, Done, and Failed β so the scheduler and UI can reason about progress.
- How do planning and ReAct work together?
Answer The plan/scheduler chooses the current task; ReAct performs the interleaved tool loop inside that task until its verifier settles.
- How do you handle a failed scheduled task?
Answer Mark Failed, reflect, retry with backoff if safe, replan the subtree, or escalate β do not silently reschedule forever.
- Why store the plan outside the prompt?
Answer So runs can resume, audit, and enforce deps/budgets even when context is summarized or the process restarts.
Related topics
Practice task
Complete each numbered practice step in a notebook or doc before opening the next lesson.
- For βmigrate checkout to new payments API,β write 4 milestones with done checks.
- Decompose one milestone into leaf tasks with dependency arrows.
- Mark which leaves can run in parallel and which must be sequential.
- Assign statuses to a mid-run snapshot (one Blocked on HITL).
- Answer interview questions 1, 2, and 5 in two sentences each.