from crewai import Agent, Task, Crew
from crewai_tools import InvokeCrewAIAutomationTool
from crewai_tools.aws.bedrock.agents.invoke_agent_tool import BedrockInvokeAgentTool
# External automation
analysis_automation = InvokeCrewAIAutomationTool(
crew_api_url="https://analysis-crew.acme.crewai.com",
crew_bearer_token="YOUR_BEARER_TOKEN",
crew_name="Analysis Automation",
crew_description="Runs the production-grade analysis pipeline",
)
# Managed agent on Bedrock
knowledge_router = BedrockInvokeAgentTool(
agent_id="bedrock-agent-id",
agent_alias_id="prod",
)
automation_strategist = Agent(
role="Automation Strategist",
goal="Orchestrate external automations and summarise their output",
backstory="You coordinate enterprise workflows and know when to delegate tasks to specialised services.",
tools=[analysis_automation, knowledge_router],
verbose=True,
)
execute_playbook = Task(
description="Run the analysis automation and ask the Bedrock agent for executive talking points.",
agent=automation_strategist,
)
Crew(agents=[automation_strategist], tasks=[execute_playbook]).kickoff()