CREWAI-FLOWS
CrewAI Flows event-driven workflows decorators 2024.
Définition
CrewAI Flows key concepts : (1) @start decorator : marks function as workflow entry point, returns result that triggers @listen functions. (2) @listen decorator : marks function listens for specific upstream function result (or multiple via or_, and_), triggered when upstream finishes. (3) @router decorator : marks function as routing decision, returns string identifying next path/branch to take. (4) State : Pydantic BaseModel managed throughout flow, shared across functions, persistent. (5) Visualizing : flow.plot() generates HTML visualization of workflow graph. (6) Integration Crews : Flows can embed Crews (multi-agent collaboration), each Crew is a step within Flow, hybrid approach combining low-level Crew agent collaboration + high-level Flow orchestration. (7) Async support : functions can be async, leverages asyncio. (8) Persistence : state can be persisted across runs (SQLite + Postgres options). CrewAI Flows positions CrewAI competitor LangGraph (LangChain) + LlamaIndex Workflows + AutoGen v0.4, focus simplicity Python-first developer experience + integration existing CrewAI Crews semantics + visualisation.
Origine
CrewAI Flows announced octobre 2024 par CrewAI Inc. ; v0.x active development.
Exemple en contexte
Content marketing CrewAI Flow : @start function trigger user 'create blog post on AI' input, @listen function ResearchCrew (multi-agent research) ; @listen function WritingCrew (writes draft based research) ; @router function reviews draft + decides if Editorial pass (Edit Crew embedded) or Publish (publish to CMS) ; visualisation flow.plot() shows graph.
Termes liés
- CrewAI — parent product.