from fibonacci import Workflow, LLMNode, RetryConfig
workflow = Workflow(name="content-pipeline")
# Outline generator
outliner = LLMNode(
id="outliner",
model="claude-sonnet-4-5-20250929",
system_prompt="You are a content strategist.",
prompt="Create an outline for a blog post about: {{input.topic}}",
temperature=0.7,
output_format="json",
output_schema={
"type": "object",
"properties": {
"title": {"type": "string"},
"sections": {
"type": "array",
"items": {"type": "string"}
}
}
}
)
# Content writer
writer = LLMNode(
id="writer",
model="claude-sonnet-4-5-20250929",
system_prompt="You are a skilled blog writer.",
prompt="""
Write a blog post following this outline:
Title: {{outliner.title}}
Sections: {{outliner.sections}}
Style: {{input.style}}
""",
dependencies=["outliner"],
max_tokens=2000,
retry=RetryConfig(max_attempts=2)
)
# Editor
editor = LLMNode(
id="editor",
model="claude-opus-4-5-20251101",
system_prompt="You are an expert editor.",
prompt="Edit for clarity and engagement: {{writer}}",
dependencies=["writer"],
temperature=0.3
)
workflow.add_node(outliner)
workflow.add_node(writer)
workflow.add_node(editor)
# Execute
result = workflow.execute(inputs={
"topic": "AI in Healthcare",
"style": "informative yet engaging"
})
print(result["editor"])