You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Copy file name to clipboardExpand all lines: lib/cli/src/crewai_cli/templates/declarative_flow/AGENTS.md
+4-10Lines changed: 4 additions & 10 deletions
Display the source diff
Display the rich diff
Original file line number
Diff line number
Diff line change
@@ -59,9 +59,9 @@ Use these expression forms correctly:
59
59
- Raw CEL: use in `expr`. Do not wrap raw CEL in `${...}`.
60
60
- Use `${...}` inside action mapping strings to read Flow data with CEL. Example value: `Ticket: ${state.ticket_id}`.
61
61
- Use `state` for input data. Use `outputs.step_name` for a completed method result.
62
+
- In action mapping strings, keep literal text outside `${...}` and interpolate each Flow value directly. Write `Ticket: ${state.ticket_id}`; do not assemble the string with CEL `+`.
62
63
- If a value is only one `${...}` expression, the result keeps its type. Use this for numbers, booleans, objects, and lists.
63
64
- If the string has other text, the final value is text. Non-text values become JSON. `null` becomes empty text.
64
-
- Use `text(root, "path", "default")` for values that may be missing or null. The default is optional and is `""`.
- Crew text: use `{name}` placeholders from crew inputs. Example: `Research {topic}`.
88
82
- Crew inputs become prompt text only when agent or task text references matching `{name}` placeholders.
89
83
- Passing an input that is not referenced by any `{name}` placeholder does not ground the crew. If the crew needs a field, put that placeholder in an agent `goal`, task `description`, or task `expected_output`.
@@ -111,6 +105,7 @@ Dynamic value rules:
111
105
- Do not use fields outside the declaration schema.
112
106
- Do not put more than one action under a method's `do`.
113
107
- Do not make `do` a list.
108
+
- Do not use CEL `+` to build text in action mappings. Keep the text literal and insert each dynamic value with `${...}`.
114
109
- Do not reference `outputs.some_method` before `some_method` can run.
115
110
- Do not set a method's `listen` to its own method name.
116
111
- Do not use the same string for an emitted event and a method name unless the user asks for it.
@@ -246,7 +241,7 @@ Shape:
246
241
Fields:
247
242
- `call` (required): must be `crew`. Action discriminator. Use crew to run an inline Crew definition. Example: `crew`
248
243
- `with` (required): inline crew definition. Inline Crew definition to load and execute for this action. Example: `{"agents": {"researcher": {"backstory": "Knows the domain.", "goal": "Research {topic}", "role": "Researcher"}}, "name": "inline_research", "tasks": [{"agent": "researcher", "description": "Research {topic}", "expected_output": "Findings about {topic}", "name": "research_task"}]}`
249
-
- `inputs` (optional): map of string to expression data | null; default `null`. Actual kickoff inputs passed to the Crew. Use `${...}` inside action mapping strings to read Flow data with CEL. Example value: `Ticket: ${state.ticket_id}`. Use `state` for input data. Use `outputs.step_name` for a completed method result. If a value is only one `${...}` expression, the result keeps its type. Use this for numbers, booleans, objects, and lists. If the string has other text, the final value is text. Non-text values become JSON. `null` becomes empty text. Use `text(root, "path", "default")` for values that may be missing or null. The default is optional and is `""`. The evaluated values are available to crew agent and task interpolation as `{name}` placeholders; reference each input the crew needs in agent or task text. Example: `{"topic": "${state.topic}"}`
244
+
- `inputs` (optional): map of string to expression data | null; default `null`. Runtime inputs passed to the Crew. Insert Flow values with `${...}` and reference each input as `{name}` in agent or task text. Example: `{"topic": "${state.topic}"}`
- `tools` (optional): list[string | map of string to any] | null; default `null`. Tool refs or serialized tool definitions available to this agent. String refs can use CrewAI tool names, `custom:<name>`, or fully qualified `module:Class` references. Example: `["crewai_tools:SerperDevTool", "custom:file_read"]`
312
307
- `apps` (optional): list[string] | null; default `null`. Platform apps available to this agent. Can contain app names such as `gmail` or app/action refs such as `gmail/send_email`. Example: `["gmail", "slack/send_message"]`
313
308
- `mcps` (optional): list[string | map of string to any] | null; default `null`. MCP server refs or serialized MCP server configs available to this agent. String refs can use HTTPS URLs, connected MCP integration slugs, or refs with a `#tool_name` suffix for specific tools. Example: `["https://api.weather.com/mcp#get_current_weather", "snowflake", "stripe#list_invoices", {"cache_tools_list": true, "headers": {"Authorization": "Bearer your_token"}, "streamable": true, "url": "https://api.example.com/mcp"}]`
314
-
- `input` (required): string. Input passed to the individual agent kickoff outside of a crew. Use one string. Use `${...}` inside action mapping strings to read Flow data with CEL. Example value: `Ticket: ${state.ticket_id}`. Use `state` for input data. Use `outputs.step_name` for a completed method result. If a value is only one `${...}` expression, the result keeps its type. Use this for numbers, booleans, objects, and lists. If the string has other text, the final value is text. Non-text values become JSON. `null` becomes empty text. Use `text(root, "path", "default")` for values that may be missing or null. The default is optional and is `""`. When an agent needs multiple fields, write one string with labels and separators, for example `Ticket ID: ${state.ticket_id}; Message: ${state.message}`. Example: `${state.ticket.body}`
309
+
- `input` (required): string. Agent prompt template. Insert Flow values with `${...}`, for example `Ticket: ${state.ticket_id}`. Example: `${state.ticket.body}`
315
310
316
311
#### LLM Definition
317
312
@@ -349,4 +344,3 @@ Fields:
349
344
- Crew action-level `inputs` are the Crew kickoff inputs; use CEL-wrapped strings there for runtime values.
"with": "Tool input arguments. Insert Flow values with `${...}`.",
194
+
},
195
+
),
190
196
ModelSpec(
191
197
"FlowCrewActionDefinition",
192
198
"Action",
193
199
"methods.<name>.do[call=crew]",
194
200
examples=True,
195
201
descriptions={
196
202
"call": "Action discriminator. Use crew to run an inline Crew definition.",
197
-
"inputs": f"Actual kickoff inputs passed to the Crew. {FLOW_TEMPLATE_EXPRESSION_CONTRACT} The evaluated values are available to crew agent and task interpolation as `{{name}}` placeholders; reference each input the crew needs in agent or task text.",
203
+
"inputs": "Runtime inputs passed to the Crew. Insert Flow values with `${...}` and reference each input as `{name}` in agent or task text.",
"input": f"Input passed to the individual agent kickoff outside of a crew. Use one string. {FLOW_TEMPLATE_EXPRESSION_CONTRACT} When an agent needs multiple fields, write one string with labels and separators, for example `Ticket ID: ${{state.ticket_id}}; Message: ${{state.message}}`.",
271
+
"input": "Agent prompt template. Insert Flow values with `${...}`, for example `Ticket: ${state.ticket_id}`.",
266
272
"llm": "Language model that runs this agent. Use an object when setting LLM options such as `max_tokens`.",
267
273
"planning_config": "Agent planning configuration. Set `max_attempts` to limit planning refinement attempts before task execution.",
Copy file name to clipboardExpand all lines: lib/crewai/src/crewai/flow/templates/flow_definition_skill.md.j2
+2Lines changed: 2 additions & 0 deletions
Original file line number
Diff line number
Diff line change
@@ -46,6 +46,7 @@ Pick the simplest action that does the job.
46
46
- Use `call: tool` for packaged deterministic work: API calls, searches, lookups, scoring, file work, or custom CrewAI tools.
47
47
{%endif%}
48
48
- Use `call: agent` for one AI worker that classifies, decides, summarizes, writes, or drafts. Put `role`, `goal`, `backstory`, and `input` under `with`. Do not add an action-level `inputs` map to an agent.
49
+
- Repository-backed agents may set `from_repository` and omit inline `role`, `goal`, and `backstory`. Explicitly provided fields override repository values.
49
50
- Use `call: crew` for coordinated AI work with multiple agents or tasks. Define the crew under `with`. Pass runtime values with the action-level `inputs` map.
50
51
{%ifinclude_each_action%}
51
52
- Use `call: each` when the same ordered mini-pipeline must run once per item. Give every step a `name`.
@@ -137,6 +138,7 @@ Dynamic value rules:
137
138
- Do not use fields outside the declaration schema{%ifinclude_tool_action%} or tool refs shown here{%endif%}.
138
139
- Do not put more than one action under a method's `do`.
139
140
- Do not make `do` a list.
141
+
- Do not use CEL `+` to build text in action mappings. Keep the text literal and insert each dynamic value with `${...}`.
140
142
- Do not reference `outputs.some_method` before `some_method` can run.
141
143
- Do not set a method's `listen` to its own method name.
142
144
- Do not use the same string for an emitted event and a method name unless the user asks for it.
0 commit comments