Skip to content

Commit fe7d7fc

Browse files
authored
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
1 parent d24f01b commit fe7d7fc

8 files changed

Lines changed: 86 additions & 34 deletions

File tree

explore-analyze/ai-features/agent-builder/agents-and-workflows.md

Lines changed: 6 additions & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
---
22
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."
44
applies_to:
55
stack: preview 9.3+
66
serverless: preview
@@ -14,19 +14,15 @@ products:
1414

1515
# Connect {{agent-builder}} agents and Elastic Workflows
1616

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.
2218

2319
## Approaches
2420

25-
There are three ways to integrate agents and workflows:
21+
There are three ways to use {{agent-builder}} and workflows together:
2622

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).
3026

3127
## Prerequisites
3228

@@ -36,7 +32,6 @@ Before you begin:
3632
* Enable the Workflows feature in **Advanced settings**.
3733
* Ensure you have the correct privileges to create and run workflows.
3834
* For details, refer to [Set up workflows](/explore-analyze/workflows/get-started/setup.md).
39-
* Create at least one workflow.
4035

4136
## Pre-execution workflows [pre-execution-workflows]
4237

explore-analyze/ai-features/agent-builder/chat.md

Lines changed: 45 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -282,6 +282,51 @@ For example, before creating a dashboard the agent might ask which sample data s
282282
:width: 650px
283283
:::
284284

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)
329+
285330
## Customize your agent [customize-your-agent]
286331

287332
```{applies_to}

explore-analyze/ai-features/agent-builder/custom-skills.md

Lines changed: 31 additions & 19 deletions
Original file line numberDiff line numberDiff line change
@@ -25,11 +25,19 @@ Create a custom skill when you have domain-specific knowledge or procedures that
2525
- **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.
2626
- **Keep agent prompts clean**: Move detailed, task-specific instructions out of the system prompt and into a skill that loads only when needed.
2727

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]
2937

3038
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.
3139

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**.
3341

3442
:::{tip}
3543
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
3846
:::::{stepper}
3947
::::{step} Open the Create skill dialog
4048

41-
Go to **Manage components > Skills**, then select **Create a skill**.
49+
Go to **Manage components Skills**, then select **Create a skill**.
4250

4351
:::{image} images/create-new-skill.png
4452
: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
6977

7078
::::{step} Add the skill to an agent
7179

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:
7381

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.
7583
- **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.
7684

7785
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
8896

8997
:::::
9098

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).
102+
103+
- [List skills]({{kib-apis}}operation/operation-get-agent-builder-skills) `GET /api/agent_builder/skills`
104+
- [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]
92110

93111
```{applies_to}
94112
stack: ga 9.5+
95113
serverless: ga
96114
```
97115

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.
99117

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**.
101119

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).
107-
108-
- [List skills]({{kib-apis}}operation/operation-get-agent-builder-skills) `GET /api/agent_builder/skills`
109-
- [Create a skill]({{kib-apis}}operation/operation-post-agent-builder-skills) `POST /api/agent_builder/skills`
110-
- [Get a skill by ID]({{kib-apis}}operation/operation-get-agent-builder-skills-skillid) `GET /api/agent_builder/skills/{skillId}`
111-
- [Update a skill]({{kib-apis}}operation/operation-put-agent-builder-skills-skillid) `PUT /api/agent_builder/skills/{skillId}`
112-
- [Delete a skill]({{kib-apis}}operation/operation-delete-agent-builder-skills-skillid) `DELETE /api/agent_builder/skills/{skillId}`
120+
:::{image} images/create-skill-from-chat.png
121+
:screenshot:
122+
:alt: Skill draft in Agent Chat showing its description, instructions preview, associated tool references, and a Create skill button
123+
:width: 750px
124+
:::
113125

114126
## Related pages
115127

explore-analyze/ai-features/agent-builder/glossary.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -348,4 +348,4 @@ Workflow tool {applies_to}`stack: preview 9.3+` {applies_to}`serverless: preview
348348

349349
$$$workflows$$$
350350
Workflows
351-
: 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).
267 KB
Loading
110 KB
Loading

explore-analyze/ai-features/agent-builder/tools/builtin-tools-reference.md

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -81,8 +81,8 @@ These platform core tools let agents run and track [Elastic Workflows](/explore-
8181
`platform.core.resume_workflow_execution` {applies_to}`stack: ga 9.4+`
8282
: 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.
8383

84-
`platform.core.generate_workflow` {applies_to}`stack: preview 9.5`
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.
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).
8686

8787
`platform.core.execute_workflow` {applies_to}`stack: preview 9.5`
8888
: 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.

explore-analyze/ai-features/agent-builder/tools/workflow-tools.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -17,7 +17,7 @@ products:
1717
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.
1818

1919
:::{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).
2121
:::
2222

2323
## Prerequisites

0 commit comments

Comments
 (0)