Sub topic 4
Designing a focused action
This chapter assumes you know how agents, topics, and actions relate, and that you can build a basic autolaunched flow in Flow Builder. It covers how to decide what one action should do before you build it.
Why one action should do one thing
The agent's language model chooses actions by reading their names and descriptions. It then fills in the inputs from the conversation. A narrow action gives it a clear choice. A broad action that does several jobs forces it to guess which job applies and which inputs matter.
A focused action has three traits:
- It answers one kind of request, such as "what is the status of this case?"
- It has a small set of inputs the agent can realistically get from a user.
- It returns a result the agent can say back in a sentence or two.
Broad versus focused
| Design | Example | Problem or benefit |
|---|---|---|
| Broad | `Manage Case` with inputs `operation`, `caseNumber`, `newStatus`, `comment` | The agent must pick an operation value. Many inputs are blank for any one request. |
| Focused | `Get Case Status` with input `caseNumber` | One purpose. The agent knows when to call it and what to ask. |
| Focused | `Add Case Comment` with inputs `caseNumber`, `commentText` | Separate action, separate permissions, easy to test. |
Splitting the broad action also lets you give each piece different security settings. A read-only lookup can run with far less access than an action that updates records.
A short design checklist
Answer these before you open Flow Builder.
- What single user request does this action serve? Write it as one sentence.
- What does the agent need from the user? List only the values it cannot find on its own.
- What should the agent say afterward? That becomes your output.
- Does it read data, change data, or both? If both, consider whether two actions are clearer.
- What could go wrong? Note the cases, such as no matching record, so you can return a usable message later.
Worked example
Suppose support staff want the agent to handle case questions. A first draft might be one flow called Case Helper that looks up status, adds comments, and closes cases. Applying the checklist gives these actions:
Get Case Status: inputcaseNumber, outputcaseStatus. It is read-only.Add Case Comment: inputscaseNumberandcommentText, output a confirmation message. It creates a record.Close Case: inputcaseNumberand a reason. You might also require a confirmation step in the topic instructions.
Each flow stays short, and each can be tested alone. The names are verbs the model can match to a request.
Common mistakes
- Mode switches. An input such as
actionormodethat selects a branch inside the flow means you have several actions in one. - Too many inputs. Each input is a question the agent may ask the user. Pass fixed values inside the flow instead of exposing them. Look up related values with Get Records instead of asking for them.
- Unclear names.
Flow1orUpdatetells the model nothing. Use a name that states the task and object. - Splitting too far. Do not create an action per field. If two steps always happen together for the same request, one action is fine.
Exercise
A flow has an input operation that accepts "lookup", "update", or "close", plus a caseNumber input. What is wrong with this design, and how would you fix it?
Show answer
The operation input makes one action do three jobs, so the agent must guess the value and the flow has to branch on it. Split it into three actions, such as Get Case Status, Update Case, and Close Case. Each then needs only the inputs for its own job and can have its own permissions.