In today's data-driven world, raw information is the new currency. But like any raw material, its true value is only unlocked after it's been refined. For businesses, this refinement process is data enrichment: the art of taking a single piece of information—like an email address—and enhancing it with valuable context, such as a contact's name, company, role, and location.
The problem? Building and maintaining a data enrichment pipeline is notoriously difficult. It often involves patching together multiple third-party APIs, writing fragile "glue code," managing credentials, and handling complex error logic. The result is often a brittle, hard-to-maintain script that lives in a forgotten repository.
But what if you could treat this entire business process as a single, robust, and scalable software component? What if you could define your enrichment logic once and deploy it as a simple, reusable API for your entire organization?
This is the core idea behind Services-as-Software, and with service.do, you can build a powerful data enrichment pipeline in minutes, not weeks.
Traditionally, a data enrichment task meant an engineer had to:
This approach is slow, expensive, and doesn't scale.
The service.do approach transforms the entire workflow. Using our Agentic Workflow Platform, you define the business logic as code, and we handle the rest.
Let's build a service that takes an email address and returns enriched contact and company information. With service.do, this complex orchestration becomes incredibly simple.
Our service, contact-enrichment, will orchestrate other "agents" (like a Clearbit or Hunter agent) to perform the task.
import { Service, type Context } from '@do/sdk';
// Define the input schema: what our service accepts
interface EnrichmentInput {
email: string;
}
// Define the output schema: what our service returns
interface EnrichmentOutput {
fullName: string | null;
companyName: string | null;
companyDomain: string | null;
location: string | null;
status: 'enriched' | 'not_found' | 'failed';
}
// Create a new Service instance with our Business-as-Code logic
export default new Service<EnrichmentInput, EnrichmentOutput>({
name: 'contact-enrichment',
description: 'Enriches a contact email with company and location data.',
async run(input: EnrichmentInput, context: Context): Promise<EnrichmentOutput> {
console.log(`Starting enrichment for: ${input.email}`);
try {
// Step 1: Use an agent to call an external enrichment provider.
// The .do platform handles the agent's API keys, retries, and errors.
const enrichmentData = await context.agents.clearbit.enrich({
email: input.email,
stream: true // Stream logs back to the context
});
// Step 2: If no data is found, return a clean response.
if (!enrichmentData || !enrichmentData.person) {
return { status: 'not_found', ...nullValues };
}
const { person, company } = enrichmentData;
// Step 3: Format the data and return the successful output.
return {
fullName: person.fullName,
companyName: company.name,
companyDomain: company.domain,
location: person.geo?.city || company.geo?.city,
status: 'enriched',
};
} catch (error) {
context.log.error('Enrichment failed', { error });
return { status: 'failed', ...nullValues };
}
},
});
const nullValues = {
fullName: null,
companyName: null,
companyDomain: null,
location: null,
};
In this example:
Once you deploy this file, service.do instantly provides you with a REST API endpoint and an SDK to call this service from anywhere in your stack.
Building your data pipeline as a service.do Service provides immediate, compounding benefits:
Q: What is a 'Service-as-Software'?
A: It's the practice of encapsulating a specific business function or workflow—like 'process a payment' or 'generate a report'—into a self-contained, deployable software component. This service can then be versioned, scaled, and invoked via an API, just like any other piece of software.
Q: How is a .do Service different from a microservice?
A: While similar, .do Services are purpose-built for agentic workflows. They are designed to orchestrate other agents and services to complete complex business tasks. They are defined in simple code (Business-as-Code) and managed entirely by the .do platform, abstracting away infrastructure concerns.
Q: Do I need to manage servers to run my services?
A: No. The .do platform is fully serverless. You simply define your service's logic in code, and we handle the deployment, scaling, security, and execution. You focus on the business value, not the infrastructure.
Stop building brittle data scripts. Start building powerful, scalable Business-as-Code components. Turn your most complex workflows into your company's most valuable assets.
Ready to build your first service? Define, Deploy, and Deliver with service.do.