Most automation is imperative: you write "do step 1, then step 2, then step 3." Declarative task planning flips that: you state the goal or outcome, and the system (AI or planner) figures out the steps. "I want a morning brief with calendar, tasks, and document queue" is declarative; "call get_calendar, then get_tasks, then get_doc_status, then compose, then send" is imperative. This guide covers declarative task planning models for US professionals: when they help, how they work with orchestrators like OpenClaw, and how document and PDF handling fits as a capability the planner can invoke.
Summary Declarative planning means describing what you want (goals, constraints, outputs) and letting the system choose the steps. Use it for flexible workflows and natural-language commands. When the plan includes documents or PDFs, the planner should call a single, well-defined document capability (e.g. iReadPDF) so summaries and metadata are consistent across runs.
What Declarative Task Planning Is
Declarative task planning is an approach where:
- You specify the outcome. "I want a morning brief that includes today calendar, my top 5 tasks, and a summary of documents waiting for action." You do not list the API calls or the order of steps.
- The planner produces the steps. A planning component (rule-based, LLM-based, or hybrid) reasons about available skills and data sources, then outputs a plan: get_calendar, get_tasks, get_document_status, compose_brief, send_to_slack. The plan might vary (e.g. if user asked for weather, add get_weather).
- The orchestrator runs the plan. OpenClaw or another engine takes the plan and executes it: run each step, pass state, handle failures. The same orchestrator can run both hand-written workflows and planner-generated plans.
- Constraints and preferences can be part of the spec. "Brief by 7 AM," "no more than 3 doc summaries," "only from my work calendar." The planner respects these when building the plan.
For US professionals, declarative planning makes it possible to say "prep me for the 2 PM meeting" and have the system figure out that it needs calendar, attendee context, relevant docs, and maybe a doc summary, without you scripting every combination.
Declarative vs. Imperative
Imperative: You define the exact sequence. "Run A, then B, then C." Easy to reason about and debug, but any new outcome (e.g. include weather) requires changing the workflow.
Declarative: You define the outcome and constraints. "Morning brief with calendar, tasks, and doc queue; under 500 words; by 7 AM." The planner chooses A, B, C (and maybe D if needed). More flexible and closer to how people think ("I want X"), but the system must have a good model of available skills and how they combine.
In practice, many setups are hybrid: fixed workflows for critical paths (e.g. when contract lands, always summarize then notify legal) and declarative planning for ad-hoc or variable requests (e.g. give me whatever I need for this meeting). Document handling can be a fixed step inside a declarative plan: the planner knows "if the user asked for doc context, add get_document_summaries" and that step always calls the same pipeline (iReadPDF or a store it populates) so output format is consistent.
How Declarative Planning Works
- Goal representation. The user intent is represented as a goal: morning_brief with include_calendar, include_tasks, include_docs, delivery Slack. Or in natural language: "Summarize the board deck and tell me what needs my signature." The planner converts that into a structured goal.
- Skill and capability registry. The planner knows what skills exist: get_calendar, get_tasks, get_document_status, get_document_summaries, compose_brief, send_to_slack. Each skill has a description and input/output contract. Document capabilities (e.g. summarize PDF or get doc summaries) are in the registry like any other skill.
- Planning algorithm. The planner searches for a sequence (or graph) of skills that achieves the goal. It might use rules (morning_brief requires compose_brief, which requires at least one of calendar, tasks, docs), an LLM that suggests steps, or a classical planner. Output is a plan: an ordered list (or DAG) of steps with parameters.
- Validation. Optionally, the plan is validated against policies (e.g. do not send external data to Slack without user approval) before execution. Then the orchestrator runs it.
When the goal involves documents, the planner inserts the right document steps (get_document_status, get_document_summaries, or summarize_pdf). If those steps are backed by a single pipeline like iReadPDF, the executed plan always gets the same document format, whether the plan was generated today or next month with a different LLM run.
Try the tool
Integrating with an Orchestrator
The orchestrator (e.g. OpenClaw) does not care whether the plan was written by a human or generated by a planner.
- Plan format. The planner outputs a plan in a format the orchestrator accepts: list of step IDs and inputs (e.g. get_document_summaries with doc_ids from context). The orchestrator runs each step, updates state, and passes output to the next.
- Same skills. The same skills used in hand-written workflows (get_calendar, get_document_status, compose_brief) are available to the planner. So document handling is just another skill: get_document_summaries reads from memory or triggers iReadPDF and returns the standard summary format.
- Failure handling. The orchestrator still applies retry, skip, or abort. If a planner-generated step fails, the same policies apply. For optional steps (e.g. doc summaries), the orchestrator can pass empty and continue so the user still gets a partial result.
- Observability. Log the plan and each step result so you can see what the planner chose and how execution went. That helps tune the planner and the skill set.
Where Document and PDF Steps Come In
In a declarative model, documents are a capability the planner can use when the goal implies it.
- Goal includes documents or PDFs. User says "morning brief with my doc queue" or "summarize the contract." The planner adds get_document_status and/or get_document_summaries (or summarize_pdf for a specific file). Those steps must exist in the registry with clear contracts.
- Single document capability. The planner should not need to know whether summarization is done by iReadPDF or another tool. It only needs one skill: get_document_summaries or summarize_pdf that returns the agreed schema (title, summary, key_points). One pipeline keeps the plan output consistent and avoids "sometimes we have summaries, sometimes we do not" depending on which path the planner chose.
- Optional vs. required. If the goal is "brief with calendar and tasks" and the user did not ask for docs, the planner might omit document steps. If the goal is "summarize the board deck," the document step is required. The planner and orchestrator handle "step not run" vs. "step failed" appropriately.
- Pre-populated vs. on-demand. Document summaries might already exist in memory (from a prior iReadPDF run when the user added the PDF). Then get_document_summaries just reads. Or the plan might include summarize_pdf with file_path for a specific file. Either way, the same pipeline and format apply.
When to Use Declarative vs. Fixed Workflows
Use declarative when:
- The user request varies ("brief with weather," "meeting prep with doc summaries," "just my calendar").
- You want natural-language or high-level commands and do not want to maintain a separate workflow for every combination.
- You are okay with the planner occasionally picking a suboptimal or wrong step, as long as you can correct and improve the skill set and prompts.
Use fixed (imperative) workflows when:
- The process is critical and must be identical every time (e.g. compliance, contract routing).
- You need predictable performance and no surprise steps.
- You prefer to debug a known sequence rather than a planner choices.
Many US teams use both: fixed workflows for document-heavy, compliance-sensitive flows (always summarize with iReadPDF, then notify legal), and declarative planning for daily briefs and ad-hoc "get me X" requests. The document capability is the same in both; only how the steps are chosen differs.
Conclusion
Declarative task planning means specifying what you want (goals, constraints) and letting the system choose the steps. It fits natural-language commands and variable workflows. Integrate it with an orchestrator like OpenClaw so the same skills and state handling run whether the plan is hand-written or planner-generated. When the plan involves documents or PDFs, expose a single document capability (e.g. iReadPDF) so every plan gets consistent summaries and metadata. Use declarative for flexibility and fixed workflows for critical, repeatable processes; documents can be a shared capability in both.
Ready to add document-aware planning? Use iReadPDF as the single document summarization layer so your declarative plans always have accurate, consistent PDF summaries for every goal that involves documents.