<?xml version="1.0" encoding="utf-8"?><feed xmlns="http://www.w3.org/2005/Atom"><title type="text">Blog posts by My Blog</title><link href="http://world.optimizely.com" /><updated>2026-07-23T14:48:00.0000000Z</updated><id>https://world.optimizely.com/blogs/my-blog/</id> <generator uri="http://world.optimizely.com" version="2.0">Optimizely World</generator> <entry><title>From AI Agents to AI Workflow with Opal</title><link href="https://world.optimizely.com/blogs/my-blog/dates/2026/7/from-ai-agents-to-ai-workflow-with-opal/" /><id>&lt;h2 class=&quot;article-editor-heading article-editor-content__has-focus&quot;&gt;Introduction&lt;/h2&gt;
&lt;p class=&quot;article-editor-paragraph&quot;&gt;In the &lt;a class=&quot;article-editor-link article-editor-link&quot; href=&quot;/link/b31bb7d003754244a5a025412aca0edd.aspx&quot;&gt;first article in this series&lt;/a&gt;, we talked about AI agents in Optimizely Opal and walked through the process of creating a specialised agent. In this article we will take the next step and build a workflow agent.&lt;/p&gt;
&lt;p class=&quot;article-editor-paragraph&quot;&gt;As in the first article, we will go through a step&amp;ndash;by&amp;ndash;step process of creating a workflow agent using a practical example of creating a workflow that performs automated initial review of content draft for brand and tone of voice alignment.&lt;/p&gt;
&lt;h2 class=&quot;article-editor-heading&quot;&gt;Standalone agent vs workflow agent&lt;/h2&gt;
&lt;p class=&quot;article-editor-paragraph&quot;&gt;Before we dive into building a workflow agent, let&amp;rsquo;s first look at how it differs from a Standalone Agent. &amp;ldquo;Standalone agent&amp;rdquo; is not an official term used in Optimizely documentation, but in this article, we will use it to refer to either an existing agent from the Optimizely Agent Directory or a specialised agent you build yourself.&lt;/p&gt;
&lt;p class=&quot;article-editor-paragraph&quot;&gt;A standalone agent already uses context (prompt template, variables, attached files, instructions and the conversation it is in). It can already take actions on its own using tools. What it cannot do is start on its own, coordinate other agents, or run the same workflow on a schedule or every time an event happens. That is what a workflow agent adds: it uses triggers, steps sequence, conditions and loops to combine multiple standalone agents into a multi&amp;ndash;step process.&lt;/p&gt;
&lt;p class=&quot;article-editor-paragraph&quot;&gt;Can you just create a specialised agent with a prompt that will make it do the same multi-step process? In theory &amp;ndash; yes, but in practice such a complex agent will be very difficult (if not impossible) and expensive (in terms of Opal credits and time spent) to test, debug and maintain. You can refer to the first article &amp;ndash; it explains this in more detail.&lt;/p&gt;
&lt;p class=&quot;article-editor-paragraph&quot;&gt;An important consideration to keep in mind: workflow agents typically operate with greater autonomy and less human involvement. A standalone agent is usually invoked by a person, who then reviews its output. A workflow agent, by contrast, often starts automatically and runs unattended, with human review taking place only after the workflow is complete. For this reason, workflow agents (and any standalone agents they use as part of the workflow) need stricter guardrails defining what they can do, what outputs they must produce, and how they should handle errors and edge cases.&lt;/p&gt;
&lt;h2 class=&quot;article-editor-heading&quot;&gt;Building Blocks of a Workflow Agent&lt;/h2&gt;
&lt;p class=&quot;article-editor-paragraph&quot;&gt;A workflow agent consists of 3 building blocks: a trigger that decides when it starts, a series of agents that each perform one step, and the logic that determines how those steps are sequenced.&lt;/p&gt;
&lt;p class=&quot;article-editor-paragraph is-empty&quot;&gt;&lt;img style=&quot;display: block; margin-left: auto; margin-right: auto;&quot; src=&quot;https://media.licdn.com/dms/image/v2/D5612AQFAGVo8yhATAQ/article-inline_image-shrink_1000_1488/B56Z.KYG2mH4AI-/0/1784733003415?e=1786579200&amp;amp;v=beta&amp;amp;t=hCqpg6pXSyvFyieIdqE7wDKGi6OHElqbitKq8XYHZsM&quot; /&gt;&lt;/p&gt;
&lt;h3 class=&quot;article-editor-heading&quot;&gt;Trigger&lt;/h3&gt;
&lt;p class=&quot;article-editor-paragraph&quot;&gt;&lt;a class=&quot;article-editor-link article-editor-link&quot; href=&quot;https://support.optimizely.com/hc/en-us/articles/39865892823693-Workflow-agent-triggers&quot;&gt;Trigger&lt;/a&gt; is what starts the workflow agent. It can be one of the following:&lt;/p&gt;
&lt;ul class=&quot;article-editor-bullet-list&quot;&gt;
&lt;li class=&quot;article-editor-list-item&quot;&gt;
&lt;p class=&quot;article-editor-paragraph&quot;&gt;&lt;strong&gt;Chat&lt;/strong&gt; &amp;ndash; agent is called from a chat, just like a standalone agent.&lt;/p&gt;
&lt;/li&gt;
&lt;li class=&quot;article-editor-list-item&quot;&gt;
&lt;p class=&quot;article-editor-paragraph&quot;&gt;&lt;strong&gt;Scheduler&lt;/strong&gt; &amp;ndash; agent is executed on a schedule (every hour, every day at 9AM, etc.).&lt;/p&gt;
&lt;/li&gt;
&lt;li class=&quot;article-editor-list-item&quot;&gt;
&lt;p class=&quot;article-editor-paragraph&quot;&gt;&lt;strong&gt;Webhook&lt;/strong&gt; &amp;ndash; Opal listens for an incoming webhook and starts the workflow when an external. system sends an event.&lt;/p&gt;
&lt;/li&gt;
&lt;li class=&quot;article-editor-list-item&quot;&gt;
&lt;p class=&quot;article-editor-paragraph&quot;&gt;&lt;strong&gt;Email&lt;/strong&gt; &amp;ndash; agent is called when email is sent to the email address that you set as the Trigger Recipient. You can configure additional conditions for sender and subject to avoid accidental email or spam to result in workflow execution&lt;/p&gt;
&lt;/li&gt;
&lt;/ul&gt;
&lt;h3 class=&quot;article-editor-heading&quot;&gt;Logic&lt;/h3&gt;
&lt;p class=&quot;article-editor-paragraph&quot;&gt;Workflow agent logic is defined using conditions and loops.&lt;/p&gt;
&lt;p class=&quot;article-editor-paragraph&quot;&gt;&lt;a class=&quot;article-editor-link article-editor-link&quot; href=&quot;https://support.optimizely.com/hc/en-us/articles/43620929090829-Workflow-agent-conditions#h_01KHS15TF8A8X5ZW0N9HKT1GYE&quot;&gt;Conditions&lt;/a&gt; allow the workflow to follow different paths based on defined criteria. This is your typical &amp;ldquo;if-then-else&amp;rdquo; condition that can have multiple &amp;ldquo;then&amp;rdquo; parts. Below is an example of having different processing steps for blog article, email or social post.&lt;/p&gt;
&lt;p class=&quot;article-editor-paragraph&quot;&gt;&lt;img style=&quot;display: block; margin-left: auto; margin-right: auto;&quot; src=&quot;/link/cb0c40f167984ffd99605a2f8abe0263.aspx&quot; /&gt;&lt;/p&gt;
&lt;p class=&quot;article-editor-paragraph&quot;&gt;&amp;nbsp;&lt;/p&gt;
&lt;p class=&quot;article-editor-paragraph&quot;&gt;Consider the following best practices when using conditions in workflow:&lt;/p&gt;
&lt;ul class=&quot;article-editor-bullet-list&quot;&gt;
&lt;li class=&quot;article-editor-list-item&quot;&gt;
&lt;p class=&quot;article-editor-paragraph&quot;&gt;&lt;strong&gt;Use clear criteria and structured data&lt;/strong&gt; &amp;ndash; base conditions on specific, predictable values. Prefer numeric or pre-defined values such as High, Medium or Low over free-form text.&lt;/p&gt;
&lt;/li&gt;
&lt;li class=&quot;article-editor-list-item&quot;&gt;
&lt;p class=&quot;article-editor-paragraph&quot;&gt;&lt;strong&gt;Keep conditions simple&lt;/strong&gt; &amp;ndash; split complex logic into smaller decisions.&lt;/p&gt;
&lt;/li&gt;
&lt;li class=&quot;article-editor-list-item&quot;&gt;
&lt;p class=&quot;article-editor-paragraph&quot;&gt;&lt;strong&gt;Avoid overlapping or duplicate rules &lt;/strong&gt;&amp;ndash; make it clear which path takes priority.&lt;/p&gt;
&lt;/li&gt;
&lt;li class=&quot;article-editor-list-item&quot;&gt;
&lt;p class=&quot;article-editor-paragraph&quot;&gt;&lt;strong&gt;Cover every outcome &lt;/strong&gt;&amp;ndash; include both matching and fallback paths.&lt;/p&gt;
&lt;/li&gt;
&lt;li class=&quot;article-editor-list-item&quot;&gt;
&lt;p class=&quot;article-editor-paragraph&quot;&gt;&lt;strong&gt;Test edge cases &lt;/strong&gt;&amp;ndash; check missing, unexpected and boundary values.&lt;/p&gt;
&lt;/li&gt;
&lt;li class=&quot;article-editor-list-item&quot;&gt;
&lt;p class=&quot;article-editor-paragraph&quot;&gt;&lt;strong&gt;Add a safe fallback &lt;/strong&gt;&amp;ndash; route uncertain cases for human review or end the workflow safely.&lt;/p&gt;
&lt;/li&gt;
&lt;/ul&gt;
&lt;p class=&quot;article-editor-paragraph&quot;&gt;&lt;a class=&quot;article-editor-link article-editor-link&quot; href=&quot;https://support.optimizely.com/hc/en-us/articles/43590976293389-Workflow-agent-loops&quot;&gt;Loop&lt;/a&gt; is handy when you need to perform same step (or set of steps) over multiple items. Below is an example of using loop to do AEO/GEO analysis and provide summary and improvement recommendations for all child pages of a specified page.&lt;/p&gt;
&lt;p class=&quot;article-editor-paragraph&quot;&gt;&lt;img style=&quot;display: block; margin-left: auto; margin-right: auto;&quot; src=&quot;https://media.licdn.com/dms/image/v2/D5612AQGrafRs4viSMQ/article-inline_image-shrink_1000_1488/B56Z.KYwDcJoAM-/0/1784733172179?e=1786579200&amp;amp;v=beta&amp;amp;t=dt_NwalvU39iQTgUKbkqBTq0zdJH-pOxJKSNXjyCjks&quot; /&gt;&lt;/p&gt;
&lt;p class=&quot;article-editor-paragraph&quot;&gt;Some best practices when using loops:&lt;/p&gt;
&lt;ul class=&quot;article-editor-bullet-list&quot;&gt;
&lt;li class=&quot;article-editor-list-item&quot;&gt;
&lt;p class=&quot;article-editor-paragraph&quot;&gt;&lt;strong&gt;Keep the loop focused&lt;/strong&gt; &amp;ndash; include only the steps required for each item inside the loop, all other steps should be outside of the loop.&lt;/p&gt;
&lt;/li&gt;
&lt;li class=&quot;article-editor-list-item&quot;&gt;
&lt;p class=&quot;article-editor-paragraph&quot;&gt;&lt;strong&gt;Handle individual failures&lt;/strong&gt; &amp;ndash; define what should happen when one or more items in the loop cannot be processed.&lt;/p&gt;
&lt;/li&gt;
&lt;li class=&quot;article-editor-list-item&quot;&gt;
&lt;p class=&quot;article-editor-paragraph&quot;&gt;&lt;strong&gt;Test with different list sizes&lt;/strong&gt; &amp;ndash; plan/check for empty lists, single-item lists and larger collections.&lt;/p&gt;
&lt;/li&gt;
&lt;li class=&quot;article-editor-list-item&quot;&gt;
&lt;p class=&quot;article-editor-paragraph&quot;&gt;&lt;strong&gt;Limit the number of iterations&lt;/strong&gt; &amp;ndash; large lists can increase workflow execution time and credits consumption.&lt;/p&gt;
&lt;/li&gt;
&lt;li class=&quot;article-editor-list-item&quot;&gt;
&lt;p class=&quot;article-editor-paragraph&quot;&gt;&lt;strong&gt;Avoid excessive nesting&lt;/strong&gt; &amp;ndash; Optimizely supports up to three nested loops, but simpler workflows are easier to maintain so avoid nested loops unless it&amp;rsquo;s really necessary.&lt;/p&gt;
&lt;/li&gt;
&lt;/ul&gt;
&lt;h3 class=&quot;article-editor-heading&quot;&gt;Agents&lt;/h3&gt;
&lt;p class=&quot;article-editor-paragraph&quot;&gt;Each step in the workflow is executed by an agent &amp;ndash; it can be out-of-the-box agent from Optimizely Agent Directory or a specialised agent you or someone else from your team created.&lt;/p&gt;
&lt;h2 class=&quot;article-editor-heading&quot;&gt;Creating Workflow Agent&lt;/h2&gt;
&lt;p class=&quot;article-editor-paragraph&quot;&gt;Let&amp;rsquo;s now create a workflow agent that performs an automated initial review of a content draft for brand and tone-of-voice alignment.&lt;/p&gt;
&lt;p class=&quot;article-editor-paragraph&quot;&gt;In this example we will use combination of Optimizely CMP + Opal. There is a reason this is a very powerful combination &amp;ndash; CMP provides the structure, governance and visibility to the process, while Opal adds the creativity, reasoning and judgement needed to accelerate complex tasks that cannot be done by conventional tools, such as creating content briefs and drafts, reviewing and proofreading content.&lt;/p&gt;
&lt;p class=&quot;article-editor-paragraph&quot;&gt;Here is the scenario we will build. A content team is working on content production. Every content production task follows a set of steps, and one of these steps is &lt;strong&gt;Brand review&lt;/strong&gt;. Today, a copywriter picks up this step, opens the content, opens the brand guidelines, and checks one against the other. It is necessary work, but most of it is mechanical.&lt;/p&gt;
&lt;p class=&quot;article-editor-paragraph&quot;&gt;With the workflow we will build, when a task reaches the Brand review step, Opal picks it up automatically. It reads the content, fetches the latest brand and tone of voice guidelines, reviews the content against them, and leaves a comment on the task listing any issues it found and suggesting improvements. The task is then assigned to the copywriter, who now starts from a prepared initial review instead of a blank page.&lt;/p&gt;
&lt;p class=&quot;article-editor-paragraph&quot;&gt;Looks simple but even such a simple workflow can save lots of time for a team that has to produce lots of content and is short on resources. Or imagine a situation where a new version of brand guidelines is released and someone needs to re-check 20 most recent articles against updated guidelines. How long would that take if done manually from scratch? As a copywriter, is this a kind of task you&amp;rsquo;d be excited to work on? As a team manager, is this where you&amp;rsquo;d want to spend your copywriters&amp;rsquo; time?&lt;/p&gt;
&lt;h3 class=&quot;article-editor-heading&quot;&gt;Planning the Workflow&lt;/h3&gt;
&lt;p class=&quot;article-editor-paragraph&quot;&gt;Before jumping into building the agent, it&amp;rsquo;s first important to understand and plan what exactly you want to the workflow to do, how do you want it to do it.&lt;/p&gt;
&lt;p class=&quot;article-editor-paragraph&quot;&gt;A simple way to do this is to write down workflow steps or (if you&amp;rsquo;re a visual person) draw it as a sequence diagram. Then look at the workflow and ask yourself these questions:&lt;/p&gt;
&lt;ul class=&quot;article-editor-bullet-list&quot;&gt;
&lt;li class=&quot;article-editor-list-item&quot;&gt;
&lt;p class=&quot;article-editor-paragraph&quot;&gt;Is it only covering the happy path, what could go unexpectedly and how should we handle it.&lt;/p&gt;
&lt;/li&gt;
&lt;li class=&quot;article-editor-list-item&quot;&gt;
&lt;p class=&quot;article-editor-paragraph&quot;&gt;Do you have human review steps at the right place? It&amp;rsquo;s tempting to have a workflow where AI does just everything and human only reviews the final result but in a complex multi-step workflow you will likely need few human review checkpoints.&lt;/p&gt;
&lt;/li&gt;
&lt;li class=&quot;article-editor-list-item&quot;&gt;
&lt;p class=&quot;article-editor-paragraph&quot;&gt;If workflow has a loop in it &amp;ndash; is there a risk of it becoming an endless loop or having too many iterations, do you want to put a limit on number of iterations to avoid it from consuming too many credits?&lt;/p&gt;
&lt;/li&gt;
&lt;/ul&gt;
&lt;p class=&quot;article-editor-paragraph&quot;&gt;Here are the high-level steps in our example workflow:&lt;/p&gt;
&lt;ol class=&quot;article-editor-ordered-list&quot;&gt;
&lt;li class=&quot;article-editor-list-item&quot;&gt;
&lt;p class=&quot;article-editor-paragraph&quot;&gt;Content creation task reaches the AI Assisted Brand review step.&lt;/p&gt;
&lt;/li&gt;
&lt;li class=&quot;article-editor-list-item&quot;&gt;
&lt;p class=&quot;article-editor-paragraph&quot;&gt;Opal gets the task details and extracts the content to be reviewed.&lt;/p&gt;
&lt;/li&gt;
&lt;li class=&quot;article-editor-list-item&quot;&gt;
&lt;p class=&quot;article-editor-paragraph&quot;&gt;Opal fetches the latest brand and tone of voice guidelines.&lt;/p&gt;
&lt;/li&gt;
&lt;li class=&quot;article-editor-list-item&quot;&gt;
&lt;p class=&quot;article-editor-paragraph&quot;&gt;For each content item in the task, Opal identifies the content type, reviews it against the relevant guidelines, and leaves a comment on the task with identified issues and suggested improvements.&lt;/p&gt;
&lt;/li&gt;
&lt;li class=&quot;article-editor-list-item&quot;&gt;
&lt;p class=&quot;article-editor-paragraph&quot;&gt;Opal moves the task to the next step, Final Brand Review and Approval.&lt;/p&gt;
&lt;/li&gt;
&lt;/ol&gt;
&lt;p class=&quot;article-editor-paragraph&quot;&gt;Next, we look at these initial steps and ask the questions:&lt;/p&gt;
&lt;ul class=&quot;article-editor-bullet-list&quot;&gt;
&lt;li class=&quot;article-editor-list-item&quot;&gt;
&lt;p class=&quot;article-editor-paragraph&quot;&gt;What should happen if we cannot get the task details on step 2?&lt;/p&gt;
&lt;/li&gt;
&lt;li class=&quot;article-editor-list-item&quot;&gt;
&lt;p class=&quot;article-editor-paragraph&quot;&gt;What if task status is Completed instead of instead of In Progress &amp;ndash; do we still do the review or skip it?&lt;/p&gt;
&lt;/li&gt;
&lt;li class=&quot;article-editor-list-item&quot;&gt;
&lt;p class=&quot;article-editor-paragraph&quot;&gt;What if we get an error fetching latest brand guidelines?&lt;/p&gt;
&lt;/li&gt;
&lt;li class=&quot;article-editor-list-item&quot;&gt;
&lt;p class=&quot;article-editor-paragraph&quot;&gt;On step 4, what content type should be reviewed and what content type should be skipped?&lt;/p&gt;
&lt;/li&gt;
&lt;li class=&quot;article-editor-list-item&quot;&gt;
&lt;p class=&quot;article-editor-paragraph&quot;&gt;Do we want to have a limit of content types to review within 1 task?&lt;/p&gt;
&lt;/li&gt;
&lt;/ul&gt;
&lt;p class=&quot;article-editor-paragraph&quot;&gt;Now we adjust our workflow with these considerations in mind:&lt;/p&gt;
&lt;ol class=&quot;article-editor-ordered-list&quot;&gt;
&lt;li class=&quot;article-editor-list-item&quot;&gt;
&lt;p class=&quot;article-editor-paragraph&quot;&gt;Content creation task reaches the AI Assisted Brand review step.&lt;/p&gt;
&lt;/li&gt;
&lt;li class=&quot;article-editor-list-item&quot;&gt;
&lt;p class=&quot;article-editor-paragraph&quot;&gt;Get task details. If there is an error when getting task details &amp;ndash; notify support/ops team via email. If task status is Completed &amp;ndash; skip processing and exit.&lt;/p&gt;
&lt;/li&gt;
&lt;li class=&quot;article-editor-list-item&quot;&gt;
&lt;p class=&quot;article-editor-paragraph&quot;&gt;Get the latest brand and tone of voice guidelines. If there is an error getting them &amp;ndash; skip processing, leave comment about this in the task and notify support/ops team via email&lt;/p&gt;
&lt;/li&gt;
&lt;li class=&quot;article-editor-list-item&quot;&gt;
&lt;p class=&quot;article-editor-paragraph&quot;&gt;Get content items with content type &amp;ldquo;article&amp;rdquo; or &amp;ldquo;social media post&amp;rdquo; from the task &amp;ndash; these are the only ones we want to cover with the review. If there are no matching content items &amp;ndash; skip processing, leave comment about this in the task. If there are more than 5 matching content items found &amp;ndash; leave comment that only first 5 will be processed, the rest will be skipped&lt;/p&gt;
&lt;/li&gt;
&lt;li class=&quot;article-editor-list-item&quot;&gt;
&lt;p class=&quot;article-editor-paragraph&quot;&gt;Loop over found content items: Review content item against brand guidelines, leave comment in the task with findings and recommendations. Stop after reviewing 5 content items.&lt;/p&gt;
&lt;/li&gt;
&lt;li class=&quot;article-editor-list-item&quot;&gt;
&lt;p class=&quot;article-editor-paragraph&quot;&gt;Move the task to the next step &amp;ndash; Final Brand Review and Approval.&lt;/p&gt;
&lt;/li&gt;
&lt;/ol&gt;
&lt;h3 class=&quot;article-editor-heading&quot;&gt;Configuring the Workflow&lt;/h3&gt;
&lt;h3 class=&quot;article-editor-heading&quot;&gt;CMP Configuration&lt;/h3&gt;
&lt;p class=&quot;article-editor-paragraph&quot;&gt;CMP will control the overall content production steps. We will not get into the details of CMP configuration in this article but if you&amp;rsquo;re starting with CMP, you can read about how to &lt;a class=&quot;article-editor-link article-editor-link&quot; href=&quot;https://support.optimizely.com/hc/en-us/articles/8186091022093-Manage-workflows&quot;&gt;configure task workflows&lt;/a&gt;.&lt;/p&gt;
&lt;h3 class=&quot;article-editor-heading&quot;&gt;Workflow&lt;/h3&gt;
&lt;p class=&quot;article-editor-paragraph&quot;&gt;Here is how our CMP Task Workflow looks like&lt;/p&gt;
&lt;p class=&quot;article-editor-paragraph&quot;&gt;&lt;img style=&quot;display: block; margin-left: auto; margin-right: auto;&quot; src=&quot;https://media.licdn.com/dms/image/v2/D5612AQHQ38iuMYP90Q/article-inline_image-shrink_1500_2232/B56Z.KaC6TJoAQ-/0/1784733511531?e=1786579200&amp;amp;v=beta&amp;amp;t=Xxqod8dnRdkMlW4aHhw29eyliyLY88thxtBkO30X7DI&quot; /&gt;&lt;/p&gt;
&lt;p class=&quot;article-editor-paragraph&quot;&gt;Note that AI Brand Review has the icon that indicates that it is an external step &amp;ndash; this is required to trigger Opal workflow agent from this step.&lt;/p&gt;
&lt;p class=&quot;article-editor-paragraph&quot;&gt;When converting this step to external step you will be required to select external system:&lt;/p&gt;
&lt;p class=&quot;article-editor-paragraph&quot;&gt;We will later use this in Opal agent configuration to distinguish webhook for external step in &amp;ldquo;Content Production with AI-Assisted Brand Review&amp;rdquo; CMP workflow vs external step in another CMP workflow.&lt;/p&gt;
&lt;h3 class=&quot;article-editor-heading&quot;&gt;&lt;img style=&quot;display: block; margin-left: auto; margin-right: auto;&quot; src=&quot;https://media.licdn.com/dms/image/v2/D5612AQFKzpGPJOtgNA/article-inline_image-shrink_1500_2232/B56Z.KaGknKcAQ-/0/1784733526572?e=1786579200&amp;amp;v=beta&amp;amp;t=J6mE4K_5A8cCCa9M79L-j91-VF5-_X08CUipZqoTxD0&quot; /&gt;&lt;/h3&gt;
&lt;h3 class=&quot;article-editor-heading&quot;&gt;Configuring webhook to trigger Opal workflow agent&lt;/h3&gt;
&lt;p class=&quot;article-editor-paragraph&quot;&gt;We already have workflow with external step &amp;ndash; now we need to create webhook in CMP to notify Opal when our external step &amp;ldquo;AI Brand Review&amp;rdquo; is started.&lt;/p&gt;
&lt;p class=&quot;article-editor-paragraph&quot;&gt;This process is describe in details here: &lt;a class=&quot;article-editor-link article-editor-link&quot; href=&quot;https://support.optimizely.com/hc/en-us/articles/43289384478989-How-to-trigger-workflow-agents-with-Content-Marketing-Platform-webhooks&quot;&gt;https://support.optimizely.com/hc/en-us/articles/43289384478989-How-to-trigger-workflow-agents-with-Content-Marketing-Platform-webhooks&lt;/a&gt;&lt;/p&gt;
&lt;p class=&quot;article-editor-paragraph&quot;&gt;We will only select 1 event for our webhook: &lt;strong&gt;external_sub_step_started&lt;/strong&gt;&lt;/p&gt;
&lt;p class=&quot;article-editor-paragraph&quot;&gt;Note that when creating webhook you will need to provide callback URL and secret &amp;ndash; you get those when you create trigger in Opal &amp;ndash; once you get them copy them to webhook settings.&lt;/p&gt;
&lt;h3 class=&quot;article-editor-heading&quot;&gt;Opal Configuration&lt;/h3&gt;
&lt;p class=&quot;article-editor-paragraph&quot;&gt;Here is how our workflow will look like when we&amp;rsquo;re done&lt;/p&gt;
&lt;p class=&quot;article-editor-paragraph&quot;&gt;&lt;img style=&quot;display: block; margin-left: auto; margin-right: auto;&quot; src=&quot;/link/d7e550844e6e4483a0aeb8ff530e086e.aspx&quot; width=&quot;1267&quot; height=&quot;693&quot; /&gt;&lt;/p&gt;
&lt;p class=&quot;article-editor-paragraph&quot;&gt;Let&amp;rsquo;s see how we create it step by step.&lt;/p&gt;
&lt;h3 class=&quot;article-editor-heading&quot;&gt;Connect Opal to CMP instance&lt;/h3&gt;
&lt;p class=&quot;article-editor-paragraph&quot;&gt;For Opal agents to be able to use existing CMP tools to get task details, it must be given access to this CMP instance by connecting to it.&lt;/p&gt;
&lt;p class=&quot;article-editor-paragraph&quot;&gt;Note that this connection can only be added by Opal Administrator in your organisation: &lt;a class=&quot;article-editor-link article-editor-link&quot; href=&quot;https://support.optimizely.com/hc/en-us/articles/36359944449805-Get-started-with-Optimizely-Opal-for-administrators#h_01JTGSVJJ6VYDVXSYEK8MZTQWX&quot;&gt;https://support.optimizely.com/hc/en-us/articles/36359944449805-Get-started-with-Optimizely-Opal-for-administrators#h_01JTGSVJJ6VYDVXSYEK8MZTQWX&lt;/a&gt;&lt;/p&gt;
&lt;p class=&quot;article-editor-paragraph&quot;&gt;As a user, you can check what Optimizely products and instances Opal is connected to by creating a workflow agent, adding a trigger step, clicking on the trigger step and see what products and instances are available in Product Instance drop-down.&lt;/p&gt;
&lt;p class=&quot;article-editor-paragraph&quot;&gt;&lt;img style=&quot;display: block; margin-left: auto; margin-right: auto;&quot; src=&quot;https://media.licdn.com/dms/image/v2/D5612AQEljT6VHAuhmg/article-inline_image-shrink_1500_2232/B56Z.Kanc7JoAQ-/0/1784733661280?e=1786579200&amp;amp;v=beta&amp;amp;t=C4uJBmOl5wc5HxohrbUycJDDkBrDdOXBTj4SfO2WteQ&quot; /&gt;&lt;/p&gt;
&lt;h3 class=&quot;article-editor-heading&quot;&gt;Add Trigger&lt;/h3&gt;
&lt;p class=&quot;article-editor-paragraph&quot;&gt;Once you add a trigger by dragging it from the components section to working area, make sure to select the right product instance and configure auth header as described in the documentation:&lt;/p&gt;
&lt;p class=&quot;article-editor-paragraph&quot;&gt;&lt;a class=&quot;article-editor-link article-editor-link&quot; href=&quot;https://support.optimizely.com/hc/en-us/articles/43289384478989-How-to-trigger-workflow-agents-with-Content-Marketing-Platform-webhooks&quot;&gt;https://support.optimizely.com/hc/en-us/articles/43289384478989-How-to-trigger-workflow-agents-with-Content-Marketing-Platform-webhooks&lt;/a&gt;&lt;/p&gt;
&lt;p class=&quot;article-editor-paragraph&quot;&gt;&lt;img style=&quot;display: block; margin-left: auto; margin-right: auto;&quot; src=&quot;https://media.licdn.com/dms/image/v2/D5612AQEqTVINacL5Fg/article-inline_image-shrink_1500_2232/B56Z.KarpOKMAU-/0/1784733678399?e=1786579200&amp;amp;v=beta&amp;amp;t=Ev8Qto4m7v3RD3bRpIg5f-lVXOoXphwjLKOOvS9tLAM&quot; /&gt;&lt;/p&gt;
&lt;p class=&quot;article-editor-paragraph&quot;&gt;Copy webhook URL and secret and put them in webhook configuration on CMP side.&lt;/p&gt;
&lt;p class=&quot;article-editor-paragraph is-empty&quot;&gt;&amp;nbsp;&lt;/p&gt;
&lt;h3 class=&quot;article-editor-heading&quot;&gt;Add check for external system passed in webhook&lt;/h3&gt;
&lt;p class=&quot;article-editor-paragraph&quot;&gt;&lt;img style=&quot;display: block; margin-left: auto; margin-right: auto;&quot; src=&quot;https://media.licdn.com/dms/image/v2/D5612AQH1HuRYeQjiaA/article-inline_image-shrink_1500_2232/B56Z.KWnOVGQAQ-/0/1784732611703?e=1786579200&amp;amp;v=beta&amp;amp;t=G4z3BvhoHgxHG6vLDrM1bOMEh8E4Wg4UtW8-vyjzLq0&quot; /&gt;&lt;/p&gt;
&lt;p class=&quot;article-editor-paragraph&quot;&gt;This is similar to External Step Routing Agent described here: &lt;a class=&quot;article-editor-link article-editor-link&quot; href=&quot;https://support.optimizely.com/hc/en-us/articles/43289384478989-How-to-trigger-workflow-agents-with-Content-Marketing-Platform-webhooks&quot;&gt;https://support.optimizely.com/hc/en-us/articles/43289384478989-How-to-trigger-workflow-agents-with-Content-Marketing-Platform-webhooks&lt;/a&gt;&lt;/p&gt;
&lt;p class=&quot;article-editor-paragraph&quot;&gt;But instead of agent with external step name specified in prompt, we use an agent that gets value of external step + a condition that checks it. You can re-use this combination in other workflows initiated by a webhook trigger without having to create separate step routing agent with different external system name in prompt.&lt;/p&gt;
&lt;p class=&quot;article-editor-paragraph&quot;&gt;We need to add this check because CMP will call the webhook any time an external sub step of a task is started. It could be an external step of a task in a completely different workflow unrelated to content production.&lt;/p&gt;
&lt;h3 class=&quot;article-editor-heading&quot;&gt;Add agents to get task and step details and check if it&amp;rsquo;s ready for processing&lt;/h3&gt;
&lt;p class=&quot;article-editor-paragraph&quot;&gt;Next, we need agents that will get task details and check if task is at the right step in the workflow (AI Brand Review).&lt;/p&gt;
&lt;p class=&quot;article-editor-paragraph&quot;&gt;&lt;img style=&quot;display: block; margin-left: auto; margin-right: auto;&quot; src=&quot;https://media.licdn.com/dms/image/v2/D5612AQGMeGKuGmFOrw/article-inline_image-shrink_1000_1488/B56Z.KbhxNHUAM-/0/1784733900139?e=1786579200&amp;amp;v=beta&amp;amp;t=bgemiz65ENgvYWlT_D7e9GEaz1z1fuVaBWYujVGVkRY&quot; width=&quot;815&quot; height=&quot;469&quot; /&gt;&lt;/p&gt;
&lt;p class=&quot;article-editor-paragraph&quot;&gt;All this could be done with 1 specialised agent, but as we covered before, smaller agents are easier to create and maintain.&lt;/p&gt;
&lt;p class=&quot;article-editor-paragraph&quot;&gt;We already covered details on creating specialised agents in the previous article, so here we&amp;rsquo;ll focus on what each of these agents will do rather than how they are built.&lt;/p&gt;
&lt;p class=&quot;article-editor-paragraph&quot;&gt;&lt;strong&gt;Get CMP Task Details from Webhook &lt;/strong&gt;agent does exactly what the name suggests&lt;/p&gt;
&lt;ul class=&quot;article-editor-bullet-list&quot;&gt;
&lt;li class=&quot;article-editor-list-item&quot;&gt;
&lt;p class=&quot;article-editor-paragraph&quot;&gt;Gets CMP task ID from webhook&lt;/p&gt;
&lt;/li&gt;
&lt;li class=&quot;article-editor-list-item&quot;&gt;
&lt;p class=&quot;article-editor-paragraph&quot;&gt;Uses &lt;strong&gt;get_cmp_resource&lt;/strong&gt; tool to get task details&lt;/p&gt;
&lt;/li&gt;
&lt;li class=&quot;article-editor-list-item&quot;&gt;
&lt;p class=&quot;article-editor-paragraph&quot;&gt;Returns task details&lt;/p&gt;
&lt;/li&gt;
&lt;/ul&gt;
&lt;p class=&quot;article-editor-paragraph&quot;&gt;You can re-use agent in any other workflow that is initiated by a webhook from CMP Task.&lt;/p&gt;
&lt;p class=&quot;article-editor-paragraph&quot;&gt;&lt;strong&gt;&amp;nbsp;Verify CMP Task and Step &lt;/strong&gt;agent gets task details from the previous agent, check the status of the task (should be &lt;strong&gt;In Progress&lt;/strong&gt;), and the current step of the task (should be AI Brand Review). If task has the right status and is at the right step &amp;ndash; it will return &lt;strong&gt;READY_TO_PROCEED&lt;/strong&gt;.&lt;/p&gt;
&lt;p class=&quot;article-editor-paragraph&quot;&gt;&lt;img style=&quot;display: block; margin-left: auto; margin-right: auto;&quot; src=&quot;https://media.licdn.com/dms/image/v2/D5612AQGgl0LzgLwbxw/article-inline_image-shrink_1000_1488/B56Z.KbrIwG8AI-/0/1784733938544?e=1786579200&amp;amp;v=beta&amp;amp;t=yVsJ8MJg3CRJ7st2edSfPvmJzWIuGE7_FgdWEl01kiM&quot; width=&quot;629&quot; height=&quot;362&quot; /&gt;&lt;/p&gt;
&lt;p class=&quot;article-editor-paragraph&quot;&gt;We then have a condition step that moves workflow to next step (Brand Guardrails retrieval) or stops processing if the CMP task has wrong status or is not at &amp;ldquo;AI Brand Review&amp;rdquo; step.&lt;/p&gt;
&lt;p class=&quot;article-editor-paragraph&quot;&gt;We also added a condition to notify Ops team in case Opal fails to get task details from CMP. This is an optional condition and we&amp;rsquo;re using it as example of how you can make the workflow more robust.&lt;/p&gt;
&lt;p class=&quot;article-editor-paragraph&quot;&gt;&amp;nbsp;&lt;/p&gt;
&lt;h3 class=&quot;article-editor-heading&quot;&gt;Add agent to get latest brand and tone of voice guidelines&lt;/h3&gt;
&lt;p class=&quot;article-editor-paragraph&quot;&gt;&lt;img style=&quot;display: block; margin-left: auto; margin-right: auto;&quot; src=&quot;https://media.licdn.com/dms/image/v2/D5612AQFn528yInFL1g/article-inline_image-shrink_1500_2232/B56Z.KbvejGQAU-/0/1784733956347?e=1786579200&amp;amp;v=beta&amp;amp;t=LgddnHyWZI5LG5RzDcu4tIFwit5JydWnt831Th0l39Y&quot; width=&quot;617&quot; height=&quot;478&quot; /&gt;&lt;/p&gt;
&lt;p class=&quot;article-editor-paragraph&quot;&gt;This agent gets the latest version of brand and tone of voice guidelines. Depending on how and where you store these guidelines, it can use tools like browse_web or read_file or a custom tool (if you keep brand guidelines in a system that must be access in a specific way).&lt;/p&gt;
&lt;p class=&quot;article-editor-paragraph&quot;&gt;This agent should also return the status of guidelines retrieval. In this example we return &lt;strong&gt;BRAND_GUIDELINES_READY&lt;/strong&gt;&amp;nbsp; if all went well.&lt;/p&gt;
&lt;p class=&quot;article-editor-paragraph&quot;&gt;Here we also have a contingency step to notify Ops team if brand retrieval was not successful.&lt;/p&gt;
&lt;h3 class=&quot;article-editor-heading&quot;&gt;Add agent to get content items from the task&lt;/h3&gt;
&lt;p class=&quot;article-editor-paragraph&quot;&gt;&lt;img style=&quot;display: block; margin-left: auto; margin-right: auto;&quot; src=&quot;https://media.licdn.com/dms/image/v2/D5612AQGPPfxb9RPhAQ/article-inline_image-shrink_400_744/B56Z.Kb3vRG4AQ-/0/1784733990158?e=1786579200&amp;amp;v=beta&amp;amp;t=jFrVd66DRu1KoFyJClSPFD-Soc1OZ7Gr_ZC9UXs1lxE&quot; /&gt;&lt;/p&gt;
&lt;p class=&quot;article-editor-paragraph&quot;&gt;Now that we have the brand guidelines, we need to get content items from the task. This agent goes over list of content items created in the task and filters one with the appropriate type (article, social post, etc). It can get list of content items in task from &amp;ldquo;Get CMP task details&amp;rdquo; agent or use tool &lt;strong&gt;get_cmp_resource&lt;/strong&gt; to get this information. We can also instruct this agent to:&lt;/p&gt;
&lt;ul class=&quot;article-editor-bullet-list&quot;&gt;
&lt;li class=&quot;article-editor-list-item&quot;&gt;
&lt;p class=&quot;article-editor-paragraph&quot;&gt;leave comment in the task if there are no content items found in the task and there is nothing to review;&lt;/p&gt;
&lt;/li&gt;
&lt;li class=&quot;article-editor-list-item&quot;&gt;
&lt;p class=&quot;article-editor-paragraph&quot;&gt;only choose first 5 content items from the task if it has too many (to avoid workflow taking forever and consuming too many credits) and leave comment about this in the task.&lt;/p&gt;
&lt;/li&gt;
&lt;/ul&gt;
&lt;p class=&quot;article-editor-paragraph&quot;&gt;&amp;nbsp;&lt;/p&gt;
&lt;h3 class=&quot;article-editor-heading&quot;&gt;Use loop to call Brand Review Agent for each content item&lt;/h3&gt;
&lt;p class=&quot;article-editor-paragraph&quot;&gt;&lt;img style=&quot;display: block; margin-left: auto; margin-right: auto;&quot; src=&quot;https://media.licdn.com/dms/image/v2/D5612AQG6a48UEsVXgQ/article-inline_image-shrink_400_744/B56Z.Kb._XGgAM-/0/1784734019933?e=1786579200&amp;amp;v=beta&amp;amp;t=IQOS6DiuDgUwMsCDM2LQCW3EWa2NahECSkWgfiFSZ10&quot; /&gt;&lt;/p&gt;
&lt;p class=&quot;article-editor-paragraph&quot;&gt;Since a task can have multiple content items in it, we use loop to iterate over these content items and call Brand Review Agent for each of them.&lt;/p&gt;
&lt;p class=&quot;article-editor-paragraph&quot;&gt;Brand Review Agent already has access to brand guidelines (passed from &amp;ldquo;Retrieve Latest Brand Guidelines&amp;rdquo; agent), uses tool &lt;strong&gt;cmp_retrieve_asset_from_library &lt;/strong&gt;to get asset contents, and uses tool &lt;strong&gt;add_comment_on_task_substep &lt;/strong&gt;to leave comment with review details.&lt;/p&gt;
&lt;h3 class=&quot;article-editor-heading&quot;&gt;Mark step in task as Completed&lt;/h3&gt;
&lt;p class=&quot;article-editor-paragraph&quot;&gt;To make CMP workflow progress to the next step, we have an agent that uses tool &lt;strong&gt;update_task_substep &lt;/strong&gt;to complete the current step (AI Brand Review).&lt;/p&gt;
&lt;h3 class=&quot;article-editor-heading&quot;&gt;Testing and Troubleshooting the Workflow&lt;/h3&gt;
&lt;p class=&quot;article-editor-paragraph&quot;&gt;Just as specialised agents, workflow agents in Opal keep execution log that show details of each step in the workflow, including input, output and processing status.&lt;/p&gt;
&lt;figure class=&quot;article-editor-figure-image&quot;&gt;
&lt;div class=&quot;article-editor-inline-image__container article-editor-inline-image__container--resize&quot;&gt;
&lt;div class=&quot;article-editor-content__element-overlay&quot;&gt;
&lt;div class=&quot;article-editor-inline-image__buttons&quot;&gt;
&lt;div class=&quot;resize-image-control-button-tooltip resize-image-control-button-tooltip--hidden&quot;&gt;Maximize image&lt;/div&gt;
&lt;div class=&quot;resize-image-control-button-tooltip resize-image-control-button-tooltip--hidden&quot;&gt;Edit image&lt;/div&gt;
&lt;div class=&quot;resize-image-control-button-tooltip resize-image-control-button-tooltip--hidden&quot;&gt;Delete image&lt;/div&gt;
&lt;/div&gt;
&lt;/div&gt;
&lt;img class=&quot;article-editor-inline-image__image&quot; src=&quot;https://media.licdn.com/dms/image/v2/D5612AQEo6FmSPoucnw/article-inline_image-shrink_1000_1488/B56Z.KcJ_SKAAI-/0/1784734064904?e=1786579200&amp;amp;v=beta&amp;amp;t=jKUmmqtJitOsWqLG2jnV62CqgBRZKqf1og14CvxjxvE&quot; alt=&quot;&quot; /&gt;&lt;/div&gt;
&lt;figcaption class=&quot;is-empty&quot;&gt;&lt;/figcaption&gt;
&lt;/figure&gt;
&lt;p class=&quot;article-editor-paragraph&quot;&gt;To see details of an execution &amp;ndash; click on the flow icon&lt;/p&gt;
&lt;p class=&quot;article-editor-paragraph&quot;&gt;&lt;img style=&quot;display: block; margin-left: auto; margin-right: auto;&quot; src=&quot;/link/ff060a4fea194b54a3a6fce1d2812278.aspx&quot; width=&quot;1725&quot; height=&quot;262&quot; /&gt;&lt;/p&gt;
&lt;p class=&quot;article-editor-paragraph&quot;&gt;And from there you can click on each step in the workflow to see its input, output and execution memory.&lt;/p&gt;
&lt;p class=&quot;article-editor-paragraph&quot;&gt;I recommend that you do this testing early in the process and repeat every time you add a new step to the workflow, especially if you are creating a workflow for the first time. Otherwise, it will be difficult to find where it went wrong when you need to troubleshoot across 5-10 steps.&lt;/p&gt;
&lt;p class=&quot;article-editor-paragraph&quot;&gt;As a starting point &amp;ndash; make sure CMP trigger actually works:&lt;/p&gt;
&lt;ul class=&quot;article-editor-bullet-list&quot;&gt;
&lt;li class=&quot;article-editor-list-item&quot;&gt;
&lt;p class=&quot;article-editor-paragraph&quot;&gt;Create CMP task based on the workflow that includes external step that will trigger the webhook&lt;/p&gt;
&lt;/li&gt;
&lt;li class=&quot;article-editor-list-item&quot;&gt;
&lt;p class=&quot;article-editor-paragraph&quot;&gt;Make sure you saved you workflow agent and it&amp;rsquo;s in Active status&lt;/p&gt;
&lt;/li&gt;
&lt;li class=&quot;article-editor-list-item&quot;&gt;
&lt;p class=&quot;article-editor-paragraph&quot;&gt;Move task to the step that triggers the Opal workflow and make sure step is in In Progress state&lt;/p&gt;
&lt;/li&gt;
&lt;li class=&quot;article-editor-list-item&quot;&gt;
&lt;p class=&quot;article-editor-paragraph&quot;&gt;Go to Opal agent &amp;gt; View logs &amp;ndash; you should see agent execution in the log&lt;/p&gt;
&lt;/li&gt;
&lt;/ul&gt;
&lt;p class=&quot;article-editor-paragraph&quot;&gt;&amp;nbsp;&lt;/p&gt;
&lt;h3 class=&quot;article-editor-heading&quot;&gt;Lessons learned&lt;/h3&gt;
&lt;p class=&quot;article-editor-paragraph&quot;&gt;A few principles I would carry into building any workflow like this:&lt;/p&gt;
&lt;p class=&quot;article-editor-paragraph&quot;&gt;&lt;strong&gt;Start small. &lt;/strong&gt;One trigger, one review, one comment. A first version that also fixes the content, reassigns the task, and updates three external systems in the process is harder to test and debug. Get one path working end to end before you add the next.&lt;/p&gt;
&lt;p class=&quot;article-editor-paragraph&quot;&gt;&lt;strong&gt;Use a clear trigger. &lt;/strong&gt;It should be clear what starts the workflow. If you find yourself adding too many conditions right after the trigger, the trigger is probably too broad.&lt;/p&gt;
&lt;p class=&quot;article-editor-paragraph&quot;&gt;&lt;strong&gt;Keep each agent focused.&lt;/strong&gt; The same rule as in the first article applies: an agent should do one thing well. This matters even more inside a workflow than in chat, because agents in a workflow run unattended in a single pass - there is nobody there to answer a clarifying question, so the prompt has to carry everything the agent needs.&lt;/p&gt;
&lt;p class=&quot;article-editor-paragraph&quot;&gt;&lt;strong&gt;Keep a human approval step. &lt;/strong&gt;No matter how good the results may look, leave the final step assigned to a person. The workflow&#39;s job is to make that person faster, not to replace their decision.&lt;/p&gt;
&lt;p class=&quot;article-editor-paragraph&quot;&gt;&lt;strong&gt;Do not automate irreversible actions early.&lt;/strong&gt; Leaving a comment is easy to ignore if it is wrong. Un-publishing content or rejecting a task is not as easy. Keep the workflow on the safe side of that line until you trust it.&lt;/p&gt;
&lt;p class=&quot;article-editor-paragraph&quot;&gt;&lt;strong&gt;Measure the result.&lt;/strong&gt; The point of this workflow is less manual effort and better review coverage. Check whether that is actually happening by looking at the measurements available in agent execution log, CMP reports on tasks throughput and most importantly, by talking to people who use the workflow.&lt;/p&gt;
&lt;h2 class=&quot;article-editor-heading&quot;&gt;Wrapping up&lt;/h2&gt;
&lt;p class=&quot;article-editor-paragraph&quot;&gt;In the first article, we built a specialised agent that focuses on one task. In this one, we connected several agents to create to a real content process: a trigger from CMP, context gathered at run time, a loop over content items, an action written back into the task, and a human making the final call.&lt;/p&gt;
&lt;p class=&quot;article-editor-paragraph&quot;&gt;Standalone agents are already valuable, but workflows are where the efficiency gains can multiply. When applied to the right process and designed well, workflows can run consistently whenever they are needed, without relying on someone to initiate each step. As this example shows, that does not mean removing the human from the process. The goal is to reduce the time spent on repetitive, time-consuming tasks so people can focus on review, judgement and final decisions. AI simply expands the range of work that can be treated as routine and automated.&lt;/p&gt;</id><updated>2026-07-23T14:48:00.0000000Z</updated><summary type="html">Blog post</summary></entry> <entry><title>Building Your First Optimizely Opal AI Agent: a Hands-On Walkthrough</title><link href="https://world.optimizely.com/blogs/my-blog/dates/2026/7/building-your-first-optimizely-opal-ai-agent-a-hands-on-walkthrough/" /><id>&lt;h2 class=&quot;article-editor-heading article-editor-content__has-focus&quot;&gt;Introduction&lt;/h2&gt;
&lt;p class=&quot;article-editor-paragraph&quot;&gt;There&#39;s a common assumption that building an AI agent is something only engineers or developers can do. It isn&#39;t. At the Optimizely ANZ Ai-ccelerate Opal Workshop in Melbourne this May, a room full of marketeers built their own working Opal agents in a single 2-hour session. For some of them it was the first time they&amp;rsquo;ve seen Optimizely Opal.&lt;/p&gt;
&lt;p class=&quot;article-editor-paragraph&quot;&gt;A specialised agent in Optimizely Opal is, at its core, a set of written instructions and a few settings &amp;ndash; there&amp;rsquo;s no code writing required. The main skill is being able to describe a task clearly: if you can write a clear brief for a colleague, you have most of what you need. Of course, understanding the subject matter is also very important. The rest is understanding few key concepts and some best practices &amp;ndash; this is what this article covers.&lt;/p&gt;
&lt;p class=&quot;article-editor-paragraph&quot;&gt;This article is for anyone who has started using Opal and wants to understand how specialised agents are built. You don&#39;t need to be technical, and you don&#39;t need a developer&#39;s background. It&#39;s written with marketing managers, content managers, and CRO specialists in mind, but it&#39;s just as useful if you&#39;re still getting familiar with Opal and want a clear picture of what&#39;s going on under the hood before you build anything yourself.&lt;/p&gt;
&lt;p class=&quot;article-editor-paragraph&quot;&gt;To keep it practical, we will use example of building &lt;strong&gt;Answer Readiness Reviewer&lt;/strong&gt; agent: you give it a page URL and a question, and it tells you whether an AI assistant (ChatGPT, Claude, Perplexity, and the like) could actually pull the answer to that question off that page. It reads the content, decides whether the answer is explicit, buried, fragmented, or missing, and then suggests what to change so the page is more likely to be the one an AI quotes. Deciding whether a page actually answers a question well enough for an AI assistant to use it is a judgement call, not a straightforward check that can be done by a script, and that&#39;s exactly the kind of work an agent is good at. We&#39;ll use it as our running example so that every concept has something solid attached to it.&lt;/p&gt;
&lt;h2 class=&quot;article-editor-heading&quot;&gt;What an agent actually is&lt;/h2&gt;
&lt;p class=&quot;article-editor-paragraph&quot;&gt;Let&amp;rsquo;s start with understanding key concepts used in Opal: &lt;strong&gt;agents&lt;/strong&gt;, &lt;strong&gt;tools&lt;/strong&gt;, and &lt;strong&gt;skills&lt;/strong&gt;.&lt;/p&gt;
&lt;p class=&quot;article-editor-paragraph&quot;&gt;An &lt;strong&gt;agent&lt;/strong&gt; is the assistant that completes the task. It follows a set of written instructions to complete it, and it can call on tools to take action along the way. Opal describes agents as intelligent assistants that use natural language prompts and tools to complete tasks on your behalf, with each agent having a specific purpose &amp;ndash; generating content, analysing data, or automating a step in a workflow.&lt;/p&gt;
&lt;p class=&quot;article-editor-paragraph&quot;&gt;A &lt;strong&gt;tool&lt;/strong&gt; is a single action the agent can take. Opal&#39;s own analogy is an attachment on a Swiss Army knife &amp;ndash; each one does one specific thing. Examples of tools include searching the web, creating a campaign, generating an image, or fetching the HTML of a web page. The agent decides which tools it needs and calls them; you don&#39;t run them by hand. Our example agent will use a tool called browse_web_html. This tool fetches the raw contents of a web page. Agent will use it to read the actual page it&#39;s been asked to review, exactly as a browser would see it. Opal has an rich catalogue of tools available out of the box &amp;ndash; you can find it here &lt;a class=&quot;article-editor-link article-editor-link&quot; href=&quot;https://support.optimizely.com/hc/en-us/articles/39340107628429-System-tools-overview&quot;&gt;https://support.optimizely.com/hc/en-us/articles/39340107628429-System-tools-overview&lt;/a&gt;&lt;/p&gt;
&lt;p class=&quot;article-editor-paragraph&quot;&gt;The relationship between the two is simple: the &lt;strong&gt;agent is the worker, the tools are its equipment&lt;/strong&gt;. An agent with no tools can only think and write. An agent with the right tools can also do things &amp;ndash; read a page, send an email, update a record. You give an agent access to a tool by naming it in the agent&#39;s instructions and adding it in the agent&#39;s Tools section.&lt;/p&gt;
&lt;p class=&quot;article-editor-paragraph&quot;&gt;&lt;strong&gt;Skills&lt;/strong&gt; (which Opal used to call &quot;instructions&quot;) are the third piece. Skills are reusable context and guidelines that shape how Opal behaves, like your brand voice, your product descriptions, your target personas, or your formatting rules. The point of skills is that you write them once and reuse them everywhere, instead of repeating &quot;here&#39;s our tone of voice&quot; in every single agent. One thing worth knowing: a specialized agent does not automatically pull in your skills. If you want an agent to use one, you reference it explicitly in the agent&#39;s instructions. So skills are the shared knowledge your agents use if needed.&lt;/p&gt;
&lt;p class=&quot;article-editor-paragraph&quot;&gt;Put together: an &lt;strong&gt;agent&lt;/strong&gt; does a job by following its prompt, using shared &lt;strong&gt;skills&lt;/strong&gt; for context, and calling &lt;strong&gt;tools&lt;/strong&gt; to take actions.&lt;/p&gt;
&lt;h3 class=&quot;article-editor-heading&quot;&gt;The three types of agents&lt;/h3&gt;
&lt;p class=&quot;article-editor-paragraph&quot;&gt;Opal has three kinds of agents, and knowing the difference saves you from building something that already exists.&lt;/p&gt;
&lt;p class=&quot;article-editor-paragraph&quot;&gt;&lt;strong&gt;Out-of-the-box agents&lt;/strong&gt; (also called default agents) live in the &lt;strong&gt;Agent Directory&lt;/strong&gt;. Optimizely builds and maintains these, and they&#39;re ready to run without any setup. They cover common jobs like reviewing content for tone and style, generating competitive insights, or drafting support responses. Each listing tells you what the agent does, which tools it includes, and what you can configure. If one of these already does what you need &amp;ndash; try using it first. They&#39;re also worth checking out even when you plan to build your own, because they show you working examples of how an agent is structured. You can see list of available agents if you select Agents from the left frame menu in Opal and then select Agent Directory.&lt;/p&gt;
&lt;p class=&quot;article-editor-paragraph&quot;&gt;&lt;img src=&quot;/link/34a8a928b5fe47d7bb163326c549dd1f.aspx&quot; /&gt;&lt;/p&gt;
&lt;p class=&quot;article-editor-paragraph&quot;&gt;If you don&amp;rsquo;t yet have access to Opal, you can find agent directory here:&amp;nbsp;&lt;a class=&quot;article-editor-link article-editor-link&quot; href=&quot;https://www.optimizely.com/agents/&quot;&gt;https://www.optimizely.com/agents/&lt;/a&gt;&lt;/p&gt;
&lt;p class=&quot;article-editor-paragraph&quot;&gt;&lt;strong&gt;Specialised agents&lt;/strong&gt; are the custom agents you build. Specialised agents are the right choice when no default agent covers your task and you want precise control over the inputs, the output, and the behaviour.&lt;/p&gt;
&lt;p class=&quot;article-editor-paragraph&quot;&gt;&lt;strong&gt;Workflow agents&lt;/strong&gt; are the third type, and they&#39;re more advanced. A workflow agent chains several default and specialised agents together into a multi-step process, with the output of one feeding into the next. Think of it as assembling a small team where each member does their part and hands off to the next.&lt;/p&gt;
&lt;p class=&quot;article-editor-paragraph&quot;&gt;This article focuses on building Specialised agents, we&amp;rsquo;ll cover Workflow agents in another article.&lt;/p&gt;
&lt;h3 class=&quot;article-editor-heading&quot;&gt;Before you start: the prerequisites&lt;/h3&gt;
&lt;p class=&quot;article-editor-paragraph&quot;&gt;A few things need to be in place before you can create a specialised agent.&lt;/p&gt;
&lt;p class=&quot;article-editor-paragraph&quot;&gt;&lt;strong&gt;Opal license that supports creating specialised agents.&lt;/strong&gt; If you&#39;re unsure what your Opal license covers, your Customer Success Manager can confirm.&lt;/p&gt;
&lt;p class=&quot;article-editor-paragraph&quot;&gt;&lt;strong&gt;The right role assigned to your user.&lt;/strong&gt; The roles that can create agents are &lt;em&gt;Agent Builder&lt;/em&gt;, &lt;em&gt;Opal Administrator&lt;/em&gt; or any custom role that&#39;s been given the &quot;&lt;em&gt;Add, edit, and install specialized agents&lt;/em&gt;&quot; permission. If you can see the Agents page but the Add Agent button isn&#39;t there, you most likely have Opal User role that lets you use Opal but does not allow to create or edit agents.&lt;/p&gt;
&lt;p class=&quot;article-editor-paragraph&quot;&gt;&lt;img src=&quot;/link/f15f4e13f7eb4e479f7bc75a2a23252d.aspx&quot; /&gt;&lt;/p&gt;
&lt;h3 class=&quot;article-editor-heading&quot;&gt;Best practices: keep each agent small&lt;/h3&gt;
&lt;p class=&quot;article-editor-paragraph&quot;&gt;Before proceed with agent configuration, you need to plan what you want this agent to do and what part of the overall workflow it will handle. There is an important best practice worth remembering when doing the planning: give each agent one job, keep agents simple.&lt;/p&gt;
&lt;p class=&quot;article-editor-paragraph&quot;&gt;You may be tempted to build one big agent that does everything &amp;ndash; fetches the pages, analyses them, rewrites the content, and emails a report. Avoid doing this. Big agents are hard to maintain. They are slower and more expensive to test, because each run does more work and consumes more Opal credits. They are harder to troubleshoot, because when the result is wrong, it&#39;s not always obvious which part failed. And they are harder to improve, because any change you make carries a higher risk of breaking something that was working.&lt;/p&gt;
&lt;p class=&quot;article-editor-paragraph&quot;&gt;Better approach is to break a process into individual steps and for each step decide who will handle it &amp;ndash; a person, an external system, an existing tool, out-of-the-box Opal agent or a specialised Opal agent. Our example is a good illustration. The broad goal is &quot;make our content perform well with AI assistants,&quot; which is a big task. But the Answer Readiness Reviewer doesn&#39;t try to own all of it. It does exactly one thing: given one page and one question, decide whether an AI could extract the answer, and suggest what would make it better. It doesn&#39;t crawl your whole site, it doesn&#39;t pick which questions matter, and it doesn&#39;t rewrite the page for you. Such agent is easy to describe, easy to test, and easy to reuse &amp;ndash; including as one step inside a bigger workflow later.&lt;/p&gt;
&lt;p class=&quot;article-editor-paragraph&quot;&gt;If this principle sounds familiar, it&#39;s because it isn&#39;t new. This is one of the things I liked about Linux when I started learning it: the idea that each program should do one thing well, and that you chain small programs together to do complex work.&lt;/p&gt;
&lt;p class=&quot;article-editor-paragraph&quot;&gt;A few related habits that come from the same principle:&lt;/p&gt;
&lt;ul class=&quot;article-editor-bullet-list&quot;&gt;
&lt;li class=&quot;article-editor-list-item&quot;&gt;
&lt;p class=&quot;article-editor-paragraph&quot;&gt;&lt;strong&gt;Define the job in 1-2 sentences before you build.&lt;/strong&gt; If you can&#39;t, the scope could be too big and you may need to break it down further. Our example&#39;s sentence: &quot;Given a page and a question, judge whether an AI could extract the answer, and suggest how to improve the page&#39;s chances of being cited.&quot;&lt;/p&gt;
&lt;/li&gt;
&lt;li class=&quot;article-editor-list-item&quot;&gt;
&lt;p class=&quot;article-editor-paragraph&quot;&gt;&lt;strong&gt;Be clear about the output.&lt;/strong&gt; Decide upfront what the agent should return as result &amp;ndash; plain text, a table, a file, or structured data like JSON (to pass to another agent or tool) and how that output will be used. Our example returns a short text summary a person can act on: a rating, the evidence behind it, and a list of suggested fixes.&lt;/p&gt;
&lt;/li&gt;
&lt;/ul&gt;
&lt;p class=&quot;article-editor-paragraph&quot;&gt;Know which tools it will need. List only the tools required for that one job. Our example needs to read one web page, so it gets one tool: browse_web_html.&lt;/p&gt;
&lt;h2 class=&quot;article-editor-heading&quot;&gt;Getting started&lt;/h2&gt;
&lt;p class=&quot;article-editor-paragraph&quot;&gt;You can build a specialised agent completely from scratch. But there&#39;s usually a faster path, especially if you are new to this: find the existing agent that&#39;s closest to what you want and use it as a starting point. A close-enough agent already has a sensible structure &amp;ndash; a prompt laid out in steps, the right kind of tools selected, an output format chosen. You can keep this structure and change the details, instead of trying to think of everything from scratch. The default agents in the Agent Directory are good candidates for this, and so is any agent your team has already built.&lt;/p&gt;
&lt;p class=&quot;article-editor-paragraph&quot;&gt;In our example, we will use FAQ Creation agent as starting point.&lt;/p&gt;
&lt;p class=&quot;article-editor-paragraph&quot;&gt;Use Duplicate Agent from the context menu to create a copy of an existing agent.&lt;/p&gt;
&lt;h3 class=&quot;article-editor-heading&quot;&gt;&lt;img src=&quot;/link/332e08be77b341c7ae715873dfa45673.aspx&quot; /&gt;&lt;/h3&gt;
&lt;h3 class=&quot;article-editor-heading&quot;&gt;Agent Configuration&lt;/h3&gt;
&lt;p class=&quot;article-editor-paragraph&quot;&gt;Now that we&#39;ve started creating the agent, let&#39;s look at what it&#39;s made up of.&lt;/p&gt;
&lt;h3 class=&quot;article-editor-heading&quot;&gt;Name, Id, and Description&lt;/h3&gt;
&lt;p class=&quot;article-editor-paragraph&quot;&gt;&lt;strong&gt;&lt;img src=&quot;/link/16bbe41dad80403d949075df0cb94106.aspx&quot; width=&quot;1135&quot; height=&quot;544&quot; /&gt;&lt;/strong&gt;&lt;/p&gt;
&lt;p class=&quot;article-editor-paragraph&quot;&gt;&lt;strong&gt;Name&lt;/strong&gt; is for you and your team to understand what agent does and find it.&lt;/p&gt;
&lt;p class=&quot;article-editor-paragraph&quot;&gt;&lt;strong&gt;Id&lt;/strong&gt; is how the agent gets invoked &amp;mdash; it&#39;s prefixed with @, so you&#39;d call this one with something like &lt;strong&gt;@answer_readiness_reviewer&lt;/strong&gt;. This Id must be unique, Opal checks that the Id is available and suggests alternatives if it&#39;s taken.&lt;/p&gt;
&lt;p class=&quot;article-editor-paragraph&quot;&gt;&lt;strong&gt;Description&lt;/strong&gt; explains what the agent does and when to use it. It&#39;s a required field. Treat it as documentation for the next person who has to maintain, troubleshoot, or reuse the agent - and this could be a future you who hasn&#39;t looked at it in six months :). A clear description also makes it easier to find the right agent when your library grows and someone needs to choose between several similar ones.&lt;/p&gt;
&lt;h3 class=&quot;article-editor-heading&quot;&gt;Interaction mode&lt;/h3&gt;
&lt;p class=&quot;article-editor-paragraph&quot;&gt;&lt;strong&gt;&lt;img src=&quot;/link/aa9afbc78ff34b0d8bf2d8f47b08fd9f.aspx&quot; width=&quot;424&quot; height=&quot;181&quot; /&gt;&lt;/strong&gt;&lt;/p&gt;
&lt;p class=&quot;article-editor-paragraph&quot;&gt;&lt;strong&gt;Support multi-turn conversation &lt;/strong&gt;is off by default, which means the agent runs in single-shot mode: you provide the inputs, it runs once and returns a final result. There is no back-and-forth. This is the right choice for most specialised agents that handle tasks that are well-defined enough that a single run with clear inputs produces a usable output. It&#39;s also suitable for agents that are going to perform a step in a multi-step workflow. Multi-turn mode keeps the agent active in Opal Chat for continued conversation, which is better suited to tasks where you expect to refine the output through follow-up such as content draft you want to iterate on.&lt;/p&gt;
&lt;p class=&quot;article-editor-paragraph&quot;&gt;&lt;strong&gt;Trigger from Chat&lt;/strong&gt; controls whether people can invoke the agent directly in Opal Chat.&lt;/p&gt;
&lt;h3 class=&quot;article-editor-heading&quot;&gt;Input&lt;/h3&gt;
&lt;p class=&quot;article-editor-paragraph&quot;&gt;&lt;strong&gt;Variables.&lt;/strong&gt; Variables are the inputs the agent collects before it runs, and they&#39;re what make an agent reusable instead of hard-coded. Each variable has a type, a name, a description, and a flag for whether it&#39;s required.&lt;/p&gt;
&lt;p class=&quot;article-editor-paragraph&quot;&gt;In our example we have 2 variables &amp;ndash; URL and Question and both are required.&lt;/p&gt;
&lt;p class=&quot;article-editor-paragraph is-empty&quot;&gt;&lt;img src=&quot;/link/ccb4b8e72cec43898f7848739ecb9edf.aspx&quot; width=&quot;660&quot; height=&quot;207&quot; /&gt;&lt;/p&gt;
&lt;p class=&quot;article-editor-paragraph&quot;&gt;&lt;strong&gt;Tools.&lt;/strong&gt; This is where you give the agent its equipment. You can let Opal predict and add relevant tools automatically or add them manually by selecting from the tools available in your instance.&lt;/p&gt;
&lt;p class=&quot;article-editor-paragraph&quot;&gt;&lt;img src=&quot;/link/a9465742661c4650adb01ba608a46420.aspx&quot; width=&quot;946&quot; height=&quot;214&quot; /&gt;&lt;/p&gt;
&lt;p class=&quot;article-editor-paragraph&quot;&gt;In our example we only need one tool &amp;ndash; &lt;code&gt;browse_web_html&lt;/code&gt;. It will be used to fetch the page so agent can read page content.&lt;/p&gt;
&lt;p class=&quot;article-editor-paragraph&quot;&gt;&lt;strong&gt;Inference level.&lt;/strong&gt; This controls how hard Opal thinks before answering. Higher levels improve quality on complex, multi-step reasoning but take longer to run and cost more (in terms of Opal credits). You match the level to the task. In our example, I will set it to Complex, because deciding whether an answer is explicit, buried, fragmented, or missing is genuine reasoning&amp;nbsp; as the agent has to understand the question, comprehend the page, and judge the relationship between them.&lt;/p&gt;
&lt;p class=&quot;article-editor-paragraph&quot;&gt;&lt;strong&gt;Model Provider.&amp;nbsp;&lt;/strong&gt;As of June 2026, Opal allows selecting between Google Gemini or Antropic Claude as AI model provider for specialised agents.&amp;nbsp;&lt;/p&gt;
&lt;p class=&quot;article-editor-paragraph&quot;&gt;&lt;strong&gt;Files (optional).&lt;/strong&gt; You can attach files the agent should reference every time it runs. This can be used when you have guidelines already documented in a file. Going to keep this empty for our example as all the instructions will be in the prompt.&lt;/p&gt;
&lt;h3 class=&quot;article-editor-heading&quot;&gt;Writing the prompt&lt;/h3&gt;
&lt;p class=&quot;article-editor-paragraph&quot;&gt;The prompt (Opal calls it the &lt;strong&gt;prompt template&lt;/strong&gt;) is the agent&#39;s standing instructions, the brief it follows every single time it runs. This is where most of your effort goes, and what defines how good your agent will be.&lt;/p&gt;
&lt;p class=&quot;article-editor-paragraph&quot;&gt;Optimizely guidance for prompts is very straightforward, and it matches how you&#39;d brief a capable teammate:&lt;/p&gt;
&lt;ul class=&quot;article-editor-bullet-list&quot;&gt;
&lt;li class=&quot;article-editor-list-item&quot;&gt;
&lt;p class=&quot;article-editor-paragraph&quot;&gt;&lt;strong&gt;Write in clear, direct language.&lt;/strong&gt; Say what you want done, not what to &quot;consider.&quot;&lt;/p&gt;
&lt;/li&gt;
&lt;li class=&quot;article-editor-list-item&quot;&gt;
&lt;p class=&quot;article-editor-paragraph&quot;&gt;&lt;strong&gt;Build a clear hierarchy.&lt;/strong&gt; Use headers, bold text, and lists so the structure of the task is obvious.&lt;/p&gt;
&lt;/li&gt;
&lt;li class=&quot;article-editor-list-item&quot;&gt;
&lt;p class=&quot;article-editor-paragraph&quot;&gt;&lt;strong&gt;Break the work into explicit steps.&lt;/strong&gt; Number them. An agent following &quot;Step 1, Step 2, Step 3&quot; is better than unstructured wall of text.&lt;/p&gt;
&lt;/li&gt;
&lt;/ul&gt;
&lt;p class=&quot;article-editor-paragraph&quot;&gt;A few additional prompt-writing techniques that are worth mentioning:&lt;/p&gt;
&lt;ul class=&quot;article-editor-bullet-list&quot;&gt;
&lt;li class=&quot;article-editor-list-item&quot;&gt;
&lt;p class=&quot;article-editor-paragraph&quot;&gt;Reference variables and tools explicitly. In the prompt, variables are written in double square brackets like &lt;code&gt;[[PAGE_URL]]&lt;/code&gt; and &lt;code&gt;[[QUESTION]]&lt;/code&gt;, and tools are written in backticks like &lt;code&gt;browse_web_html&lt;/code&gt;. This is how you wire the prompt to the inputs and equipment you configured in the other sections. &lt;br /&gt;Spelling out when and how to use a tool rather than just making it available produces far more consistent results.&lt;/p&gt;
&lt;/li&gt;
&lt;li class=&quot;article-editor-list-item&quot;&gt;
&lt;p class=&quot;article-editor-paragraph&quot;&gt;&lt;strong&gt;Define what to do when things go wrong.&lt;/strong&gt; A robust prompt tells the agent how to handle not just the happy path, but also negative scenarios and edge cases. &lt;br /&gt;In our example it could be some of these: a page that won&#39;t load (empty or returns an error), a page behind a login, content is presented as picture rather than text, a question that doesn&#39;t really relate to the page at all or a questions that is not a question but a statement.&lt;/p&gt;
&lt;/li&gt;
&lt;/ul&gt;
&lt;p class=&quot;article-editor-paragraph&quot;&gt;If you want to get better at writing these prompts or just needs an inspiration, you can always check out prompts used in the out-of-the-box agents or check the recommendations here: &lt;a class=&quot;article-editor-link article-editor-link&quot; href=&quot;https://support.optimizely.com/hc/en-us/articles/39300056376717-Prompts-for-specialized-agents&quot;&gt;https://support.optimizely.com/hc/en-us/articles/39300056376717-Prompts-for-specialized-agents&lt;/a&gt;&lt;/p&gt;
&lt;p class=&quot;article-editor-paragraph&quot;&gt;And another tip - you can use Opal or your favourite LLM (ChatGPT, Claude) to generate prompt for your agent or improve existing prompt - they are all quite good at writing and can give ideas for some instruction points or directions you didn&#39;t think about. Just make sure to always review the result before you use it.&lt;/p&gt;
&lt;p class=&quot;article-editor-paragraph&quot;&gt;Prompt for our example agent is too big to put here but you can find it at &lt;a class=&quot;article-editor-link article-editor-link&quot; href=&quot;https://gist.github.com/igor-safonov/696c1a07e93e8e4f3aa446cc63348f60&quot;&gt;https://gist.github.com/igor-safonov/696c1a07e93e8e4f3aa446cc63348f60&lt;/a&gt;&lt;/p&gt;
&lt;h3 class=&quot;article-editor-heading&quot;&gt;Output&lt;/h3&gt;
&lt;p class=&quot;article-editor-paragraph&quot;&gt;You select an &lt;strong&gt;Output Data Type&lt;/strong&gt; from a list and you can optionally add a brief &lt;strong&gt;Description&lt;/strong&gt; of what the output is.&lt;/p&gt;
&lt;p class=&quot;article-editor-paragraph&quot;&gt;&lt;img src=&quot;/link/1afe59a09e7c46e88c62a669995a720e.aspx&quot; width=&quot;697&quot; height=&quot;232&quot; /&gt;&lt;/p&gt;
&lt;p class=&quot;article-editor-paragraph&quot;&gt;Two important things to keep in mind:&lt;/p&gt;
&lt;ul class=&quot;article-editor-bullet-list&quot;&gt;
&lt;li class=&quot;article-editor-list-item&quot;&gt;
&lt;p class=&quot;article-editor-paragraph&quot;&gt;&lt;strong&gt;The detailed shape of the output is defined in the prompt, not here.&lt;/strong&gt; Whether the response uses a table, what columns it has, what the four ratings are - all of that lives in your prompt template. The Output section just tells Opal what kind of data the response is and (optionally) describes it at a high level.&lt;/p&gt;
&lt;/li&gt;
&lt;li class=&quot;article-editor-list-item&quot;&gt;
&lt;p class=&quot;article-editor-paragraph&quot;&gt;&lt;strong&gt;What the Description field is for.&lt;/strong&gt; It&#39;s a short, plain-language summary of what the agent returns. It&#39;s most useful when the agent is later used as a step inside a workflow agent, because the next step in the workflow needs to know what shape of result it&#39;s getting. If the agent only ever runs on its own, the description is less critical, but it&#39;s still good documentation for your teammates.&lt;/p&gt;
&lt;/li&gt;
&lt;/ul&gt;
&lt;p class=&quot;article-editor-paragraph&quot;&gt;The choice of data type usually comes down to who or what is going to consume the output. If the result will be passed to another agent or to an automated step in a workflow, &lt;strong&gt;JSON&lt;/strong&gt; is the better choice - it&#39;s structured and machine-readable, and you can pin down the exact shape with an Output Schema. If the result is meant for a person to read and act on, &lt;strong&gt;Text&lt;/strong&gt; is the right choice.&lt;/p&gt;
&lt;p class=&quot;article-editor-paragraph&quot;&gt;In our example, the output is meant for a person, so we&#39;ll set:&lt;/p&gt;
&lt;ul class=&quot;article-editor-bullet-list&quot;&gt;
&lt;li class=&quot;article-editor-list-item&quot;&gt;
&lt;p class=&quot;article-editor-paragraph&quot;&gt;&lt;strong&gt;Output Data Type&lt;/strong&gt;: Text&lt;/p&gt;
&lt;/li&gt;
&lt;li class=&quot;article-editor-list-item&quot;&gt;
&lt;p class=&quot;article-editor-paragraph&quot;&gt;&lt;strong&gt;Description&lt;/strong&gt;: &quot;A markdown response containing the answer-readiness rating (Explicit, Buried, Fragmented, or Missing), evidence from the page that supports the rating, and a short list of concrete suggested improvements. Returns an error template instead if the question is invalid, the page can&#39;t be read, or the question is off-topic for the page.&quot;&lt;/p&gt;
&lt;/li&gt;
&lt;/ul&gt;
&lt;p class=&quot;article-editor-paragraph&quot;&gt;One more practice worth mentioning, even though it isn&#39;t part of the Output section itself: &lt;strong&gt;preferred outputs&lt;/strong&gt;. After you&#39;ve run the agent a few times, you can mark a particularly good result as a &lt;em&gt;preferred output&lt;/em&gt;. Opal can then use it as an example to guide future runs, which helps tune the agent toward the style and quality you want. This is done from the agent&#39;s execution logs after the fact, not configured upfront - so you&#39;ll come back to it once the agent is built and you&#39;ve seen a few real results. More details available at &lt;a class=&quot;article-editor-link article-editor-link&quot; href=&quot;https://support.optimizely.com/hc/en-us/articles/43244850788109-Preferred-output-examples&quot;&gt;https://support.optimizely.com/hc/en-us/articles/43244850788109-Preferred-output-examples&lt;/a&gt;&lt;/p&gt;
&lt;h3 class=&quot;article-editor-heading&quot;&gt;Testing and improving the agent&lt;/h3&gt;
&lt;p class=&quot;article-editor-paragraph&quot;&gt;Building the agent is the first draft, not the finished product. You will then need to do a few rounds of testing and adjustment until you&amp;rsquo;re happy with the result.&lt;/p&gt;
&lt;p class=&quot;article-editor-paragraph&quot;&gt;&lt;strong&gt;Run a test.&lt;/strong&gt; Save the agent and use &lt;strong&gt;Test Run&lt;/strong&gt; to try it with real inputs. For our example, that means a real page URL and a real question &amp;ndash; ideally start with cases where you already know the answer, so you can tell whether the agent got it right.&lt;/p&gt;
&lt;p class=&quot;article-editor-paragraph&quot;&gt;&lt;strong&gt;Build yourself a small set of known cases to test every time you make some big changes to the agent.&lt;/strong&gt; This way you can check if baseline still works well or recent change made things worse.&lt;/p&gt;
&lt;p class=&quot;article-editor-paragraph&quot;&gt;&lt;strong&gt;Look at what the agent did, not just what it returned.&lt;/strong&gt; Opal keeps execution logs that show the steps the agent took and the tools it called. If the result is not what you expected, the log can help you see where it went wrong.&lt;/p&gt;
&lt;p class=&quot;article-editor-paragraph&quot;&gt;&lt;strong&gt;Adjust one thing at a time.&lt;/strong&gt; When something&#39;s off, the fix is usually adjusting the prompt: a rule that wasn&#39;t explicit enough, a step that needed splitting, an edge case you didn&#39;t mention. Change one thing, test it again, compare.&lt;/p&gt;
&lt;p class=&quot;article-editor-paragraph&quot;&gt;Do not forget the settings can play a part too &amp;ndash; if adjusting prompt gets you nowhere, check if inference level as well as output instructions and examples.&lt;/p&gt;
&lt;p class=&quot;article-editor-paragraph&quot;&gt;&lt;strong&gt;Save versions as you go.&lt;/strong&gt; Opal keeps versions of specialised agents, so you can make changes confidently and go back to a previous version anytime.&lt;/p&gt;
&lt;p class=&quot;article-editor-paragraph&quot;&gt;&lt;img src=&quot;/link/36774809d97a4a4ab7845b26e5197665.aspx&quot; width=&quot;855&quot; height=&quot;366&quot; /&gt;&lt;/p&gt;
&lt;p class=&quot;article-editor-paragraph&quot;&gt;Or you can just test it by calling it from Opal chat. Let&#39;s give our example agent a try and see how it goes:&lt;/p&gt;
&lt;p class=&quot;article-editor-paragraph&quot;&gt;&lt;img src=&quot;/link/0503efff9b324830a57ab9a2583afce8.aspx&quot; width=&quot;853&quot; height=&quot;793&quot; /&gt;&lt;/p&gt;
&lt;p class=&quot;article-editor-paragraph&quot;&gt;Looks pretty good to me :)&lt;/p&gt;
&lt;p class=&quot;article-editor-paragraph&quot;&gt;And if you&#39;re worried you&#39;ll consume too many Opal credits with your agent - there is a very simple way to check how many tokens each run consumes - from agent editor go to Logs tab and it&#39;s all there.&lt;/p&gt;
&lt;p class=&quot;article-editor-paragraph&quot;&gt;&lt;img src=&quot;/link/7a75638925da4c3aa379c04553d38074.aspx&quot; width=&quot;1247&quot; height=&quot;463&quot; /&gt;&lt;/p&gt;
&lt;p class=&quot;article-editor-paragraph&quot;&gt;As you see, the amount of credits consumed by our agent is very reasonable which is another reminder that small agents focused on one task are easier to maintain and more cost efficient that complex do-it-all agents.&lt;/p&gt;
&lt;h2 class=&quot;article-editor-heading&quot;&gt;Conclusion&lt;/h2&gt;
&lt;p class=&quot;article-editor-paragraph&quot;&gt;If there&#39;s one thing to take from this, it&#39;s that building an Opal agent is mostly clear thinking written down and knowing some best practices. You define a job, describe it in clear direct language with steps by step instructions, give the agent the inputs and the tools it needs, and then test and tune it until it&#39;s reliable. The Answer Readiness Reviewer we used as example is straightforward under the hood &amp;ndash; two main inputs, one tool, a well-structured but simple prompt. And yet it does something quite useful and something that a generic script cannot do.&lt;/p&gt;
&lt;p class=&quot;article-editor-paragraph&quot;&gt;For now, the best next step is a simple one: open Opal, find the agent closest to something you&#39;d find useful, duplicate it, and start changing it. You learn this far faster by building than by reading.&lt;/p&gt;</id><updated>2026-07-23T14:34:13.0000000Z</updated><summary type="html">Blog post</summary></entry></feed>