Crews and Processes
A Crew is a set of agents, a set of tasks, and a Process (execution strategy). Start it with crew.kickoff(inputs=...); use kickoff_async() for async.
In production, a Crew usually lives inside one Flow @listen step, not as the whole program. See Introduction and Flows.
Create and run
CrewOutput: raw, pydantic, json_dict, tasks_output, token_usage. For JSON, set output_pydantic / output_json on the last task.
Other frequent options: cache (tool-result cache, default True), max_rpm, embedder (for memory; OpenAI by default), manager_llm / manager_agent, output_log_file, stream, checkpoint.
Process.sequential
Process is an enum: sequential and hierarchical.
Sequential runs the tasks list in order; earlier output becomes later context. This is the default and the right starting point.
Use context=[other_task] on a Task when you need an explicit dependency, rather than assuming list order is the only data flow.
Process.hierarchical
Hierarchical mimics a manager assigning work. Tasks need not be pre-bound to agents. You must set manager_llm or manager_agent. The manager plans, delegates, and reviews.
JSONC: "process": "hierarchical" plus manager_llm or manager_agent (the manager file may sit outside the top-level agents array).
Hierarchical crews cost more tokens and are harder to debug. Stabilize sequential first; enable hierarchy when assignment must be dynamic.
JSONC vs classic scaffold
Default crewai create crew is JSON-first: crew.jsonc + agents/*.jsonc, loaded by crewai run.
crewai create crew <name> --classic uses crew.py and YAML plus @CrewBase, @agent, @task, @crew (classic path only — not Flow decorators). JSON "custom:" tools and {"python": "module.attribute"} execute local Python; only run projects you trust.
Load a JSON crew:
Checkpoints and logs
checkpoint=True (or CheckpointConfig) saves state after key events so interrupted runs can resume. output_log_file=True writes logs.txt; a .json path writes JSON logs.