Skip to main content

Tutorial: How to refine and improve your first thunk

Various options and opportunities to iterate, refine, and optimize

Meena avatar
Written by Meena
Updated today

The lifecycle of a thunk typically follows three stages: plan, prototype, and run in production. Now that you've built your first thunk, you have a prototype, and the next step is refining it—testing with representative data to ensure your AI agent automation delivers the intended results before moving to production. Often, you might discover that you want to add new steps to the workflow, and refine the existing steps. You will likely need to collect sample data, and repeatedly run it through the workflow while you tune and refine instructions and options to achieve high-quality results.

AI Governance

Every thunk has customizable controls to fit your team’s automation needs—balancing compliance, human oversight, automation, reliability, and modularity. For example, you can allow AI to complete tasks without approval. Manage these settings in the AI Governance Pane.

While initially iterating and refining your thunk, we recommend adjusting these AI Governance settings:

  • Enable Draft Mode – Prevents your AI from automatically processing new rows, allowing you to process data at your own pace and make refinements as needed.

  • Disable Auto-Complete – Ensures your AI doesn’t finish steps automatically, giving you the opportunity to assess and adjust its outputs.


Modify and test the AI Instructions for each step

It is likely that you may want to test and iterate with a single step, changing the instructions and observing the results.

  • To observe the results, expand the interaction details within the AI chat pane to see how the control sandbox and the AI agent worked to act on your instructions. This is usually informative and helps you understand what actually happened.

  • Based on this, you might choose to manually edit the AI Instructions (the instructions to the AI agent or the various constraints in the sandbox definition).

  • You can re-run a step with the restart icon to reset the state of the workflow request and run the step again with your changed instructions. Note: edits to the AI Instruction modify the thunk definition and therefore apply to all future workflow requests, not just to the one you are working on.

  • If you disabled auto-completion, your AI agent will finish its work on the step and then wait for your input. You could ask it to "repeat" or try out any appropriate ad-hoc instructions that might be appropriate for that step. Ad-hoc chat instructions stay isolated to this specific step instance, making it a good way to experiment before modifying the AI instructions.


One of the main reasons to focus on the AI Instructions is that its what primarily controls the reliability of the AI agent workflow. Please read this article that focuses on how to maximize reliability through a deep understanding of the AI agent execution runtime.

Process Data in Bulk

When you're ready to process data in bulk, use the rocketship icon in your Data Table to kick off multiple draft data entries at once. We recommend using this mode only after refining your step instructions and ensuring your AI delivers consistent results, helping you stay in control of usage and costs. You can find the rocket ship icon in the lower bar when you have Draft data entries in your Data.

Pro Tip: start with a small set of workflow request data in your thunk. Once you're confident in your workflow definition and AI agent accuracy, scale up to check reliability on a larger scale of data.

AI Tools & Libraries

AI tools expand an agent’s capabilities—fetching data or performing actions within a business environment. Tools are grouped into Tool Libraries, which you can enable or disable both at the thunk level and additionally in the individual AI Instructions at each step. You can also create custom tools, integrate with enterprise systems, and share reusable modules across thunks. At this early stage of prototyping, you might just look at the available tools, and they might inspire you to provide different instructions. Also, occasionally, ambiguous instructions might lead the AI agent astray (eg: "search for X" --- should it do a web search or search your file system). In these situations, the ability to disable specific tools will really help your AI agent follow your intent.

Content Folders

Each thunk can define Content Folders to ground AI responses with relevant information—like a folder of product docs for support questions. Collections can include documents, images, videos, and web pages, from small datasets to extensive libraries. If appropriate in your workflow, you might choose to populate the default Content folders with some relevant documents.

Compliance Policies

Each thunk has a dedicated content folder for organizational compliance requirements. For example, in a purchase order workflow, policies on payment terms can be stored here. With Compliance settings enabled in AI Governance > Compliance, your AI will automatically check and enforces these policies, ensuring all actions remain compliant.

User Roles & Work Assignment

Thunk owners can add users using the Team pane. There are three user roles within a thunk:

  • Thunk Owner/Designer – Authors the logic of a thunk using natural language.

  • Human agent/participant – Executes assigned workflow steps with AI assistance.

  • End User – Interacts with the thunk by making requests.


Owners can also specify work assignment logic in any step’s instructions and the thunk owner’s AI will utilize it during step assignment. When participants are assigned a step, their AI helps them in its execution.

Modify the main workflow plan

Every thunk has a top-level sequence of workflow steps, and each step is run by AI agents. The top-level workflow itself often has to change after the thunk is initially created. This is completely natural because there are levels of detail in processes that are not obvious at the start, or you might have chosen to initially ignore them to focus on the core important parts of the workflow. For example, it is very common to want to add a step at the end to write results out to a file.

You can always go to the Planning pane of the thunk, and utilize the menu associated with each step to delete it or to add a new step.


A couple of notes of caution though. If you delete a step in the workflow, it is permanently deleted and any workflow requests that ran that step already will also lose their history of that work. You will also find that the AI planning agent is still available for you to interact with, but in a very restricted mode. It does provide the option to "Reset"/"Restart" the planning process. Please be very careful with this option as it is not an incremental change. You will lose all prior data if you decide to completely replan the thunk.

Did this answer your question?