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
Document creating skills and workflows from Agent Chat (#7539)
## Summary
- document how to create custom skills directly from Agent Chat
- document the human-in-the-loop workflow creation flow in Agent Chat,
including the Preview and Save flow
- clarify the UI, API, and Agent Chat creation methods for custom skills
- document the three ways Agent Builder and Workflows work together:
create workflows from chat, trigger workflows from agents, and call
agents from workflows
- link the workflow conceptual guide, workflow tool guide, and workflow
generation tool reference to the chat creation flow
- add screenshots of the skill and workflow draft previews
## Validation
- `git diff --check`
- Vale: 0 errors
Copy file name to clipboardExpand all lines: explore-analyze/ai-features/agent-builder/agents-and-workflows.md
+6-11Lines changed: 6 additions & 11 deletions
Display the source diff
Display the rich diff
Original file line number
Diff line number
Diff line change
@@ -1,6 +1,6 @@
1
1
---
2
2
navigation_title: "Connect agents and workflows"
3
-
description: "Learn how to connect Agent Builder agents and Elastic Workflows, including workflow tools, pre-execution workflows, and the `ai.agent` step."
3
+
description: "Learn how Agent Builder works with Elastic Workflows, including creating workflows from chat, workflow tools, pre-execution workflows, and the `ai.agent` step."
4
4
applies_to:
5
5
stack: preview 9.3+
6
6
serverless: preview
@@ -14,19 +14,15 @@ products:
14
14
15
15
# Connect {{agent-builder}} agents and Elastic Workflows
16
16
17
-
Elastic Workflows and {{agent-builder}} allow you to combine deterministic automation with conversational reasoning. By invoking an AI agent directly within a workflow execution, you can treat the agent as a "reasoning engine" that summarizes data, classifies events, or makes decisions before passing the results to the next step in your automation.
18
-
19
-
:::{note}
20
-
This guide explains how to call an agent from a workflow. If you want to trigger a workflow in an agent conversation, you need to create a custom [workflow tool](./tools/workflow-tools.md). For workflows that run before the agent makes any LLM calls in response to a user message, refer to [Pre-execution workflows](#pre-execution-workflows).
21
-
:::
17
+
Elastic Workflows and {{agent-builder}} combine deterministic automation with conversational reasoning. You can create workflows conversationally, make workflows available to agents, and invoke agents from workflows.
22
18
23
19
## Approaches
24
20
25
-
There are three ways to integrate agents and workflows:
21
+
There are three ways to use {{agent-builder}} and workflows together:
26
22
27
-
***The `ai.agent` step:** A simplified shorthand step for common operations. Use this when you want to send a prompt to an agent and receive a text response without complex configuration.
28
-
***The `kibana.request` step:**A generic step that provides full access to the {{agent-builder}} APIs. Use this for advanced use cases, such as listing available agents or managing agent sessions programmatically.
29
-
***Pre-execution workflows:**Workflows assigned to an agent that run once after each user message, before the agent makes any LLM calls in response. Use this when you want deterministic setup or validation before the LLM starts.
23
+
***Create workflows from Agent Chat** {applies_to}`stack: ga 9.5+` {applies_to}`serverless: ga`: Describe the automation you want in natural language, refine the generated draft, then open **Preview** and select **Save**to create it. Refer to [Create skills and workflows in chat](chat.md#create-skills-and-workflows-directly-from-chat).
24
+
***Use workflows from agents:**Trigger an existing workflow from a conversation with a [workflow tool](./tools/workflow-tools.md), or assign [pre-execution workflows](#pre-execution-workflows) that run before the agent starts reasoning.
25
+
***Use agents from workflows:**Invoke an agent from a workflow with the [`ai.agent` step](#use-ai-agent-workflow-step). For advanced API operations, use the [`kibana.request` step](#use-kibana-request-workflow-step).
30
26
31
27
## Prerequisites
32
28
@@ -36,7 +32,6 @@ Before you begin:
36
32
* Enable the Workflows feature in **Advanced settings**.
37
33
* Ensure you have the correct privileges to create and run workflows.
38
34
* For details, refer to [Set up workflows](/explore-analyze/workflows/get-started/setup.md).
Copy file name to clipboardExpand all lines: explore-analyze/ai-features/agent-builder/chat.md
+45Lines changed: 45 additions & 0 deletions
Display the source diff
Display the rich diff
Original file line number
Diff line number
Diff line change
@@ -282,6 +282,51 @@ For example, before creating a dashboard the agent might ask which sample data s
282
282
:width: 650px
283
283
:::
284
284
285
+
## Create skills and workflows in chat [create-skills-and-workflows-directly-from-chat]
286
+
287
+
```{applies_to}
288
+
stack: ga 9.5+
289
+
serverless: ga
290
+
```
291
+
292
+
In addition to answering questions and analyzing data, agents can help you create reusable skills and Elastic Workflows without leaving the conversation. Describe what you want to build in natural language:
293
+
294
+
-**Skills**: For example, "Create a skill that handles production alerts using our incident runbook."
295
+
-**Workflows**: For example, "Create a workflow that checks for failed payments every five minutes and sends a Slack notification."
296
+
297
+
Creating a resource from chat is a [human-in-the-loop](#human-in-the-loop-prompts) process:
298
+
299
+
1. The agent gathers the requirements from your request. If important information is missing or ambiguous, it pauses to ask [clarifying questions](#answer-a-clarifying-question).
300
+
2. The agent generates a draft and presents it in the conversation. You can review the configuration and ask for changes in natural language.
301
+
3. When the draft is ready, confirm creation from the preview:
302
+
- For skills, select **Create skill**.
303
+
- For workflows, select **Preview**, review the definition, then select **Save**. If you are replacing an existing workflow, select **Override**.
304
+
305
+
The resource is not created until you complete this step.
306
+
307
+
When you create a workflow, include details such as its trigger, inputs, data sources, conditions, and connectors. The agent asks for any missing information, generates and validates the workflow YAML, and shows the proposed changes for you to review. You can continue refining the draft in the conversation before you open the preview.
308
+
309
+
For example, the following response includes the generated workflow definition and a summary of its trigger and steps. Select **Preview** to review and save the workflow:
310
+
311
+
:::{image} images/create-workflow-from-chat.png
312
+
:screenshot:
313
+
:alt: Agent Chat showing a workflow request, generated YAML diff, workflow summary, and Preview button
314
+
:width: 720px
315
+
:::
316
+
317
+
For example, the following preview shows a skill draft that you can review before selecting **Create skill**:
318
+
319
+
:::{image} images/create-skill-from-chat.png
320
+
:screenshot:
321
+
:alt: Skill draft in Agent Chat showing its description, instructions preview, associated tool references, and a Create skill button
322
+
:width: 750px
323
+
:::
324
+
325
+
You need the same privileges that are required to create the resource in its management UI. For resource-specific fields, limitations, and alternative creation methods, refer to:
326
+
327
+
-[Create and manage custom skills](custom-skills.md#create-a-skill-from-chat)
328
+
-[Create and manage workflows](/explore-analyze/workflows.md)
Copy file name to clipboardExpand all lines: explore-analyze/ai-features/agent-builder/custom-skills.md
+31-19Lines changed: 31 additions & 19 deletions
Display the source diff
Display the rich diff
Original file line number
Diff line number
Diff line change
@@ -25,11 +25,19 @@ Create a custom skill when you have domain-specific knowledge or procedures that
25
25
-**Scope tools to a task**: Bundle specific tools with the instructions that explain how and when to use them, so the agent only has access to relevant tools for the task at hand.
26
26
-**Keep agent prompts clean**: Move detailed, task-specific instructions out of the system prompt and into a skill that loads only when needed.
27
27
28
-
## Create a custom skill
28
+
## Create a custom skill [create-a-custom-skill]
29
+
30
+
You can create a custom skill in three ways:
31
+
32
+
- Use the {{agent-builder}} UI.
33
+
- Use the {{kib}} REST API.
34
+
- Ask an agent to create it from Agent Chat.
35
+
36
+
### Create a skill in the UI [create-a-skill-in-the-ui]
29
37
30
38
Follow these steps to create a custom skill and add it to your skill library. Once saved, you need to add the skill to an agent before the agent can use it.
31
39
32
-
You can create a skill from **Manage components > Skills**, or inline when adding skills to an agent from **Customize > Skills**.
40
+
You can create a skill from **Manage components → Skills**, or inline when adding skills to an agent from **Customize → Skills**.
33
41
34
42
:::{tip}
35
43
For guidance on writing effective descriptions and instructions, refer to [Skill creation guidelines](skill-creation-guidelines.md).
@@ -38,7 +46,7 @@ For guidance on writing effective descriptions and instructions, refer to [Skill
38
46
:::::{stepper}
39
47
::::{step} Open the Create skill dialog
40
48
41
-
Go to **Manage components > Skills**, then select **Create a skill**.
49
+
Go to **Manage components → Skills**, then select **Create a skill**.
42
50
43
51
:::{image} images/create-new-skill.png
44
52
:alt: Create skill dialog showing fields for ID, Name, Description, Instructions, and Associated tools
@@ -69,9 +77,9 @@ Select **Save**. The skill is added to your library and becomes available to ass
69
77
70
78
::::{step} Add the skill to an agent
71
79
72
-
Custom skills in your library are not available to your agents until you explicitly add them. To add a skill, go to **Customize > Skills** on the agent you want to configure and select **Add skills**. From here you can:
80
+
Custom skills in your library are not available to your agents until you explicitly add them. To add a skill, go to **Customize → Skills** on the agent you want to configure and select **Add skills**. From here you can:
73
81
74
-
-**Import from skill library**: Select an existing skill from **Manage components > Skills**. After importing, make sure the skill is toggled on in the agent's skill list.
82
+
-**Import from skill library**: Select an existing skill from **Manage components → Skills**. After importing, make sure the skill is turned on in the agent's skill list.
75
83
-**Create a skill**: Build a new skill and add it to this agent in one step. The skill is enabled for the agent automatically and also saved to your library.
76
84
77
85
Built-in skill availability depends on your deployment type. Refer to [Built-in skills reference](builtin-skills-reference.md) for details.
@@ -88,28 +96,32 @@ For guidance on writing effective instructions, refer to [Skill creation guideli
88
96
89
97
:::::
90
98
91
-
## Create a skill from chat
99
+
### Create a skill with the API [skills-api]
100
+
101
+
Create and manage skills programmatically using the {{kib}} REST API. The API supports all the same fields as the UI, including [`referenced_content`]({{kib-apis}}operation/operation-post-agent-builder-skills#operation-post-agent-builder-skills-body-application-json-referenced_content) for additional named content blocks the agent can read selectively. For request examples, refer to [Skills APIs](kibana-api.md#skills-apis).
-[Create a skill]({{kib-apis}}operation/operation-post-agent-builder-skills)`POST /api/agent_builder/skills`
105
+
-[Get a skill by ID]({{kib-apis}}operation/operation-get-agent-builder-skills-skillid)`GET /api/agent_builder/skills/{skillId}`
106
+
-[Update a skill]({{kib-apis}}operation/operation-put-agent-builder-skills-skillid)`PUT /api/agent_builder/skills/{skillId}`
107
+
-[Delete a skill]({{kib-apis}}operation/operation-delete-agent-builder-skills-skillid)`DELETE /api/agent_builder/skills/{skillId}`
108
+
109
+
### Create a skill from Agent Chat [create-a-skill-from-chat]
92
110
93
111
```{applies_to}
94
112
stack: ga 9.5+
95
113
serverless: ga
96
114
```
97
115
98
-
You can create custom skills conversationally by asking an agent to build one directly in the chat interface. Instead of filling in a form, you describe the skill you want and the agent guides you through defining the name, description, instructions, and tools.
116
+
Open a conversation with any agent and ask it to create a skill. For example, "Create a skill that handles production alerts using our incident runbook." The agent asks clarifying questions when it needs more information, then presents the generated skill as a draft.
99
117
100
-
To create a skill from chat, open a conversation with any agent and ask it to create a new skill. For example, you might say "Create a skill that triages production alerts using our incident runbook." The agent walks you through each field, suggests instructions based on your input, and saves the skill to your library when you confirm.
118
+
Review the description, instructions, associated tools, and references, and ask the agent to edit anything that needs changing. When the draft is ready, select **Create skill**. The skill is not added to your library until you select **Create skill**.
101
119
102
-
This approach is useful when you want to iterate quickly or when you find it easier to explain a workflow in natural language than to write structured instructions from scratch.
103
-
104
-
## Skills API
105
-
106
-
You can also create and manage skills programmatically using the {{kib}} REST API. The API supports all the same fields as the UI, including [`referenced_content`]({{kib-apis}}operation/operation-post-agent-builder-skills#operation-post-agent-builder-skills-body-application-json-referenced_content) for additional named content blocks the agent can read selectively. For request examples, refer to [Skills APIs](kibana-api.md#skills-apis).
: Elastic's native automation engine for declarative, event-driven automation defined in YAML. {{agent-builder}} integrates with workflows in two directions: agents can trigger workflows through workflow tools, and workflows can call agents through the `ai.agent` and `kibana.request` steps. See [](agents-and-workflows.md#approaches).
351
+
: Elastic's native automation engine for declarative, event-driven automation defined in YAML. You can use {{agent-builder}} and workflows together in three ways: {applies_to}`stack: ga 9.5+` {applies_to}`serverless: ga`[create workflows from Agent Chat](chat.md#create-skills-and-workflows-directly-from-chat), trigger existing workflows from agents through [workflow tools](tools/workflow-tools.md), and call agents from workflows through the [`ai.agent` and `kibana.request` steps](agents-and-workflows.md#approaches).
Copy file name to clipboardExpand all lines: explore-analyze/ai-features/agent-builder/tools/builtin-tools-reference.md
+2-2Lines changed: 2 additions & 2 deletions
Display the source diff
Display the rich diff
Original file line number
Diff line number
Diff line change
@@ -81,8 +81,8 @@ These platform core tools let agents run and track [Elastic Workflows](/explore-
81
81
`platform.core.resume_workflow_execution` {applies_to}`stack: ga 9.4+`
82
82
: Resumes an [Elastic Workflows](/explore-analyze/workflows.md) execution that is paused at a [`waitForInput`](/explore-analyze/workflows/authoring-techniques/human-in-the-loop.md) step, providing the reviewer's input to the workflow so it can continue.
: Generates or updates an [Elastic Workflows](/explore-analyze/workflows.md) definition from a natural language description, delegating to a specialized workflow-authoring agent that knows workflow syntax, step types, and available connectors.
84
+
`platform.core.generate_workflow` {applies_to}`stack: ga 9.5+` {applies_to}`serverless: ga`
85
+
: Generates or updates an [Elastic Workflows](/explore-analyze/workflows.md) definition from a natural language description, delegating to a specialized workflow-authoring agent that knows workflow syntax, step types, and available connectors. This tool powers [workflow creation from Agent Chat](../chat.md#create-skills-and-workflows-directly-from-chat).
: Executes an [Elastic Workflows](/explore-analyze/workflows.md) definition, given a saved workflow ID, inline YAML for an ephemeral run, or a workflow YAML attachment.
Copy file name to clipboardExpand all lines: explore-analyze/ai-features/agent-builder/tools/workflow-tools.md
+1-1Lines changed: 1 addition & 1 deletion
Display the source diff
Display the rich diff
Original file line number
Diff line number
Diff line change
@@ -17,7 +17,7 @@ products:
17
17
Workflow tools enable agents to trigger [Elastic Workflows](/explore-analyze/workflows.md) directly from a conversation and use their output. This is ideal for offloading tasks from the LLM that require a deterministic, repeatable sequence of actions.
18
18
19
19
:::{note}
20
-
This page explains how to trigger a workflow in an agent conversation. If you want to use an agent within a workflow step, refer to [Call agents from workflows](../agents-and-workflows.md).
20
+
This page explains how to trigger an existing workflow in an agent conversation. To create a new workflow from Agent Chat, refer to [Create skills and workflows in chat](../chat.md#create-skills-and-workflows-directly-from-chat). If you want to use an agent within a workflow step, refer to [Call agents from workflows](../agents-and-workflows.md).
0 commit comments