Memuat
Memuat
Want to go deeper?
Join one of our courses or ask us directly on WhatsApp.
Picked from the software, topic, and level of “Agentic AI Without Coding Class #7: Reusable Prompt Templates with Variables”.
Other ways we can help with Agentic AI.
Learn with a mentor
Scheduled AI & Machine Learning courses with live guidance and a certificate.

MATLAB Agentic AI Course: Building Autonomous AI Agents with MATLAB & Simulink

Midjourney Course: Create Stunning AI Images from Text
★ 4.9

DALL-E Course: Creating Professional AI Images from Text
★ 4.9
Have it built for you
No time to learn Agentic AI? Our team can do the project for you.

MATLAB & Simulink Development — Agentic AI for Simulation Automation and Data Analysis

AI Image Creation with Stable Diffusion — Unlimited Custom Visual Production
★ 4.9

AI Image & Video Creation with Leonardo AI — All-in-One Visuals for Business
★ 4.9
Get notified about new Agentic AI classes
At most one email a week. Unfollow anytime with one click.
The full narration of this video. The current sentence is highlighted while the video plays; click any sentence to jump there.
Hi, and welcome back. In the previous episode we took apart the anatomy of a prompt: role, context, task, format, and examples. The results were great, but writing a prompt that complete every day is tiring. In this episode we turn your best prompt into a template with variables. You write it once, store it in Google Docs or your notes, then reuse it by changing just a few fields.
Think of a registration form. Its sentences and layout are always the same; only the name, date, and address fields change. A prompt template works in exactly the same way. The fixed parts are written once and tested until the results are good. The changing parts get a special marker called a variable. Every time you use it, you only change the variables. As a result, the quality of the prompt no longer depends on who writes it or how tired they are that day. Your best prompt is frozen into a template, and everyone uses the same version. Let's practice with a task Dimas, the Sunset Coffee admin, does almost every week: writing a promo broadcast message on WhatsApp. The role is always the same: a friendly Sunset Coffee WhatsApp admin. Most of the context stays the same too: opening hours, delivery fee, and the brand's writing style. The only thing that changes is who receives the message, such as regular customers or past hamper buyers. The task has the same frame every time: write a promo broadcast message. What changes is the promo name, product, price, and period. And the format and limits never change: five lines at most, one emoji, and no extra conditions. It turns out most of the prompt stays fixed. Only five fields change. How big is the benefit? Take the weekly promo broadcast as an illustration. Without a template, Dimas writes the prompt from scratch, then revises the result several times. That can take about twenty minutes. With a template, Dimas just copies it, swaps five variables, then checks the result. Only about three minutes. And the benefit you feel most is consistency. The shop's message style stays the same, whichever admin is on duty. These numbers are an illustration, so try working it out yourself for the repetitive tasks in your Session 1 list. There are four steps to building a template. First, take your best prompt, one whose results have proven good. Don't make a template from a prompt you've never tested. Second, read the prompt and mark every part that will change each time you use it: product names, prices, customer names, dates, and so on. Third, replace each marked part with a variable name inside double curly braces. We'll see an example in a moment. Fourth, save the template with a clear name in one shared document. Remember the principle: a good template comes from a prompt that's already been tested, not one written from scratch.
Here's the finished promo broadcast template. The role block stays fixed: the Sunset Coffee WhatsApp admin, friendly, brief, and never pushy. In the context block, the first variable appears: customer segment, written inside double curly braces and highlighted in yellow. Opening hours and the delivery fee don't need variables because they're always the same. The task block has four variables: promo name, product, promo price, and period. The words around them stay fixed, so the message always has the same structure. The format block has no variables at all: five lines at most, open with a greeting, one emoji, and end with how to order. And the limits block makes sure the AI doesn't add conditions, gifts, or discounts you didn't mention. This matters, because a broadcast message is read by hundreds of customers at once. Count the variables: just five, which are customer segment, promo name, product, promo price, and period. Everything else, about eighty percent of the prompt, never changes and has already been tested. Why double curly braces? They're easy to spot, rarely appear in normal writing, and the AI immediately understands that it's a field to fill in. The same notation is also used in n8n and Make, which we learn in Session 6. To make your template easy for others to use, follow four rules for naming variables. First, clear names, lowercase, with underscores instead of spaces. Promo price is much clearer than the letter x. Second, a variable name must be exactly the same everywhere. Don't write product in one block and product name in another, because whoever uses the template may get confused and forget to change one of them. Third, list the variables above the template, with an example value for each. That way Dimas knows that promo price takes a rupiah amount, and period takes a date range. Fourth, only as many as you need. Three to six variables is usually enough. Leave anything that never changes, such as opening hours, written into the template.
A finished template needs to be stored somewhere easy to open. The most practical choice is a single Google Docs document. Step one, create a new document called Sunset Coffee Prompt Library. Step two, make each template's name a heading. Google Docs shows these headings in the document outline, so you can jump to any template with a single click. Step three, under each heading, write when the template is used and its list of variables. Look at the document on screen: the promo broadcast is used for every promo, and the order confirmation is used for every new order. Step four, paste the full template underneath. The variables stay inside double curly braces; don't fill them in yet. Step five, write a version number. When a template is improved, version one becomes version two. That way everyone knows which one is the latest. Google Docs isn't the only option. Its strengths are that it's tidy, has a document outline, and is easy to share with your team. It makes a good main home for your prompt library. If you mostly work from your phone, a notes app like Google Keep or Apple Notes works well too. It's quick to open while you're serving customers at the shop. If you already have dozens of templates, Google Sheets works well as an index: one row per template, with its category and variables. We build an index like this in Episode 10. And there's a more advanced option: storing standing instructions directly in the AI app, through Custom GPTs in ChatGPT, Projects in Claude, or Gems in Gemini. We cover this fully in Session 3. Whichever you choose, only one thing really matters: all your templates live in one place, not scattered across chat histories that are hard to search later. Templates also need to be shared with the team. On screen, Laras messages Dimas that the broadcast template is now in the Prompt Library document. Laras shares the document link. In Google Docs, you can set access for each person: view only, can comment, or can edit. Dimas asks whether changing the variables is all that's needed. Exactly, that's what templates are for. Laras adds an important rule: don't change the other parts. Suggested changes go in as comments on the document, and Laras updates the official version. This simple rule prevents a classic problem: every admin ends up with their own version of the template, and the shop's message style turns messy again.
Now let's use the template. Before copying it, prepare the variable values. Some people write them in a note, others use a small form like this. The first value, customer segment, is written at the top: regular customers. The next value, promo name: Sunset Payday. Then the product: a one-liter palm sugar iced coffee. Then the promo price: seventy-five thousand rupiah, down from the normal price of eighty-five thousand. And finally the period: the twenty-fifth to the twenty-eighth of this month. All five values are complete, so nothing gets missed when copying. Interestingly, in Session 6 a form like this can trigger a workflow in n8n or Make, which fills in the variables and runs the AI automatically. For now, we'll copy them by hand. This is the first way to use a template. Dimas copies the template, replaces each variable with its value, reads it again, then pastes it into ChatGPT. The result is neat: a greeting, the promo name, the promo price with the normal price, the period, and how to order. Four lines, one emoji, and no made-up extra conditions. The following week there's another promo. This time Dimas uses the second way: pasting the template as it is, then writing the variable values underneath. The AI fills in each variable itself. Look at the result. The promo is completely different, but the structure is exactly the same as the previous message: greeting, promo details, period, then how to order. That's the consistency we're after. The first way is safer because you see the final prompt before sending it. The second way is faster. Either way, you must still check the numbers in the final result before the broadcast goes out to customers. Now let's look at the most common mistake when using templates. Dimas is in a hurry and forgets to replace the period variable. Notice that the period marker in curly braces is still in the prompt. The AI doesn't object. Instead, it makes up its own period: valid until the end of this month. But Laras may only want a three-day promo. If this message goes out, the shop could lose money. Luckily, Dimas reads the result and asks. The AI admits that it guessed. There are two lessons here. First, always reread the prompt before sending it, and make sure no curly braces are left. Second, add a rule to the limits block: if any variable is empty, don't guess. That's the rule we use in the next template.
Let's build a second template for an even more frequent task: order confirmation. The role block: a polite, careful Sunset Coffee admin. The task block: write a WhatsApp order confirmation for the customer name. The customer name is a variable. The data block has five variables: order list, subtotal, delivery fee, total, and delivery time. We provide all the numbers ourselves; the AI doesn't calculate them. The format block: six lines at most, with a greeting, order details, delivery fee, total, delivery time, and an invitation to reply OK if everything is correct. And the most important block, limits: don't change any numbers. If any data is empty, write the word CHECK in square brackets, and don't guess. This CHECK rule is very useful. If Dimas forgets to fill in the delivery time, the AI won't make up a time. It writes the CHECK marker instead, which stands out right away before the message is sent. Here's how it's used. Rina orders two bottles of one-liter palm sugar iced coffee, delivered in the afternoon. Dimas fills in the variables from the order notes: two bottles for one hundred seventy thousand, a ten thousand delivery fee, a total of one hundred eighty thousand rupiah, delivered at four in the afternoon. Dimas checks the AI's result, then sends it to Rina. Rina replies OK right away. A clear confirmation like this reduces wrong deliveries and repeated questions. Notice the notes on the left. Only the first name and the order details go to the AI, with no phone number or address. And the numbers are always checked by a human before the message is sent. Finally, a little glimpse of the future. The templates you make today won't go to waste when we move into automation. Imagine the promo form from earlier becoming the trigger for a workflow. The next step is an AI step that holds our broadcast template. Look at the panel on the right: the variables are now filled in automatically from the form. The text highlighted in yellow means it takes the values of the promo name, product, price, and period fields. The result is sent as a draft to Laras for approval, not straight to customers. We build a workflow like this ourselves in Session 6, and you're writing its template now.
Templates aren't just for shops. Dewi at Maju Bersama Co. can create a follow-up email template, with variables for the client name, topic, and deadline. Mr. Hendra at Cerdas Tutoring can create a practice question template, with variables for the number of questions, topic, and grade. One template, hundreds of question sets. And Nadia, a freelance social media manager, can create a monthly report template for every small business client on Nadia's list. Take another look at your list of five tasks from Session 1. There's almost certainly one that would work as a template. To sum up, here are the golden rules for prompt templates. First, clear variable names, lowercase, with underscores. Second, a variable's name is exactly the same everywhere it appears. Third, the list of variables with example values is written above the template. Fourth, the fixed part has been tested at least three times with different values. Fifth, there's always a rule for empty data: write the CHECK marker, don't guess. Sixth, one template owner. Other team members suggest changes through comments. Seventh, the version number is recorded with every change. And eighth, if the results start drifting, fix the fixed part, not the variable values. The problem is usually an unclear format or limit. Now for your homework. First, take your best prompt from the Episode 6 exercise and turn it into a template. Second, mark at least three changing parts as variables with double curly braces. Third, create a Prompt Library document and save at least two templates in it. You can copy the two templates from this episode and adapt them to your business. Fourth, test each template with three different sets of values. If the results are consistent, your template is ready for the team to use. Also save the best test result under each template. That result can become the examples block in the next version, as we learned in Episode 6.
Let's recap. A template is a prompt you just fill in. The fixed parts are written once and tested, the changing parts are marked as variables, and everything is stored in one Prompt Library that's shared with the team. In the next episode we learn to ask for tidy output: tables you can paste straight into Google Sheets, checklists you can tick off, and other structured formats. See you in Episode 8.
Try these on your own after watching to lock in what you learned.
Type a question or keyword; we find the part of this episode that explains it and jump the video there.
Notes are saved with the current video time and are only visible to you.
Stuck on a step? Ask here; the instructor and other learners can answer.
No questions yet.

Cerdas Inovasi Digital Team
Software developers, BIM & 3D engineers, and AI practitioners
We build software, BIM models, games and AI automations for clients every day, and turn that hands-on work into step-by-step classes: every step is shown on screen and comes with a PDF guide you can keep.
See our clients →