DS DevShelfHub Projects · AI tools
Tutorials / CrewAI / Reference / Methods / kickoff()
Method Crew, Flow

kickoff(): Reference Guide

By DevShelfHub

Executes the crew/flow synchronously with the given inputs, returning a CrewOutput / FlowOutput.

See the CrewAI methods catalog, CrewAI introduction, Crew class reference, and core concepts for surrounding context.

What is kickoff()?

kickoff(inputs=None) is the blocking entry point for both Crew and Flow objects. On a Crew, it walks the configured Process: sequential runs each Task in order with optional context wiring, while hierarchical mode routes work through a manager agent that can delegate and verify worker outputs. On a Flow, kickoff initializes typed or dict state, executes @start methods, then fans execution through @listen, @router, and combinators until terminal nodes complete or an error propagates.

The returned CrewOutput (or Flow-specific output) is the stable contract for downstream code: .raw holds the primary string your tasks produced, while structured accessors expose pydantic models or JSON when you configured expected_output that way. Token usage, intermediate task outputs, and tracing hooks attach to the same object so observability layers can log one artifact per run. Because the call blocks until completion, any long LLM or tool chain occupies the calling thread — fine for CLIs and batch workers, awkward for interactive UIs unless you offload with asyncio.to_thread or a task queue.

Inputs should be a flat dict whose keys match placeholders in task descriptions, agent goals, and backstories. Missing keys surface as unreplaced braces rather than exceptions in many templates, so validate inputs at your API boundary. kickoff also triggers @before_kickoff and @after_kickoff hooks on CrewBase scaffolds, making it the right place to attach tracing ids or mutate ephemeral configuration.

Use Cases

  • Script entry point
  • API request handler (sync)
  • CLI commands

Key Features

  • Returns CrewOutput / FlowOutput
  • Accepts an `inputs` dict
  • Triggers @before/@after_kickoff hooks

When NOT to Use

Tight UI loops where you'd block — use kickoff_async() instead.

Notes

Thread blocking and timeouts

kickoff() holds the thread until every task finishes. Put wall-clock timeouts at transport boundaries (HTTP, gRPC) rather than hoping the LLM stack will cancel mid-call unless you have explicit cancellation wired.

Input dict hygiene

Keys must match template placeholders exactly. Prefer a TypedDict or Pydantic model in your host app, then model_dump() into inputs so typos fail fast before the crew runs.

Training and replay artifacts

If you trained with Crew.train(), kickoff() may replay learned preferences. Keep training pickles out of production images unless you intend that behavior; version them alongside crewai releases.

Flows vs crews return shape

Flows still expose .raw on the aggregate result, but intermediate state lives on the Flow instance. Log both flow.state and the kickoff return when debugging branching bugs.

Parameters

Parameter Type Required Purpose
inputs dict | None No Variables interpolated into task descriptions and agent backstories.

Code Examples

Run a crew

python
result = crew.kickoff(inputs={'topic': 'CrewAI'})
print(result.raw)

Structured output

python
out = crew.kickoff(inputs={'topic': 'vector DBs'})
if out.pydantic:
    model = out.pydantic
    print(model.model_dump())

When to Use

Default execution path for both Crews and Flows.

Common Mistakes

❌ Passing positional args

✅ Always pass inputs as a keyword dict: kickoff(inputs={...}).

Related: @tool decorator reference, Agent class reference, and the first Crew tutorial.

kickoff() FAQ

What is kickoff() in CrewAI?

Executes the crew/flow synchronously with the given inputs, returning a CrewOutput / FlowOutput. kickoff(inputs=None) is the blocking entry point for both Crew and Flow objects. On a Crew, it walks the configured Process: sequential runs each Task in order with optional context wiring, while hierarchical mode routes work through a manager agent that can delegate and verify worker outputs. On a Flow, kickoff initializes typed or dict state, executes @start methods, then fans execution through @listen, @router, and combinators until terminal nodes complete or an error prop…

Which CrewAI types expose the method kickoff()?

DevShelfHub documents kickoff() on Crew, Flow. The reference maps it to Python module crewai.Crew — pin your installed crewai version and match imports to the snippet on this page.

When should I use kickoff()?

Default execution path for both Crews and Flows.

When should I avoid kickoff()?

Tight UI loops where you'd block — use kickoff_async() instead.

How do I call kickoff() from Python?

result = crew.kickoff(inputs={'topic': 'AI agents'})

Where can I explore more CrewAI API reference pages?

Open the CrewAI API reference index on DevShelfHub to search classes, methods, and decorators, each with runnable examples, parameters, common mistakes, and cross-links.