Modern business isn't a monolith. It's a dynamic ecosystem of specialized tools: a CRM for customer data, a communication platform like Slack, an email marketing service, internal databases, and countless third-party APIs. The true power of automation lies in making these disparate services talk to each other. But how do you build these connections in a way that's reliable, scalable, and easy to manage?
The answer is to think small. On the .do platform, we call it the Atomic Action—the fundamental building block of every powerful Agentic Workflow. These single, self-contained tasks are the perfect bridge between your workflow logic and the vast world of external services.
Before we dive into integration, let's recap. An atomic action is the smallest, indivisible unit of work in a workflow. Think of it as a specialized, programmable tool designed to do one thing exceptionally well.
Actions are the individual steps, while workflows are the orchestration of these steps. You build complex automations by composing simple, reusable actions together, just like building a complex structure from simple Lego bricks.
Connecting to an external API or service often involves boilerplate code, credential management, and specific endpoint logic. Encapsulating this complexity within an atomic action offers several powerful advantages.
An action hides the messy details of an API call. Your workflow doesn't need to know about REST vs. GraphQL, authorization headers, or specific API endpoint URLs. It simply needs to execute a clearly named action like create-jira-ticket with the required inputs. This separation of concerns makes your workflows cleaner and easier to understand.
Imagine you've written the logic to add a new lead to your CRM. By defining this as an atomic action, create-salesforce-lead, you can now use it anywhere. Trigger it from a "new user signup" workflow, a "contact form submission" workflow, or a "trade show follow-up" workflow without ever rewriting the integration code.
Because each action is an isolated unit, you can test it independently. Is your connection to the email service failing? You know exactly which action to debug, rather than hunting through a monolithic script. This modularity makes your entire automation suite more robust and easier to maintain.
Let's see this in action—literally. Here’s how you would define a reusable atomic action on the .do platform to connect to an email service and send a welcome message.
import { Action } from '@do-co/agent';
// Define a new atomic action to send a welcome email
const sendWelcomeEmail = new Action('send-welcome-email', {
title: 'Send Welcome Email',
description: 'Sends a standardized welcome email to a new user.',
input: {
to: { type: 'string', required: true },
name: { type: 'string', required: true },
},
async handler({ to, name }) {
console.log(`Sending email to ${to}...`);
// Actual email sending logic (e.g., using an SMTP service) would go here
// const emailClient = new EmailService(process.env.EMAIL_API_KEY);
// await emailClient.send({ to, subject: 'Welcome!', body: `...` });
const message = `Welcome to the platform, ${name}!`;
console.log(message);
return { success: true, messageId: `msg_${Date.now()}` };
},
});
// Execute the action with specific inputs
const result = await sendWelcomeEmail.run({
to: 'new.user@example.com',
name: 'Alex',
});
console.log(result);
Let's break this down:
The same pattern applies to virtually any external service you can imagine. By transforming your business operations into a library of custom actions, you create programmable building blocks for any workflow.
Consider creating actions for:
Each of these represents a discrete, repeatable business task. By defining them as atomic actions, you empower your agentic workflows to execute, automate, and scale your operations with unprecedented flexibility and power.
Ready to build your first integration? Explore the .do platform and start turning your external service calls into powerful, reusable atomic actions today.