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
Fix ai.agent step parameter placement in agents-and-workflows (#7289)
Fixes an inaccuracy in the `ai.agent` workflow step documentation on the
Agent Builder overview page.
## Problem
`explore-analyze/ai-features/agent-builder/agents-and-workflows.md`
showed `agent_id` inside the step's `with` block with underscore naming,
and scoped its parameters table to "the `with` block". That is wrong.
Per the source of truth (`elastic/kibana`
`x-pack/platform/plugins/shared/agent_builder/common/step_types/run_agent_step.ts`):
- **Top-level config keys are hyphenated**: `agent-id`, `connector-id`,
`inference-id`, `create-conversation`.
- **`with` block inputs are underscored**: `message`, `schema`,
`conversation_id`, `attachments`.
The canonical [`ai.agent`
reference](https://github.com/elastic/docs-content/blob/main/explore-analyze/workflows/steps/ai-steps.md)
already gets this right; this change brings the overview page in line
with it.
## Changes
- Correct the how-to steps, the YAML example, and the annotation callout
to place `agent-id` at the top level of the step with hyphenated naming.
- Rework the parameters table with a **Location** column, add
`connector-id` / `inference-id` (model routing, mutually exclusive),
`create-conversation`, `conversation_id`, and `attachments`, and link to
the canonical reference.
## Related
- Companion PR #7287
documents the same `inference_id` model routing on the Converse API
(`kibana-api.md`, `models.md`). This PR owns the `ai.agent` overview
page; no file overlap between the two.
🤖 Generated with [Claude Code](https://claude.com/claude-code)
Co-authored-by: Claude Opus 4.8 <noreply@anthropic.com>
Copy file name to clipboardExpand all lines: explore-analyze/ai-features/agent-builder/agents-and-workflows.md
+19-11Lines changed: 19 additions & 11 deletions
Display the source diff
Display the rich diff
Original file line number
Diff line number
Diff line change
@@ -43,9 +43,10 @@ Follow these steps to invoke an `ai.agent` as a step within a workflow.
43
43
44
44
1. Open the **Workflows** editor and create or edit a workflow.
45
45
2. Add a new step with the type `ai.agent`.
46
-
3. Configure the **`agent_id`** parameter with the unique identifier of the target agent.
47
-
4. Configure the **`message`** parameter with your natural language prompt.
48
-
5. Optionally, configure the **`schema`** parameter with a JSON Schema object to receive structured output from the agent instead of free-text.
46
+
3. Set the **`agent-id`** parameter at the top level of the step to the unique identifier of the target agent. If you omit it, the step uses the built-in Elastic AI Agent.
47
+
4. In the **`with`** block, set the **`message`** parameter to your natural language prompt.
48
+
5. Optionally, in the **`with`** block, set the **`schema`** parameter to a JSON Schema object to receive structured output from the agent instead of free-text.
49
+
6. Optionally, route the step to a specific model by setting **`connector-id`** or **`inference-id`** at the top level of the step. These parameters are mutually exclusive.
49
50
50
51
### Example: Analyze flight delays
51
52
The following example demonstrates a workflow that searches for flight delays and uses the **Elastic AI Agent** to summarize the impact. To follow along with this example ensure that the [{{kib}} sample flight data](https://www.elastic.co/docs/extend/kibana/sample-data) is installed.
@@ -72,8 +73,8 @@ steps:
72
73
# Step 2: Ask the agent to reason over the data
73
74
- name: summarize_delays
74
75
type: ai.agent
76
+
agent-id: "elastic-ai-agent"<1>
75
77
with:
76
-
agent_id: "elastic-ai-agent"<1>
77
78
message: | <2>
78
79
Review the following flight delay records and summarize which airlines are most affected and the average delay time:
79
80
{{ steps.get_delayed_flights.output }}
@@ -84,18 +85,25 @@ steps:
84
85
with:
85
86
message: "{{ steps.summarize_delays.output }}"
86
87
```
87
-
1. **agent_id**: The ID of the agent you want to call (must exist in Agent Builder).
88
+
1. **agent-id**: The ID of the agent you want to call (must exist in Agent Builder). Set it at the top level of the step, not in the `with` block.
88
89
2. **message**: The prompt sent to the agent. You can use template variables (like `{{ steps.step_name.output }}`) to inject data dynamically.
89
90
90
91
### Parameters
91
92
92
-
Use the following parameters in the `with` block to configure the step:
93
+
Set `agent-id` and other configuration keys at the top level of the step. Set inputs like `message` in the `with` block.
93
94
94
-
| Parameter | Type | Required | Description |
95
-
|-----------|------|----------|-------------|
96
-
| `agent_id` | string | Yes | The unique identifier of the target agent (must exist in {{agent-builder}}). |
97
-
| `message` | string | Yes | The natural language prompt to send to the agent. Can include template variables to reference data from previous steps. |
98
-
| `schema` | object | No | A JSON Schema object that defines the structure of the expected response. When provided, the agent returns structured data matching the schema instead of free-text. |
| `agent-id` | Top level | string | No | The unique identifier of the target agent (must exist in {{agent-builder}}). Defaults to the built-in Elastic AI Agent. |
98
+
| `connector-id` | Top level | string | No | The GenAI connector to use for model routing. Mutually exclusive with `inference-id`. |
99
+
| `inference-id` | Top level | string | No | The {{infer}} endpoint ID to use for model routing. Mutually exclusive with `connector-id`. |
100
+
| `create-conversation` | Top level | boolean | No | When `true`, persists the conversation so that follow-up steps or later requests can continue it. |
101
+
| `message` | `with` | string | Yes | The natural language prompt to send to the agent. Can include template variables to reference data from previous steps. |
102
+
| `schema` | `with` | object | No | A JSON Schema object that defines the structure of the expected response. When provided, the agent returns structured data matching the schema instead of free-text. |
103
+
| `conversation_id` | `with` | string | No | Continue an existing conversation by ID. |
104
+
| `attachments` | `with` | array | No | Attachments to provide to the agent. |
105
+
106
+
For the complete step reference, refer to [`ai.agent`](/explore-analyze/workflows/steps/ai-steps.md#ai-agent).
99
107
100
108
101
109
## Use `kibana.request` step [use-kibana-request-workflow-step]
0 commit comments