Callback
A function passed as an argument to another function, called later to perform a specific action or complete a routine.
Imagine you're ordering food online. You place your order, and the website gives you a confirmation number. This confirmation number is like a callback. Later, when your food is ready for pickup, the restaurant might use that number to let you know.
In programming, a callback is similar. It's a piece of code (a function) that you give to another program or function. You tell it, 'When this specific thing happens, run this code for me.' This is useful for handling events, like a button click or when a task is finished, without the main program having to constantly check if it's time to act.
A callback is a function provided as an argument to another function. This outer function is expected to call back (execute) the callback function at a specific time, usually when an asynchronous operation completes or an event occurs. This pattern is fundamental in event-driven programming and asynchronous operations, allowing for non-blocking execution. Callbacks help manage complex workflows and decouple components by defining actions to be taken upon certain triggers.
AI agents are increasingly being designed to interact with external systems and perform actions. Callbacks are a fundamental programming concept that allows these agents to receive notifications or results from these external interactions, enabling more complex and dynamic task execution.
- How voice AI agents control your browserGoogle · Google Cloud Tech on YouTube ·
- Google Gemini
- Google Gemini's work on AI voice agents controlling browsers highlights how callbacks can be used to signal completion or errors from browser actions back to the AI agent.
- Webhooks
- Webhooks are a type of callback, but they are specifically used to sen
- Promises
- Promises are an object representing the eventual completion (or failur
- Event Listeners
- Event listeners are functions that wait for an event to occur a
The concept of callbacks has roots in early programming languages and has been a core part of event-driven and asynchronous programming paradigms for decades. It became particularly prominent with the rise of graphical user interfaces and networked applications.
You can see a simple callback in action by using a timer function in a programming environment like JavaScript. For example, you can tell the computer to wait for 5 seconds and then display a message. The message-displaying code is the callback function that gets executed after the timer event completes.
The Playbook: reusable how-tos, prompts, configs and tips pulled out of the news.
- PromptRole-play a student struggling with math for AI tutor simulationSimulate a student's math struggles and uncertainty for AI tutor evaluation. · 5 min
- TemplateReusable workflow templates for healthcare teamsTeams can create and share templates for common workflows like documentation or prior authorizations. · 15 min
- TemplateTemplate for building an AI tool tailored to your workA structured approach to defining and building a custom AI tool for specific business needs. · 15 min
- TemplateEvals CSV prompt list for agent skillsA CSV file template for listing prompts used in evaluating agent skills. · 20 min
- HeuristicDouble coding agent task completion with docs linksProviding coding agents with a documentation link significantly increases their task completion rate. · 2 min
Questions people ask
- What is the main benefit of using callbacks?
- Callbacks allow programs to remain responsive by handling tasks asynchronously. They prevent the program from freezing while waiting for a long operation to finish.
- Are callbacks only used in AI?
- No, callbacks are a fundamental concept in general software development, used widely in web development, mobile apps, and many other areas where event handling or asynchronous operations are needed.
First seen on Subvolts Oct 7, 2026. Updated Oct 14, 2026. Written by an AI model from the items above and reviewed against them weekly; report an error.

