Adding context to a generative procedure for an AI agent

<body>
<p id="docs-hc-snippet" style="display: none;">Ingenerative procedures, you can add context that gives your AI agent guidance on how to execute the procedure.</p>
<div class="article-banners">
<div id="docs-wmp-link">
<a href="https://support.zendesk.com/hc/en-us/articles/5411234991258-plan" rel="noopener" target="_blank">What's my plan?</a>
</div>

<div class="article-banner" id="suite_all">
<table>
<tbody>
<tr>
<td>
<strong>All Suites</strong>
</td>
<td>Team, Growth, Professional, Enterprise, or Enterprise Plus</td>
</tr>
</tbody>
</table>
</div>

<div class="article-banner" id="support_all">
<table>
<tbody>
<tr>
<td>
<strong>Support</strong>
</td>
<td>Team, Professional, or Enterprise</td>
</tr>
</tbody>
</table>
</div>

</div>

<div class="body">

<div class="p" dir="ltr">
<div class="note attention" id="adv_procedures_context__note_tfw_sqk_mjc">
<span class="attentiontitle"></span> This article applies only to messaging AI
agents.</div>
</div>
<p class="p" dir="ltr">In <a class="xref" href="https://support.zendesk.com/hc/en-us/articles/10473649691418" target="_blank">generative procedures</a>, you can add context
that gives your AI agent guidance on how to execute the procedure.</p>
<p class="p" dir="ltr">This article contains the following topics:</p>
<ul class="ul" id="adv_procedures_context__ul_uzn_xqk_mjc">
<li class="li"><a class="xref" href="#topic_tnx_krk_mjc">About context in generative procedures</a></li>
<li class="li"><a class="xref" href="#topic_cpn_nrk_mjc">Adding context to a generative procedure</a></li>
<li class="li"><a class="xref" href="#topic_us5_4rk_mjc">Common reasons to add context to generative procedures</a></li>
<li class="li"><a class="xref" href="#topic_lcs_prk_mjc">Best practices for adding context to generative procedures</a></li>
</ul>
<p class="p" dir="ltr">Related articles:</p>
<ul class="ul" id="adv_procedures_context__ul_bmp_rqk_mjc">
<li class="li" dir="ltr"><a class="xref" href="https://support.zendesk.com/hc/en-us/articles/8979864563610" target="_blank">Creating generative procedures to shape flexible
conversation flows for AI agents</a></li>
<li class="li" dir="ltr"><a class="xref" href="https://support.zendesk.com/hc/en-us/articles/10040865503898" target="_blank">Managing generative procedures for AI
agents</a></li>
</ul>
</div>
<div aria-labelledby="ariaid-title2" class="topic nested1" id="topic_tnx_krk_mjc">
<h2 class="title topictitle2" id="ariaid-title2">About context in generative procedures</h2>
<div class="body">
<p class="p" dir="ltr">Additional context lets you provide supplementary guidance to a messaging
AI agent about how to execute specific parts of a generative procedure. You write
this context as instructions or notes in natural language, and the system transforms
them into information the AI uses to make better decisions.</p>
<p class="p" dir="ltr">For example, you might write:</p>
<ul class="ul" id="topic_tnx_krk_mjc__ul_dmp_rqk_mjc">
<li class="li" dir="ltr">"Use the customer's VIP status when deciding how to respond."</li>
<li class="li" dir="ltr">"Don't escalate even if the customer asks."</li>
<li class="li" dir="ltr">"Search for orders from the past 30 days only."</li>
<li class="li" dir="ltr">"Use a friendly tone when delivering this message."</li>
</ul>
<p class="p" dir="ltr">You can add context to a procedure at three levels, from broadest to most
specific. Context follows a hierarchical model, meaning broader context
automatically applies to more specific levels.</p>
<div class="tablenoborder">
<table border="1" cellpadding="4" cellspacing="0" class="table" frame="border" id="topic_tnx_krk_mjc__table_emp_rqk_mjc" rules="all" summary="">
<colgroup>
<col>
<col>
<col>
</colgroup>
<tbody class="tbody">
<tr class="row">
<td class="entry nocellnorowborder" dir="ltr" style="vertical-align:top;"><strong class="ph b">Level</strong></td>
<td class="entry nocellnorowborder" dir="ltr" style="vertical-align:top;"><strong class="ph b">Applies to</strong></td>
<td class="entry cell-norowborder" dir="ltr" style="vertical-align:top;"><strong class="ph b">Example</strong></td>
</tr>
<tr class="row">
<td class="entry nocellnorowborder" dir="ltr" style="vertical-align:top;">Procedure</td>
<td class="entry nocellnorowborder" dir="ltr" style="vertical-align:top;">Everything in the procedure</td>
<td class="entry cell-norowborder" dir="ltr" style="vertical-align:top;">“Refund policy is 30 days for unopened items, or store
credit for opened items within 14 days. No refunds on clearance. If
the customer asks an off-topic question, politely redirect them to
the refund issue.”</td>
</tr>
<tr class="row">
<td class="entry nocellnorowborder" dir="ltr" style="vertical-align:top;">Step</td>
<td class="entry nocellnorowborder" dir="ltr" style="vertical-align:top;">That step and all blocks within it</td>
<td class="entry cell-norowborder" dir="ltr" style="vertical-align:top;">“Use 'purchase_date' and 'order_status' session
variables. Calculate if purchase is within 30 days.”</td>
</tr>
<tr class="row">
<td class="entry row-nocellborder" dir="ltr" style="vertical-align:top;">Block</td>
<td class="entry row-nocellborder" dir="ltr" style="vertical-align:top;">Only that specific block</td>
<td class="entry cellrowborder" dir="ltr" style="vertical-align:top;">“Include refund amount, processing time (5-7 business
days), and method (original payment method). Use a friendly,
reassuring tone.”</td>
</tr>
</tbody>
</table>
</div>
<p class="p" dir="ltr">Block-level context is available only for the following block types: </p>
<ul class="ul" id="topic_tnx_krk_mjc__ul_fmp_rqk_mjc">
<li class="li" dir="ltr">
<strong class="ph b">Generate answer</strong>: Use context to reference session parameters,
provide knowledge context, and guide tone.</li>
<li class="li" dir="ltr">
<strong class="ph b">Ask question</strong>: Use context to provide validation rules and
clarification guidance. <em class="ph i">Ask question</em> blocks cannot directly access
session variables. Instead, use session variables in <em class="ph i">Generate answer</em> or
<em class="ph i">Check condition</em> blocks.</li>
<li class="li" dir="ltr">
<strong class="ph b">Check condition</strong>: Use context to guide how conditions are
interpreted. This applies only to the condition evaluation, not blocks inside
the resulting paths. Blocks inside condition paths receive procedure-level and
step-level context, but not the <em class="ph i">Check condition</em> block's own context.</li>
</ul>
<div class="p" dir="ltr">
<div class="note" id="topic_tnx_krk_mjc__note_ewg_zrk_mjc">
<span class="notetitle">Note:</span> <em class="ph i">Search for knowledge</em> blocks support additional
context for guiding search queries, called search instructions. This works
independently of context added to any level of a generative procedure.</div>
</div>
<p class="p" dir="ltr">The system may also automatically add context based on the content supplied
by an admin or agent when creating or editing the procedure. You can edit or remove
this generated context as needed.</p>
<p class="p" dir="ltr">Keep in mind that context added to a generative procedure cannot:</p>
<ul class="ul" id="topic_tnx_krk_mjc__ul_gmp_rqk_mjc">
<li class="li" dir="ltr">Create, remove, or reorder steps and blocks. To do that, <a class="xref" href="https://support.zendesk.com/hc/en-us/articles/10040865503898#topic_qcm_tcc_tgc" target="_blank">edit the procedure</a>.</li>
<li class="li" dir="ltr">Guarantee exact AI behavior. It merely provides guidance that the AI
interprets.</li>
<li class="li" dir="ltr">Control navigation or flow decisions. Instead, use <em class="ph i">Check
condition</em> blocks.</li>
</ul>
</div>
</div>
<div aria-labelledby="ariaid-title3" class="topic nested1" id="topic_cpn_nrk_mjc">
<h2 class="title topictitle2" id="ariaid-title3">Adding context to a generative procedure</h2>
<div class="body">
<p class="p" dir="ltr">You can add or edit context in a generative procedure at any time. Note
that there might already be text in the context fields added by the system.</p>
<p class="p" dir="ltr"><strong class="ph b">To add context to a procedure</strong></p>
<ol class="ol" id="topic_cpn_nrk_mjc__ol_fcv_nrk_mjc">
<li class="li" dir="ltr">Open a generative procedure.</li>
<li class="li">Select a location to add context.<p class="p">Your options are:</p>
<ul class="ul" id="topic_cpn_nrk_mjc__ul_qrs_btk_mjc">
<li class="li">
<strong class="ph b">Procedure</strong>: Select the <strong class="ph b">Start</strong> block and add context in
<strong class="ph b">Procedure context</strong>.<p class="p"><img class="image" id="topic_cpn_nrk_mjc__image_jhw_svk_mjc" src="https://zen-marketing-documentation.s3.amazonaws.com/docs/en/aia_procedure_context_whole.png" width="300"></p>
</li>
<li class="li">
<strong class="ph b">Step</strong>: Select the shaded area around a subset of blocks and add
context in <strong class="ph b">Additional information</strong>.<p class="p">You can also update the
<strong class="ph b">Title</strong> of the step. This information does not appear to
customers, but is helpful for admins or agents maintaining the
procedure.</p>
<p class="p"><img class="image" id="topic_cpn_nrk_mjc__image_gd1_5vk_mjc" src="https://zen-marketing-documentation.s3.amazonaws.com/docs/en/aia_procedure_context_step.png" width="300"></p>
</li>
<li class="li">
<strong class="ph b">Block</strong>: Select a specific block and add context in <strong class="ph b">Additional
information</strong>.<p class="p"><img class="image" id="topic_cpn_nrk_mjc__image_wfq_5vk_mjc" src="https://zen-marketing-documentation.s3.amazonaws.com/docs/en/aia_procedure_context_block.png" width="300"></p>
</li>
</ul>
</li>
<li class="li">Click <strong class="ph b">Save version</strong>.</li>
<li class="li">If you want to make your edits live to customers, click <strong class="ph b">Publish
procedure</strong>.<p class="p">If you want to discard your edits, <a class="xref" href="https://support.zendesk.com/hc/en-us/articles/10040865503898-Managing-generative-procedures-for-AI-agents#topic_b2h_5cc_tgc" target="_blank">restore a previous version of the
procedure</a>.</p>
</li>
</ol>
</div>
</div>
<div aria-labelledby="ariaid-title4" class="topic nested1" id="topic_us5_4rk_mjc">
<h2 class="title topictitle2" id="ariaid-title4">Common reasons to add context to generative procedures</h2>
<div class="body">
<p class="p">The following are common reasons to add context to a generative procedure:</p>
<ul class="ul" id="topic_us5_4rk_mjc__ul_bjx_35k_mjc">
<li class="li"><a class="xref" href="#topic_sc2_ytk_mjc">Reference session variables</a></li>
<li class="li"><a class="xref" href="#topic_yjb_c5k_mjc">Provide policy context</a></li>
<li class="li"><a class="xref" href="#topic_x4m_d5k_mjc">Add validation rules</a></li>
<li class="li"><a class="xref" href="#topic_kxq_25k_mjc">Handle edge cases</a></li>
<li class="li"><a class="xref" href="#topic_whv_f5k_mjc">Control tone</a></li>
<li class="li"><a class="xref" href="#topic_j1d_h5k_mjc">Guide search queries</a></li>
<li class="li"><a class="xref" href="#topic_oh2_35k_mjc">Help with conditions</a></li>
</ul>
</div>
<div aria-labelledby="ariaid-title5" class="topic nested2" id="topic_sc2_ytk_mjc">
<h3 class="title topictitle3" id="ariaid-title5">Reference session variables</h3>
<div class="body">
<ul class="ul" id="topic_sc2_ytk_mjc__ul_mnw_k5k_mjc">
<li class="li">
<strong class="ph b">Level</strong>: Block (Generate answer) </li>
<li class="li">
<strong class="ph b">Objective</strong>: Tell the AI agent which session variables to use and how. </li>
<li class="li">
<strong class="ph b">Example</strong>: "The 'order_total' session variable contains the order
value. Use this when explaining the refund amount." </li>
</ul>
</div>
</div>
<div aria-labelledby="ariaid-title6" class="topic nested2" id="topic_yjb_c5k_mjc">
<h3 class="title topictitle3" id="ariaid-title6">Provide policy context</h3>
<div class="body">
<ul class="ul" id="topic_yjb_c5k_mjc__ul_ad1_l5k_mjc">
<li class="li">
<strong class="ph b">Level</strong>: Block (Any supported block type) </li>
<li class="li">
<strong class="ph b">Objective</strong>: Give background information that helps the AI agent answer
questions or make decisions. </li>
<li class="li">
<strong class="ph b">Example</strong>: "Standard shipping: 5-7 days. Express: 2-3 days.
International: up to 14 days." </li>
</ul>
</div>
</div>
<div aria-labelledby="ariaid-title7" class="topic nested2" id="topic_x4m_d5k_mjc">
<h3 class="title topictitle3" id="ariaid-title7">Add validation rules</h3>
<div class="body">
<ul class="ul" id="topic_x4m_d5k_mjc__ul_wbj_l5k_mjc">
<li class="li">
<strong class="ph b">Level</strong>: Block (Ask question) </li>
<li class="li">
<strong class="ph b">Objective</strong>: Specify what constitutes a valid answer when asking
questions. </li>
<li class="li">
<strong class="ph b">Example</strong>: "Order numbers are 8 digits starting with 'ORD'. If invalid,
ask the customer to check their confirmation email." </li>
</ul>
</div>
</div>
<div aria-labelledby="ariaid-title8" class="topic nested2" id="topic_kxq_25k_mjc">
<h3 class="title topictitle3" id="ariaid-title8">Handle edge cases</h3>
<div class="body">
<ul class="ul" id="topic_kxq_25k_mjc__ul_h4m_l5k_mjc">
<li class="li">
<strong class="ph b">Level</strong>: Procedure or step </li>
<li class="li">
<strong class="ph b">Objective</strong>: Guide the AI agent on unexpected responses or objections. </li>
<li class="li">
<strong class="ph b">Example</strong>: "If the customer asks to speak to a human, politely explain
you can help resolve most issues quickly. Escalate only if they insist
twice." </li>
</ul>
</div>
</div>
<div aria-labelledby="ariaid-title9" class="topic nested2" id="topic_whv_f5k_mjc">
<h3 class="title topictitle3" id="ariaid-title9">Control tone</h3>
<div class="body">
<ul class="ul" id="topic_whv_f5k_mjc__ul_vhs_l5k_mjc">
<li class="li">
<strong class="ph b">Level</strong>: Block (Generate answer) </li>
<li class="li">
<strong class="ph b">Objective</strong>: Tell the AI agent how to communicate in specific
situations. </li>
<li class="li">
<strong class="ph b">Example</strong>: "Use an empathetic, apologetic tone. Acknowledge the
inconvenience and offer alternatives." </li>
</ul>
</div>
</div>
<div aria-labelledby="ariaid-title10" class="topic nested2" id="topic_j1d_h5k_mjc">
<h3 class="title topictitle3" id="ariaid-title10">Guide search queries </h3>
<div class="body">
<ul class="ul" id="topic_j1d_h5k_mjc__ul_wrc_m5k_mjc">
<li class="li">
<strong class="ph b">Level</strong>: Block (Search for knowledge) </li>
<li class="li">
<strong class="ph b">Objective</strong>: Tell the AI how to formulate searches. </li>
<li class="li">
<strong class="ph b">Example</strong>: “Always use {{variableName}} in search query.” </li>
</ul>
</div>
</div>
<div aria-labelledby="ariaid-title11" class="topic nested2" id="topic_oh2_35k_mjc">
<h3 class="title topictitle3" id="ariaid-title11">Help with conditions</h3>
<div class="body">
<ul class="ul" id="topic_oh2_35k_mjc__ul_v4x_m5k_mjc">
<li class="li">
<strong class="ph b">Level</strong>: Block (Check condition) </li>
<li class="li">
<strong class="ph b">Objective</strong>: Clarify how to interpret complex conditions. </li>
<li class="li">
<strong class="ph b">Example</strong>: "Consider: purchase date (within 30 days), product condition
(unopened), and account status (good standing)."</li>
</ul>
</div>
</div>
</div>
<div aria-labelledby="ariaid-title12" class="topic nested1" id="topic_lcs_prk_mjc">
<h2 class="title topictitle2" id="ariaid-title12">Best practices for adding context to generative procedures</h2>
<div class="body">
<p class="p">Keep the following best practices in mind as you add context to a generative
procedure: </p>
<ul class="ul" id="topic_lcs_prk_mjc__ul_oz3_45k_mjc">
<li class="li">
<strong class="ph b">Keep an appropriate scope</strong>: Procedure context should apply broadly, while
step or block context should be specific to that step or block's purpose. </li>
<li class="li">
<strong class="ph b">Be specific</strong>: Include specific details about how the AI agent should
respond. For example, “If the customer mentions 'broken', ask for photos and
purchase date.” </li>
<li class="li">
<strong class="ph b">Reference session variables clearly</strong>: Use the actual name of session
variables. For example, “The 'customer_tier' variable contains 'bronze',
'silver', or 'gold'.” </li>
<li class="li">
<strong class="ph b">Be consistent</strong>: Use similar language across context fields. </li>
<li class="li">
<strong class="ph b">Provide information and guidance</strong>: Help the AI agent understand nuances,
but don’t attempt to control the procedure structure using context. </li>
<li class="li">
<strong class="ph b">Start small</strong>: Keep context concise, add context incrementally, and test
after each addition. </li>
<li class="li">
<strong class="ph b">Test and monitor performance</strong>: Always test your procedures thoroughly
after adding context to ensure they behave as expected. Review conversation logs
and refine unclear guidance. </li>
<li class="li">
<strong class="ph b">Document your work</strong>: Keep notes on what context you added and why. </li>
<li class="li">
<strong class="ph b">Don’t include sensitive data</strong>: Never add API keys, passwords, or internal
system details in context.</li>
</ul>
</div>
</div>
<script id="docs-schema-markup" type="application/ld+json">{
"@context": "https://schema.org",
"@type": "TechArticle",
"@id": "https://support.zendesk.com/hc/en-us/articles/10861082840730",
"url": "https://support.zendesk.com/hc/en-us/articles/10861082840730",
"headline": "Adding context to a generative procedure for an AI agent",
"description": "You can add context at the procedure, step, or block level to guide an AI agent's behavior in generative procedures by providing instructions that influence its decision-making and tone.",
"articleSection": "Product help",
"datePublished": "2026-06-03T18:03:11+00:00",
"dateModified": "2026-06-10T17:16:54.439456+00:00",
"inLanguage": "en",
"mainEntityOfPage": {
"@type": "WebPage",
"@id": "https://support.zendesk.com/hc/en-us/articles/10861082840730"
},
"author": {
"@type": "Organization",
"name": "Zendesk",
"@id": "https://www.zendesk.com"
},
"publisher": {
"@type": "Organization",
"name": "Zendesk",
"@id": "https://www.zendesk.com"
},
"isPartOf": {
"@type": "WebSite",
"name": "Zendesk Help",
"@id": "https://support.zendesk.com/hc/"
},
"about": {
"@type": "SoftwareApplication",
"name": "Zendesk",
"@id": "https://www.zendesk.com"
}
}</script>
</body>