Skip to main content

Should I build my AI agent with a prompt or with a workflow that follows an exact script?

There are two ways to control an AI agent, and you can combine them: use the system prompt only, workflow nodes only, or a hybrid of both.

The prompt way (system prompt or instructions): you write instructions in plain language in one place and the agent follows them in a free flowing conversation, speaking more fluidly. It is the fast way to start and good for a flexible conversation or a demo, but the conversation is open to interpretation, so you get some variability in what it says.

The workflow way (flow builder): you map out the conversation visually with connected conversation nodes, like a script, so the agent says exactly what you set in each step, word for word. It is predictable and repeatable, and it is what we recommend for a real agent, especially if you worry about what the AI might say or a client wants the agent to say precisely certain things, such as for compliance. A workflow is structured but still open ended: if the caller goes off script, the agent tries to bring them back on track, and when it reaches the end of the flow it keeps talking based on its system prompt.

To build a scripted conversation:

  1. Open the agent and click Agent workflows.
  2. Start with the Conversation started trigger, which fires for any conversation (voice, SMS, email or social media).
  3. Add a conversation node and type exactly what the agent should say, for example: Hello, how can I help you today? Would you like sales or support?
  4. Give the node a route for each answer (for example sales and support) and connect each route to its own conversation node, building a conversation tree.
  5. Use the Auto layout button to tidy the builder, then save.
  6. Click Test and talk to the agent. The flow shows which step the AI is on. If you do not like a reply, edit the text of the step live, click Apply and Save, and use the Rewind button to replay from an earlier point and hear the change straight away.

If you put the greeting in a workflow, remove any separate opening greeting in the agent's prompt settings, otherwise the agent says two opening greetings.

There is no separate workflow builder. Every workflow, with or without AI, lives inside an agent under Agents, and one agent can have as many workflows as you want, for example one for answered calls and another for outbound calls. A workflow starts with a trigger, such as Conversation started or a manual trigger, and has steps for nearly everything, which work during a live call too: sending an SMS (for example a booking link) or an email, waits, decisions and conditions, making an API call, updating custom values, contacts and fields, changing pipeline stages and forwarding the call. An email sequence is simply a workflow of emails, waits and SMS steps.

Global nodes let the agent leave its path at any time, for example anytime someone asks for a manager, go to a call forwarding node. The call forwarding node supports business hours (such as Monday to Friday, 9 to 5), a caller ID and any number to forward to, with branches for answered, not answered and outside hours. A node shown in red still needs configuration.

You can build workflows with drag and drop, or tell the AI assistant what you want and it builds or changes the workflow for you, mapping out the whole conversation: greeting, booking, cancelling, questions and collecting information. You can copy and paste a whole workflow or individual nodes to other agents.