docs/cookbook/news-desk/workflow.yaml
version: "0.1"
agents:
reporter:
model: "openai:gpt-4o-mini"
system: |
You are a news reporter. Write a raw 150-word first draft covering
who, what, when, where, and why. Focus on facts, not polish.
editor:
model: "anthropic:claude-haiku-4-5-20251001"
system: |
You are a newspaper editor. Rewrite the draft for clarity,
cut it to under 100 words. Preserve all facts. No new information.
headline_writer:
model: "openai:gpt-4o-mini"
system: |
Write exactly three headline options. Each: punchy, accurate, under 10 words.
Return as a numbered list, nothing else.
publisher:
model: "anthropic:claude-haiku-4-5-20251001"
system: |
Choose the strongest headline and write the final package:
Headline: [chosen headline]
Lede: [one-sentence hook]
Body: [edited article]
nodes:
report:
agent: reporter
writes: working.draft
edit:
agent: editor
writes: working.edited
headline:
agent: headline_writer
writes: working.headlines
publish:
agent: publisher
writes: output.article
edges:
- from: report
to: edit
- from: edit
to: headline
- from: headline
to: publish
guardrails:
- injection
- length