In the quest for efficiency, full automation is often hailed as the ultimate goal. We build systems to handle tasks from start to finish, removing manual Clicks and human delays. But what happens when the process requires nuance, judgment, or a level of accountability that a machine can't provide? Full automation isn't always the answer. Sometimes, the most powerful workflow is one that knows when to pause and ask for help.
This is the principle behind Human-in-the-Loop (HITL) automation. It's about creating a partnership between machine efficiency and human intelligence. With the .do Agentic Workflow Platform and our developer-friendly SDKs, you can build sophisticated processes that seamlessly integrate these essential human checkpoints.
Human-in-the-Loop is a model where an automated system intentionally pauses a process to request input, approval, or validation from a person before continuing. Instead of being a roadblock, this intervention becomes a crucial, designed step in the workflow.
Think about it:
In each case, automation handles the repetitive, high-volume work, freeing up human experts to focus on the edge cases, a critical decision, and a high-stakes task that requires their unique judgment.
The .do platform is designed for exactly this kind of flexible, real-world logic. Our agentic workflows aren't just rigid, sequential scripts; they are dynamic processes that can change state, wait for external events, and resume based on new inputs. The .do SDK is your bridge to implementing this in your own applications.
Here’s how a typical HITL workflow looks when built with .do:
Let's imagine you've built a simple UI for a manager to approve a large customer refund. When they click "Approve," your backend receives the request and executes a function like this using our TypeScript SDK:
import { Do } from '@do-platform/sdk';
const doClient = new Do({
apiKey: process.env.DO_API_KEY,
});
// This function would be called by your API endpoint
// after a manager approves a request from your UI.
async function resumeRefundWorkflow(runId: string, managerDecision: 'approved' | 'rejected', comment: string) {
try {
const result = await doClient.workflows.resume({
runId: runId, // The ID of the paused workflow instance
input: {
decision: managerDecision,
managerNotes: comment,
},
});
console.log(`Workflow ${runId} resumed successfully.`);
return result;
} catch (error) {
console.error(`Failed to resume workflow ${runId}:`, error);
}
}
This elegant piece of code connects your human-driven decision directly back into the automated process, blending the best of both worlds.
Stop thinking about automation as an all-or-nothing proposition. The most resilient and intelligent systems are those that know their own limits. By integrating Human-in-the-Loop checkpoints, you build safer, more reliable, and vastly more powerful applications.
Ready to build your first HITL process?
With .do, you have the developer tools to build automation that works for your business, not the other way around.