If you are building an OpenAI Agents SDK pipeline that needs to summarise Confluence pages, you need condensed, usable content rather than raw exports. Confluence pages carry navigation bars, breadcrumb trails, contributor metadata, macro markup, and sidebar panels that inflate token usage and introduce structural noise your agent has to reason around. Writing your own summarisation prompt handles simple pages but breaks down when page structures vary across teams, when content is deeply nested, or when macro-rendered sections produce inconsistent output your prompt was not written to handle.
EnConvert’s Distill endpoint takes a Confluence URL and returns a clean, concise summary of the page content, ready to pass into an OpenAI Agents SDK agent as context or store in a memory layer. One API call replaces the chunking logic, the summarisation prompt, and the maintenance overhead that comes with both.
import asyncio
import os
import requests
from agents import Agent, Runner
ENCONVERT_API_KEY = os.environ["ENCONVERT_API_KEY"]
CONFLUENCE_URL = os.environ["CONFLUENCE_URL"]
# Step 1: Extract structured content from the Confluence page with Enconvert Distill
response = requests.post(
"https://api.enconvert.com/v2/distill",
headers={
"X-API-Key": ENCONVERT_API_KEY,
"Content-Type": "application/json",
},
json={
"urls": [CONFLUENCE_URL],
"schema": {
"summary": "concise summary of the page",
"key_decisions": "list of decisions recorded on the page",
"action_items": "list of action items, with owners if stated",
},
},
timeout=60,
)
response.raise_for_status()
item = response.json()["results"][0]
if item.get("error") or not item.get("data"):
raise RuntimeError(f"Distill failed for {CONFLUENCE_URL}: {item.get('error')}")
extracted = item["data"]
# Step 2: Pass the extracted data into an OpenAI Agents SDK agent as context
agent = Agent(
name="Confluence Assistant",
instructions=(
"You are a technical assistant. Structured data extracted from a "
"Confluence page has been provided as context. Use it to answer "
"questions accurately and concisely."
),
)
async def main() -> None:
result = await Runner.run(
agent,
input=(
f"Here is the data extracted from the relevant Confluence page:\n\n{extracted}\n\n"
"What are the key decisions and action items recorded on this page?"
),
)
print(result.final_output)
if __name__ == "__main__":
asyncio.run(main())
Distill returns the core content of the Confluence page condensed into clean paragraphs or structured points. Navigation bars, breadcrumb trails, contributor metadata, page labels, and macro markup are removed before the response is returned.
Passing a raw Confluence export into an agent context instead produces bloated token usage from structural noise, inconsistent output shape across pages authored by different teams, and a higher probability of the agent referencing navigation text or metadata as if it were content. The difference compounds across multi-page pipelines where token budgets and response consistency both matter.