Sub topic 12
Combining several actions in one conversation
This chapter assumes you can add standard actions to a topic in Agentforce Builder. It also assumes you know what action inputs and outputs are, and that you have used the record lookup, summary, and update actions on their own. Here you will combine them in one conversation.
Why chaining works
Most real requests need more than one step. "Summarize Acme and change its phone number" needs a lookup, a summary, and an update. The agent plans these steps itself. After each action it reads the output and decides what to do next.
The agent passes data between actions by reusing outputs as later inputs. For example, Identify Record by Name returns a record ID. Summarize Record and Update Record both need that ID. You do not wire this up by hand. The agent does it, guided by your topic instructions.
Guiding the order with instructions
Without guidance, the agent may skip a step or guess an ID. State the order and the handoffs in the topic instructions.
Topic: Account Support
Instructions:
1. When the user names an account, first use Identify Record by Name. Use the returned record for every later step.
2. If the user asks for an overview, use Summarize Record on that record.
3. Before using Update Record, restate the field and new value and ask the user to confirm.
4. If you cannot find exactly one matching record, ask the user to clarify instead of guessing.Each line does one job. Line 1 sets the first action and the data handoff. Line 3 puts a confirmation gate before a change. Line 4 handles the case where the chain cannot start.
A sample conversation
- The user says: "Give me an overview of Acme and set its phone to 555-0100."
- The agent runs Identify Record by Name with "Acme". It gets one account.
- It runs Summarize Record on that account and shows the summary.
- It asks: "Update Phone to 555-0100 on Acme. Confirm?"
- After the user says yes, it runs Update Record.
Common errors in chains
- Lost context: the agent asks for the account again. Instruction 1 should tell it to reuse the earlier result.
- Wrong action order: an update runs before the lookup. Number the steps and say "first".
- Ambiguous matches: two accounts share a name, and the agent picks one. Require a clarifying question.
- Actions in different topics: a chain only works if every action is in the active topic. If the next step belongs to another topic, the agent must switch topics, and the earlier result may not carry over cleanly. Keep related actions together.
- Missing permission: one step fails because the user lacks access. Later steps then have no input. Test with a realistic user.
Exercise
An agent updates the wrong account because two accounts are named "Acme". Which topic instruction would prevent this, and why?
Show answer
"If you cannot find exactly one matching record, ask the user to clarify instead of guessing." The lookup action can return several matches. This instruction stops the chain before Update Record runs on a guessed record ID.
Exercise
Name the output that Identify Record by Name passes along, and two actions that use it.
Show answer
It passes the record ID. Summarize Record and Update Record both use it as an input.