Skip to main content
A prompt is mostly fixed text, with gaps that are filled in each time the agent runs: the question someone asked, the name of the person who wrote, what an earlier step found. The gaps are written in double curly braces, {{ }}. ServFlow calls this dynamic content. This page explains how to read and write it. For every function, see the Dynamic content reference.

Reading a template

Text with gaps in it is called a template. This one is the User prompt of a Discord agent:
Everything outside the braces is sent as written. Each pair of braces is replaced when the agent runs: the first with the name of the person who wrote, the second with their message.

Where you can use it

In a System prompt and a User prompt, in a tool’s settings, in a context step’s settings, and in a guard’s condition. A field that accepts dynamic content shows Supports {{ }} templates under its label.

What you can read depends on how the agent was started

Three things to watch:
  • A Discord agent cannot use body. It has no web request to read.
  • body reads a web request only when the request is sent as JSON.
  • An agent that runs on a schedule has no message to read, so leave input out of its prompts.
The Available entry handlers lists every name under .discord, .telegram, and .github.

What you can read from any agent

  • What an earlier context step found. {{ .customer.name }} reads name from a step called customer. See Context fetching.
  • A stored secret. {{ secret "weather-api-key" }}. See Secrets.
  • Inside a tool, what the agent passed to it. {{ tool_param "question" }}. See Add a tool to an agent.

Small changes to a value

A function can change a value on its way in. Three common ones: The brackets in (body "count") mean “work this out first”.

If something is missing

A gap whose value is missing is left empty, and the prompt still goes out. Write prompts that read sensibly when that happens. A misspelt function name is different. In a guard, ServFlow refuses it when you save. In a prompt, the agent fails when it runs.

Dynamic content in the dashboard

Every field that accepts dynamic content has two small buttons in its corner. Insert a variable opens a menu of what the field can read, such as the results of context steps and your secrets, and writes the braces for you. Expand editor opens the field in a larger window. Typing inside braces suggests names as you go.
The Insert a variable menu open on a prompt, listing the results of two context steps
The expanded editor showing a User prompt that reads two context steps and the request body

Dynamic content reference

Every function, with what it takes and returns.

Available entry handlers

Every name a Discord, Telegram, or GitHub entry provides.

Guard rails

Conditions that decide whether a tool may run.

Context fetching

Steps whose results a prompt can read.