Automation is no longer a futuristic concept; it's a daily reality. We use tools to schedule posts, transcribe meetings, and sort emails. But while automating single tasks saves time, the real transformative power lies in automating entire processes. This is where most platforms fall short. They can handle a single step but struggle to orchestrate the complex, multi-stage workflows that drive your business.
Enter service.do.
We believe in a new paradigm: Services as Software. Any business process, no matter how complex, can be transformed into a programmable, on-demand service. A single service is powerful, but their true potential is unlocked when you chain them together, composing intricate end-to-end workflows from simple, modular building blocks.
Before we chain, let's understand the links. On the service.do platform, a "Service" is a complete business process encapsulated as a programmable API. It's not just a function call; it's an agentic workflow that can perform research, make decisions, and interact with tools to produce a structured result.
Imagine a data-enrichment.service.do. You give it a company domain, and it returns a clean, structured object with the company's logo, description, and employee count.
import { createDo } from '@do-sdk/core';
// Initialize the client
const doClient = createDo({ apiKey: 'YOUR_API_KEY' });
// Get a handle to the service
const dataEnrichment = doClient.get('data-enrichment.service.do');
// Invoke the service to enrich a single company
const enrichedData = await dataEnrichment.run({
companyDomain: 'example.com',
fields: ['logo', 'description', 'employeeCount']
});
console.log(enrichedData);
// { logo: '...', description: '...', employeeCount: 1200 }
This is incredibly useful. But in a real business scenario, enriching data is just the first step.
What happens after you enrich a new lead?
Executing these steps manually is slow and error-prone. Trying to code this with traditional tools can lead to brittle, monolithic scripts. The service.do approach is different. Since every process is just another service, you can chain them together like LEGO bricks.
Let's build that lead qualification workflow by composing several distinct services. The output of one service becomes the input for the next, creating a seamless, automated flow. This is Business as Code in action.
Our workflow starts when a new lead comes in. We use the service from our first example to get the crucial data we need.
Now that we have enriched data, we need to know if this lead is worth pursuing. We'll use a lead-scoring service that has our company's ideal customer profile encoded into its logic.
A "Hot" lead needs to be in the CRM, assigned and ready for action. This service handles the integration.
Finally, we need to get this lead in front of a human. A sales-alert service dispatches the notification. We can even build conditional logic around this step in our code.
Here’s how you would orchestrate this entire end-to-end workflow programmatically. Notice how clear and readable the process becomes when your business logic is encapsulated in named services.
import { createDo } from '@do-sdk/core';
// Initialize and get handles to all the services in our workflow
const doClient = createDo({ apiKey: 'YOUR_API_KEY' });
const enricher = doClient.get('data-enrichment.service.do');
const scorer = doClient.get('lead-scoring.service.do');
const crmUpdater = doClient.get('crm-update.service.do');
const alerter = doClient.get('sales-alert.service.do');
async function processNewLead(leadEmail: string) {
try {
console.log(`[1/4] Enriching lead: ${leadEmail}`);
const enrichedData = await enricher.run({ email: leadEmail });
console.log('[2/4] Scoring lead...');
const scoreResult = await scorer.run({ ...enrichedData });
// Only proceed for high-value leads
if (scoreResult.score === 'Hot') {
console.log('[3/4] Updating CRM for Hot lead...');
const crmResult = await crmUpdater.run({
email: leadEmail,
enrichment: enrichedData,
score: scoreResult.score
});
console.log('[4/4] Sending sales alert...');
await alerter.run({
leadName: enrichedData.company,
crmLink: `https://mycrm.com/contacts/${crmResult.crmId}`,
reason: scoreResult.reason
});
console.log('Lead processed and alerted successfully!');
} else {
console.log(`Lead scored as ${scoreResult.score}. No further action.`);
}
} catch (error) {
console.error('Lead processing workflow failed:', error);
}
}
// Run the entire workflow for a new lead
processNewLead('ceo@bigcorp.com');
Chaining services isn't just a neat trick; it's a fundamentally better way to build and scale your operations.
By defining your operations as a collection of composable API services, you move from brittle scripts to a robust, scalable, and adaptable system. You’re not just automating tasks—you’re turning your entire business into a programmable platform.
Ready to move beyond single-task automation? Define your first service and start composing powerful, end-to-end workflows today.