> ## Documentation Index
> Fetch the complete documentation index at: https://docs.definable.ai/llms.txt
> Use this file to discover all available pages before exploring further.

# Tasks Team

> Autonomous task decomposition and delegation.

Build a team that autonomously decomposes a goal into tasks and delegates them.

<Steps>
  <Step title="Create the team">
    ```python tasks_team.py theme={null}
    import asyncio
    from definable.agent import Agent
    from definable.agent.team import Team, TeamMode

    researcher = Agent(
        model="gpt-4o",
        instructions="You are a research specialist. Gather facts and data on assigned topics.",
    )
    designer = Agent(
        model="gpt-4o",
        instructions="You are a UX designer. Create wireframes and design specifications.",
    )
    developer = Agent(
        model="gpt-4o",
        instructions="You are a developer. Write implementation plans and code outlines.",
    )

    team = Team(
        name="product-team",
        model="gpt-4o",
        members=[researcher, designer, developer],
        mode=TeamMode.tasks,
        max_iterations=10,
        instructions="Build a complete product specification for the given feature.",
    )

    async def main():
        result = await team.arun("Design a user onboarding flow for a SaaS product.")
        print(result.content)

    asyncio.run(main())
    ```
  </Step>

  <Step title="Install and run">
    <Snippet file="install-definable.mdx" />

    ```bash theme={null}
    python tasks_team.py
    ```

    The leader creates tasks (research competitors, design wireframes, write specs), assigns them to members, and iterates until all tasks are complete.
  </Step>
</Steps>
