Skip to main content
Build complex workflows by composing smaller, reusable recipes with the include: pattern.
from praisonaiagents import Agent

agent = Agent(name="publisher", instructions="Run modular recipe steps.")
agent.start("Publish this article using the wordpress-publisher include.")
The user defines a main recipe with include: steps; PraisonAI runs each included recipe in order.

How It Works

If you publish a recipe that needs custom tools, prefer declaring them under the tools_sources: / override_files: directives in TEMPLATE.yaml — those load without requiring users to set PRAISONAI_ALLOW_TEMPLATE_TOOLS. Implicit tools.py loading is disabled by default for security (GHSA-xcmw-grxf-wjhj). See Security Environment Variables for details.

Quick Start

1

Simple Usage

steps:
  - agent: content_writer
    action: "Write article about {{topic}}"
  - include: wordpress-publisher
    input: "{{previous_output}}"
2

With Configuration

from praisonaiagents import AgentFlow, include

workflow = AgentFlow(
    name="Content Pipeline",
    steps=[
        content_writer_agent,
        include("wordpress-publisher", input="{{previous_output}}")
    ]
)
result = workflow.run("Write about AI")

Overview

Instead of duplicating common functionality across recipes, extract it into a standalone recipe and include it where needed:
roles:
  content_writer:
    role: Content Writer
    goal: Write articles

includes:
  - wordpress-publisher

Usage Patterns

Include in Steps Format

name: Content Pipeline
steps:
  - agent: content_writer
    action: "Write article about {{topic}}"
  - include: wordpress-publisher
    input: "{{previous_output}}"

Include in Roles Format

framework: praisonai
topic: "AI News"

roles:
  topic_gatherer:
    role: Topic Researcher
    goal: Find news topics
    tasks:
      find_topics:
        description: Search for AI news

  content_writer:
    role: Content Writer
    goal: Write articles
    tasks:
      write:
        description: Write about {{previous_output}}

includes:
  - wordpress-publisher

Include with Configuration

includes:
  - recipe: wordpress-publisher
    input: "{{previous_output}}"

Python API

from praisonaiagents import AgentFlow, Include, include

workflow = AgentFlow(
    name="Content Pipeline",
    steps=[
        content_writer_agent,
        include("wordpress-publisher", input="{{previous_output}}")
    ]
)
result = workflow.run("Write about AI")
from praisonaiagents import Include

step = Include(recipe="wordpress-publisher", input="Custom input here")

call_recipe Tool

Give agents the ability to call other recipes as a tool:
from agent_recipes import call_recipe
from praisonaiagents import Agent

orchestrator = Agent(
    name="Orchestrator",
    instructions="Coordinate content publishing workflows",
    tools=[call_recipe]
)

run_recipe Function

from agent_recipes import run_recipe

result = run_recipe(
    recipe_name="wordpress-publisher",
    input_data="ARTICLE_TITLE: My Title\nARTICLE_CONTENT: ...",
    output="status"
)
print(result['output'])

Creating Reusable Recipes

wordpress-publisher/
├── TEMPLATE.yaml
├── agents.yaml
├── tools.py
└── README.md
agents.yaml:
framework: praisonai
topic: "Publish article to WordPress"

roles:
  publisher:
    role: WordPress Publisher
    goal: Validate and publish blog post
    tools:
      - create_wp_post
    tasks:
      validate_and_publish:
        description: |
          {{previous_output}}
          Extract ARTICLE_TITLE and ARTICLE_CONTENT and call create_wp_post.
        expected_output: Published post with ID and confirmation

Cycle Detection

The include system automatically detects circular includes:
# recipe-a includes recipe-b
# recipe-b includes recipe-a
# → Error: "Circular include detected"

Best Practices

Each recipe should do one thing well — publish, transform, or validate — not all three.
State the expected {{previous_output}} format so included recipes parse input reliably.
Included recipes should fail gracefully when required fields are missing.
Publishing or side-effect steps should be safe to retry without duplicating output.

Available Recipes

praisonai templates list
Key reusable recipes:
  • wordpress-publisher — Publish content to WordPress
  • transcript-generator — Generate transcripts from media
  • data-transformer — Transform data between formats

Workflows

Workflow fundamentals and step types

Recipe Registry

Browse available recipes