Stepthrough Start free

What is a prompt variable?

Quick answer

A prompt variable is a labeled blank inside a saved prompt, such as [BUSINESS] or [SERVICE], that you replace with real details each time you use it. The wording stays the same, so you get consistent results without rewriting the prompt from scratch.

Last updated

Take the free module →Module 6 of the free AI at Work: Start Here course, about 8 minutes. No account needed.

Updated · By Robert Breen

Why it matters for a small business

A good prompt takes effort to write. If you have to retype the role, the rules and the format every time, you will skip parts and the quality drops. Variables let you save the part that never changes and swap in only the part that does: the customer, the date, the service.

Variables also tell the AI, and you, exactly what information is needed. If a blank is empty, the answer will show a gap. Use capital letters and square brackets so blanks are easy to spot, and never leave one unfilled when you send, because the AI may treat the bracket text as a real name.

In a real lesson: Prompt Writing 101: Role, Context, Task, Format

In Prompt Writing 101, the last step saves your four-part prompt in a Google Doc called Prompt Templates, under the heading "Customer announcement email." The saved version leaves three blanks: [BUSINESS], [SERVICE] and [DETAILS].

It reads: Role: You are the owner of [BUSINESS]. then Context: We're launching [SERVICE] for our existing customers. Details: [DETAILS]. then the task and format lines. Next time, you replace the three blanks with a different business, service and details, and the same Task and Format do the rest.

The interview prompt lesson ends the same way, with the blanks [WHAT YOU NEED] and [MY BUSINESS].

ChatGPT answering a vague "write an email to my customers" prompt with placeholder text and emoji
ChatGPT answering a vague "write an email to my customers" prompt with placeholder text and emoji

Try this lesson free or read the step-by-step guide.

Common confusions

Prompt variable vs prompt template

The prompt template is the whole saved prompt. The variables are the blanks inside it.

Prompt variable vs n8n expression

In n8n, an expression fills in values automatically from earlier steps. In a chat, you type the values yourself.

Tips

  • Use clear names like [CUSTOMER NAME], not [X].
  • Keep the number of blanks small, three to six.
  • Write what goes in each blank next to the saved template, so a coworker can use it too.

More Prompting terms

Where you use it: free lessons

Frequently asked questions

What is a variable in a prompt?
A labeled blank you replace with real details, such as [BUSINESS], so the rest of the prompt can be reused unchanged.
How do I write a prompt with variables?
Write a prompt that works once, then replace the details that change with capitalized names in square brackets, and save it as a template.
Do I need to remove the brackets?
Yes. Replace the whole bracket, including the brackets, so the AI does not see the placeholder as text.

All AI glossary terms, A to Z · Free prompt templates