この例は、追跡と整頓の向上のために名前付き Step オブジェクトを使用するワークフローを実演します。このパターンは、単純なシーケンシャル実行を維持しながら、明確なステップ識別と拡張ロギングを提供します。
Agno 2.x 例題 : Concepts : ワークフロー – 基本ワークフロー : 名前付きステップ, 関数 executor
作成 : クラスキャット・セールスインフォメーション
作成日時 : 11/13/2025
バージョン : Agno 2.2.11
* 本記事は docs.agno.com の以下のページを独自に翻訳した上で、補足説明を加えてまとめ直しています。スニペットはできる限り日本語を使用しています :
- Learn : Workflows – Workflow Patterns : Step-Based Workflows
- [Examples] Concepts : Workflows – Basic Workflows : Sequence of steps
- [Examples] Concepts : Workflows – Basic Workflows : Step with function
* サンプルコードの動作確認はしておりますが、必要な場合には適宜、追加改変しています。
* ご自由にリンクを張って頂いてかまいませんが、sales-info@classcat.com までご一報いただけると嬉しいです。

Agno 2.x : Learn : ワークフロー – パターン : ステップベースのワークフロー
AgentOS チャットページでのロギングやサポート向上のためにステップに名前付けできます。
Agno プラットフォーム上、ロギングと将来的なサポートの向上のためにステップに名前をつけることができます。これはまた、StepInput オブジェクト内でステップの出力にアクセスする際、ステップ名も変更します。
例
from agno.workflow import Step, Workflow
# Named steps for better tracking
workflow = Workflow(
name="Content Creation Pipeline",
steps=[
Step(name="Research Phase", team=researcher),
Step(name="Analysis Phase", executor=custom_function),
Step(name="Writing Phase", agent=writer),
]
)
workflow.print_response(
"AI trends in 2024",
markdown=True,
)
Agno 2.x 例題: ワークフロー – 基本ワークフロー : ステップのシークエンス
この例は、ワークフローで名前付きステップを使用する方法を実演します。
この例は、追跡と整頓の向上のために名前付き Step オブジェクトを使用するワークフローを実演します。このパターンは、単純なシーケンシャル実行を維持しながら、明確なステップ識別と拡張ロギングを提供します。
パターン: シーケンシャル・名前付きステップ
When to use: 明確なステップ識別、ロギングの向上、将来的なプラットフォームサポートをユーザが場合の線形プロセス。名前付けのメリットがある、明白なフェイズがある場合に適切です。
sequence_of_steps.py
from agno.agent import Agent
from agno.db.sqlite import SqliteDb
from agno.models.openai import OpenAIChat
from agno.team import Team
from agno.tools.googlesearch import GoogleSearchTools
from agno.tools.hackernews import HackerNewsTools
from agno.workflow.step import Step
from agno.workflow.workflow import Workflow
# Define agents
hackernews_agent = Agent(
name="Hackernews Agent",
model=OpenAIChat(id="gpt-5-mini"),
tools=[HackerNewsTools()],
role="Extract key insights and content from Hackernews posts",
)
web_agent = Agent(
name="Web Agent",
model=OpenAIChat(id="gpt-5-mini"),
tools=[GoogleSearchTools()],
role="Search the web for the latest news and trends",
)
# Define research team for complex analysis
research_team = Team(
name="Research Team",
members=[hackernews_agent, web_agent],
instructions="Research tech topics from Hackernews and the web",
)
content_planner = Agent(
name="Content Planner",
model=OpenAIChat(id="gpt-5-mini"),
instructions=[
"Plan a content schedule over 4 weeks for the provided topic and research content",
"Ensure that I have posts for 3 posts per week",
],
)
# Define steps
research_step = Step(
name="Research Step",
team=research_team,
)
content_planning_step = Step(
name="Content Planning Step",
agent=content_planner,
)
content_creation_workflow = Workflow(
name="Content Creation Workflow",
description="Automated content creation from blog posts to social media",
db=SqliteDb(
session_table="workflow_session",
db_file="tmp/workflow.db",
),
steps=[research_step, content_planning_step],
)
# Create and use workflow
if __name__ == "__main__":
content_creation_workflow.print_response(
input="AI trends in 2024",
markdown=True,
)
出力例
┏━ Step 2: Content Planning Step (Completed) ━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━┓ ┃ ┃ ┃ 以下は、2025年のAIトレンドに関するコンテンツを4週間・週3回のペースで発信するスケジュール案です。各投稿にはタイトル案と概要を記載しています。 ┃ ┃ ┃ ┃ Week 1 ┃ ┃ Post 1(月曜) ┃ ┃ タイトル:先進的プロンプトエンジニアリング入門 ┃ ┃ 概要: ┃ ┃ ┃ ┃ • モジュラープロンプトとは何か ┃ ┃ • リファイン機能で出力を磨く手法 ┃ ┃ • 社内外での共有・マネタイズ例 ┃ ┃ ┃ ┃ Post 2(水曜) ┃ ┃ タイトル:ノーコードで叶える自然言語自動化の最前線 ┃ ┃ 概要: ┃ ┃ ┃ ┃ • 自然言語×RPAの組み合わせ ┃ ┃ • コード不要ツール比較(例:Zapier+ChatGPT) ┃ ┃ • 導入企業の成功事例 ┃ ┃ ┃ ┃ Post 3(金曜) ┃ ┃ タイトル:モジュラーモデル活用術:組み合わせ&最適化のコツ ┃ ┃ 概要: ┃ ┃ ┃ ┃ • モデルとデータパイプラインのコンポーザビリティ ┃ ┃ • ベストプラクティスとAPI設計 ┃ ┃ • トラブルシューティングのポイント ┃ ┃ ┃ ┃ Week 2 ┃ ┃ Post 4(月曜) ┃ ┃ タイトル:3D仮想世界のエージェント:家庭ロボ・ARアシスタントの未来 ┃ ┃ 概要: ┃ ┃ ┃ ┃ • 仮想エージェントの現状と課題 ┃ ┃ • 家庭用ロボットへの応用シナリオ ┃ ┃ • ARアシスタントのUX設計 ┃ ┃ ┃ ┃ Post 5(水曜) ┃ ┃ タイトル:AI時代のサイバー攻防戦:攻撃者 vs 防御者 ┃ ┃ 概要: ┃ ┃ ┃ ┃ • AIを活用した攻撃手法(フィッシング/マルウェア) ┃ ┃ • ディフェンスAIのアルゴリズム ┃ ┃ • コミュニティでの情報共有・CTI連携 ┃ ┃ ┃ ┃ Post 6(金曜) ┃ ┃ タイトル:コミュニティ駆動型モデレーションで品質を担保 ┃ ┃ 概要: ┃ ┃ ┃ ┃ • 純アルゴリズムフィルタリングの限界 ┃ ┃ • ユーザー参加型モデレーションの仕組み ┃ ┃ • 実装Tipsと運用体制 ┃ ┃ ┃ ┃ Week 3 ┃ ┃ Post 7(月曜) ┃ ┃ タイトル:AI解釈性(Interpretability)の新潮流 ┃ ┃ 概要: ┃ ┃ ┃ ┃ • 内部モデル可視化手法(例:Feature Attribution) ┃ ┃ • モデル動作のデバッグ・検証プロセス ┃ ┃ • 解釈性強化によるビジネスインパクト ┃ ┃ ┃ ┃ Post 8(水曜) ┃ ┃ タイトル:AIワークフローの基盤構築:オーケストレーションフレームワーク比較 ┃ ┃ 概要: ┃ ┃ ┃ ┃ • Airflow/Kubeflow/Custom Engineの特徴 ┃ ┃ • 安定運用のためのモニタリング設計 ┃ ┃ • スケーラビリティ確保のポイント ┃ ┃ ┃ ┃ Post 9(金曜) ┃ ┃ タイトル:2025年企業のAI導入事例ベスト5 ┃ ┃ 概要: ┃ ┃ ┃ ┃ • 製造業のデジタルツイン活用 ┃ ┃ • 医療現場のドラッグ・ディスカバリー ┃ ┃ • 金融の自動与信・リスク管理 ┃ ┃ • 各社のROI・人材育成戦略 ┃ ┃ ┃ ┃ Week 4 ┃ ┃ Post 10(月曜) ┃ ┃ タイトル:エッジ&分散インテリジェンスが拓く次世代データ処理 ┃ ┃ 概要: ┃ ┃ ┃ ┃ • エッジAIのメリット(低遅延・プライバシー保護) ┃ ┃ • 分散学習・フェデレーテッドラーニング動向 ┃ ┃ • 専用ハードウェアとの組み合わせ ┃ ┃ ┃ ┃ Post 11(水曜) ┃ ┃ タイトル:AIガバナンス&倫理:認証・監査を成功に導く実践ガイド ┃ ┃ 概要: ┃ ┃ ┃ ┃ • グローバル規制フレームワーク概観 ┃ ┃ • 倫理監査のチェックリスト ┃ ┃ • コンプライアンス体制の作り方 ┃ ┃ ┃ ┃ Post 12(金曜) ┃ ┃ タイトル:AIチップ・サステナビリティ・人材育成の三大課題 ┃ ┃ 概要: ┃ ┃ ┃ ┃ • ハイパフォーマンスvs低コストチップ動向 ┃ ┃ • カーボンフットプリント抑制策 ┃ ┃ • 社内アップスキリングプログラム事例 ┃ ┃ ┃ ┃ 以上の12本で、2025年のAIトレンドを多角的にカバーします。各投稿はSNS・ブログ記事・ニュースレターなどに応じてフォーマットを最適化してください。 ┃ ┃ ┃ ┗━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━┛
Agno 2.x 例題: ワークフロー – 基本ワークフロー : 関数 executor によるステップ
この例は、カスタム関数 executor による名前付きステップの使用方法を実演します。
この例は、カスタム関数 executor による名前付き Step オブジェクトを使用したワークフローを実演します。このパターンは名前付きステップの利点とカスタム関数の柔軟性を組み合わせ、構造化されたワークフローステップ内で洗練されたデータ処理を可能にします。
When to use: 名前付きステップ構成を必要としながら、エージェント/チームが提供するものを超えたカスタムロジックが必要な場合。複雑なデータ処理、マルチステップ操作や、単一ステップ内で複数のエージェントをオーケストレーションする必要がある場合に最適です。
step_with_function.py
from agno.agent import Agent
from agno.db.sqlite import SqliteDb
from agno.models.openai import OpenAIChat
from agno.team import Team
from agno.tools.duckduckgo import DuckDuckGoTools
from agno.tools.hackernews import HackerNewsTools
from agno.workflow.step import Step, StepInput, StepOutput
from agno.workflow.workflow import Workflow
# Define agents
hackernews_agent = Agent(
name="Hackernews Agent",
model=OpenAIChat(id="gpt-5-mini"),
tools=[HackerNewsTools()],
instructions="Extract key insights and content from Hackernews posts",
)
web_agent = Agent(
name="Web Agent",
model=OpenAIChat(id="gpt-5-mini"),
tools=[DuckDuckGoTools()],
instructions="Search the web for the latest news and trends",
)
# Define research team for complex analysis
research_team = Team(
name="Research Team",
members=[hackernews_agent, web_agent],
instructions="Analyze content and create comprehensive social media strategy",
)
content_planner = Agent(
name="Content Planner",
model=OpenAIChat(id="gpt-5-mini"),
instructions=[
"Plan a content schedule over 4 weeks for the provided topic and research content",
"Ensure that I have posts for 3 posts per week",
],
)
def custom_content_planning_function(step_input: StepInput) -> StepOutput:
"""
Custom function that does intelligent content planning with context awareness
"""
message = step_input.input
previous_step_content = step_input.previous_step_content
# Create intelligent planning prompt
planning_prompt = f"""
STRATEGIC CONTENT PLANNING REQUEST:
Core Topic: {message}
Research Results: {previous_step_content[:500] if previous_step_content else "No research results"}
Planning Requirements:
1. Create a comprehensive content strategy based on the research
2. Leverage the research findings effectively
3. Identify content formats and channels
4. Provide timeline and priority recommendations
5. Include engagement and distribution strategies
Please create a detailed, actionable content plan.
"""
try:
response = content_planner.run(planning_prompt)
enhanced_content = f"""
## Strategic Content Plan
**Planning Topic:** {message}
**Research Integration:** {"✓ Research-based" if previous_step_content else "✗ No research foundation"}
**Content Strategy:**
{response.content}
**Custom Planning Enhancements:**
- Research Integration: {"High" if previous_step_content else "Baseline"}
- Strategic Alignment: Optimized for multi-channel distribution
- Execution Ready: Detailed action items included
""".strip()
return StepOutput(content=enhanced_content)
except Exception as e:
return StepOutput(
content=f"Custom content planning failed: {str(e)}",
success=False,
)
# Define steps using different executor types
research_step = Step(
name="Research Step",
team=research_team,
)
content_planning_step = Step(
name="Content Planning Step",
executor=custom_content_planning_function,
)
# Define and use examples
if __name__ == "__main__":
content_creation_workflow = Workflow(
name="Content Creation Workflow",
description="Automated content creation with custom execution options",
db=SqliteDb(
session_table="workflow_session",
db_file="tmp/workflow.db",
),
# Define the sequence of steps
# First run the research_step, then the content_planning_step
# You can mix and match agents, teams, and even regular python functions directly as steps
steps=[research_step, content_planning_step],
)
content_creation_workflow.print_response(
input="AI trends in 2024",
markdown=True,
)
print("\n" + "=" * 60 + "\n")
出力例
┏━ Step 2: Content Planning Step (Completed) ━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━┓ ┃ ┃ ┃ ┃ ┃ Strategic Content Plan ┃ ┃ ┃ ┃ ┃ ┃ **Planning Topic:** AI trends in 2025 ┃ ┃ ┃ ┃ **Research Integration:** ✓ Research-based ┃ ┃ ┃ ┃ **Content Strategy:** ┃ ┃ 以下では、「AIトレンド2025」をテーマに、4週間・週3回の投稿スケジュールを含む、具体的かつ実行可能なコンテンツプランをご提案します。研 ┃ ┃ 究は「既存の広範な知見+Hacker Newsなど最新ディスカッションの要点抽出」を組み合わせて行う想定です。 ┃ ┃ ┃ ┃ ┃ ┃ 1 全体戦略概要 ┃ ┃ • 目的:2025年のAI最新動向を解説し、自社(または個人)の専門性をアピール、リード獲得やフォロワー増を狙う ┃ ┃ • ターゲット:AIエンジニア、経営層(CIO/CTO)、テックメディア読者、スタートアップ創業者 ┃ ┃ • コアメッセージ:AI技術の最新トレンド、導入メリット・リスク、ビジネス応用の具体例 ┃ ┃ 2 コンテンツ形式&配信チャネル ┃ ┃ • ブログ記事(自社サイト/note) ┃ ┃ • 短尺動画(YouTubeショート/TikTok) ┃ ┃ • インフォグラフィック(LinkedIn/Twitter) ┃ ┃ • 解説スライド(SlideShare/Speaker Deck) ┃ ┃ • ウェビナー/ライブ配信(Zoom+YouTube Live) ┃ ┃ • メールマガジン(週次サマリー) ┃ ┃ 3 4週間スケジュール(週3回投稿) ┃ ┃ Week1(基礎編) ┃ ┃ - Post1(月曜):「2025年のAIトレンド総論」ブログ記事/自社サイト ┃ ┃ - Post2(水曜):「AIモデルの軽量化が進む理由」インフォグラフィック/Twitter+LinkedIn ┃ ┃ - Post3(金曜):「注目のオープンソースAIプロジェクト」YouTubeショート ┃ ┃ ┃ ┃ Week2(技術深化編) ┃ ┃ - Post4(月曜):「マルチモーダルAIの最新動向」ブログ記事/note ┃ ┃ - Post5(水曜):「量子コンピューティング×AIの可能性」スライド解説/SlideShare ┃ ┃ - Post6(金曜):「AIデータパイプライン構築のベストプラクティス」ウェビナー告知+予告動画 ┃ ┃ ┃ ┃ Week3(ビジネス応用編) ┃ ┃ - Post7(月曜):「製造業におけるAI自動検査事例」ケーススタディ記事/自社サイト ┃ ┃ - Post8(水曜):「小売業×AIレコメンデーション最新事例」インフォグラフィック ┃ ┃ - Post9(金曜):「AIチャットボット導入のROI試算方法」YouTubeショート ┃ ┃ ┃ ┃ Week4(未来予測&対策編) ┃ ┃ - Post10(月曜):「AIガバナンスと倫理的配慮の最新潮流」ブログ記事 ┃ ┃ - Post11(水曜):「AIによる職務変革:リスキリング戦略」メールマガジン配信 ┃ ┃ - Post12(金曜):「質疑応答ライブ:AIトレンド2025まとめ」Zoom+YouTube Live ┃ ┃ ┃ ┃ 4 タイムライン&優先度 ┃ ┃ • 事前準備(Week0) ┃ ┃ – キーワード調査+Hacker Newsピックアップ(3営業日) ┃ ┃ – 各コンテンツのアウトライン作成(2営業日) ┃ ┃ • 各週 月曜までに当該週の全素材を仮完成し、社内レビュー(優先度高) ┃ ┃ • 水曜・金曜投稿分は前週金曜までに最終チェック ┃ ┃ 5 エンゲージメント&配信戦略 ┃ ┃ • CTA挿入:ブログ末尾に「ホワイトペーパーDL」「ウェビナー参加登録」リンク ┃ ┃ • SNS拡散:Twitterでスレッド形式、LinkedInでコメント促進、各投稿にハッシュタグ(#AI2025, #AIトレンド) ┃ ┃ • インフルエンサー連携:関連記事公開後、関連分野の有識者へメンション&レビュー依頼 ┃ ┃ • フォローアップ:ウェビナー参加者へアンケート配信+当日資料DLリンク ┃ ┃ • 効果測定:Google Analytics/SNSエンゲージメント率を毎週レポート化し、内容・タイミングを微調整 ┃ ┃ ┃ ┃ この4週間プランを通じて、技術的深掘りからビジネス活用、リスク/ガバナンスまで網羅し、マルチチャネルでの配信と継続的なエンゲージメント施策を実行 ┃ ┃ できます。 ┃ ┃ ┃ ┃ ┃ ┃ **Custom Planning Enhancements:** ┃ ┃ - Research Integration: High ┃ ┃ - Strategic Alignment: Optimized for multi-channel distribution ┃ ┃ - Execution Ready: Detailed action items included ┃ ┃ ┃ ┃ ┃ ┗━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━┛ Completed in 20.6s ============================================================
以上