Persona & Prompt Engineering
There are three different prompts to write, and each has its own rules:
- The persona of an agent with no workflow (
personaPrompt). - The conversational prompt of an
llmnode whose output the user reads or hears. - The narrow-task prompt of an
llmnode that classifies a message or extracts one value.
Where each one is used is set out on Configuring an Agent: an agent with a workflow never reads personaPrompt, so its persona belongs in the llm node.
1. The persona
Section titled “1. The persona”A persona answers four questions and nothing more:
- Who is the agent? A role and a domain.
- What tone does it use? Pick one and state it.
- What is it not for? A scope boundary stops it answering questions it has no data for.
- What does it do when it does not know? Without an explicit fallback, the model guesses.
Weak:
You are a helpful assistant. Answer questions about our library.No tone, no boundary, no fallback: it will answer anything, in whatever tone the model drifts to.
Strong:
You are a friendly library assistant. You help people find books, checkroom availability and use library services. Be concise. If you do notknow, say so.Leave out sequencing (“after four questions, wrap up”), branching and tool calls. In a workflow agent that logic belongs to nodes: a condition on the built-in turnCount, a router, a tool. The screening agent recipe shows the split.
2. A conversational llm node
Section titled “2. A conversational llm node”In a workflow agent, the persona above goes into the llm node that writes the reply. The node’s rendered promptTemplate, or its systemPrompt when set, is the system prompt; the model receives the conversation so far and the user’s latest message separately, so you do not paste {{conversationHistory}} or {{userMessage}} into the prompt to make them visible. Set one of the two fields, not both: systemPrompt drops promptTemplate.
Spoken replies
Section titled “Spoken replies”Text that will be spoken needs short sentences, one question at a time and no lists or markdown. The platform adds these rules for you, so do not repeat them in the prompt:
- Agent without a workflow: the rules are appended to
personaPrompton every voice, SDK and channel session. They are left out only for a draft test chat in the dashboard and for a session the dashboard starts as text only. - Workflow agent: set
applyVoiceFormatting: trueon thellmnode whose output feeds a spokenresponsenode. Never set it on a node that feeds acondition,routerorswitch.
3. A narrow-task llm node
Section titled “3. A narrow-task llm node”A node that classifies a message or extracts one value is not a persona. Write it as a pipeline step: terse, mechanical, and explicit that it is not talking to anyone. A narrow node in a conversational context can drift into answering the conversation instead of doing its one job, and this gets more likely with small, fast models.
Tell the model plainly:
- it is not talking to the end user;
- it must not write a reply, a confirmation or any commentary, because another node does that;
- it outputs only the requested value, in the exact format the next node needs.
The full pattern, with a worked prompt, is in LLM nodes: extraction vs. conversation.
Wording reduces drift but cannot rule it out. Where the next node needs a clean value, add a structural guard instead of a longer prompt:
| Need | Use |
|---|---|
| One label from a fixed set | matchAnyOf |
| A number to pass to a tool | extractFirstInteger |
| Several typed fields | outputSchema |
| No influence from earlier turns | excludeHistory |
Which prompt am I writing?
Section titled “Which prompt am I writing?”| You are writing | Section | Rule of thumb |
|---|---|---|
personaPrompt of an agent without a workflow | 1 | Identity, tone, scope, fallback; nothing else |
The prompt of an llm node feeding a response the user reads | 1 and 2 | The persona, in the node |
| The same, when the reply is spoken | 2 | Add applyVoiceFormatting, not wording |
The prompt of an llm node feeding a condition, router or tool | 3 | “You are not the assistant”; add a guard field |
Next steps
Section titled “Next steps”- Configuring an Agent:
personaPrompt,useCaseand the workflow link. - LLM node: every config field named on this page.
- Workflow Design Best Practices: templating rules and the extraction pattern.
- Cookbook: complete agents built this way.