In the world of software development, we constantly grapple with complexity. We build abstractions, create frameworks, and adopt new paradigms—all in the service of managing that complexity. One of the most fundamental distinctions in how we instruct our machines is the difference between imperative and declarative programming.
For years, automating business operations has been stuck in the imperative world: brittle, hard-to-maintain scripts that detail every single step. But a new paradigm is emerging. By embracing a declarative model through Agentic Workflows, we can build more robust, scalable, and understandable systems.
This isn't just a theoretical shift; it's a practical evolution that platforms like devs.do are turning into a reality for developers.
Think about the last time you had to automate a multi-step business process. Maybe it was a user onboarding sequence, a data processing pipeline, or a code quality check. Your first instinct was likely to write a script—in Python, Bash, or Node.js.
This is the imperative approach: you provide explicit, step-by-step instructions.
While this works, it's fraught with peril. This imperative code defines how to do the task, and the business logic—the what—is lost in a sea of boilerplate, error handling, and low-level commands. This model is:
Now, consider the declarative approach. Instead of detailing the how, you simply describe the what—the desired end state. The underlying system is responsible for figuring out the most effective way to achieve it.
You already use this model every day:
The declarative model is powerful because it abstracts away implementation details, leading to code that is more readable, maintainable, and less prone to bugs.
So, how do we apply this powerful declarative model to complex business operations? The answer lies in Agentic Workflows, the core concept behind the devs.do platform.
An Agentic Workflow is a sequence of tasks executed by specialized, autonomous AI agents. Instead of writing imperative code for each step, you simply declare which agents to use and what data to pass between them. The platform handles the orchestration, error handling, and execution. It's Business-as-Code in its purest form.
Let's look at a concrete example using the devs.do SDK. Imagine you want to create a service that analyzes a git repository for code quality.
Here's the declarative definition of that service, which we call a "Doer":
import { Doer, Client } from '@do-inc/sdk';
// Configure your client with an API key
const client = new Client({ apiKey: 'YOUR_API_KEY' });
// Define a new service (a "Doer")
const codeAnalysisService: Doer = {
name: 'code-analyzer.devs.do',
description: 'Analyzes a git repository for code quality.',
input: {
type: 'object',
properties: {
repoUrl: { type: 'string', description: 'The URL of the git repository.' },
},
},
// Define the agentic workflow
workflow: [
{ agent: 'git.clone', params: { url: '{{input.repoUrl}}' } },
{ agent: 'linter.run', params: { path: './cloned-repo' } },
{ agent: 'security.scan', params: { path: './cloned-repo' } },
],
};
// Deploy your new service to the .do platform
async function deployService() {
const deployedDoer = await client.create(codeAnalysisService);
console.log(`Service deployed successfully at: ${deployedDoer.url}`);
}
deployService();
Look closely at the workflow array. It’s a masterclass in declarative thinking:
Once deployed, this complex workflow becomes a simple, callable API endpoint—a true Service-as-Software.
Treating your operational logic as declarative code isn't just a neat trick; it's a fundamental improvement in how we build and manage software. This approach, central to devs.do, offers massive advantages:
The era of brittle, thousand-line automation scripts is coming to an end. The future belongs to clear, concise, and powerful declarations. By shifting from an imperative mindset to a declarative one with agentic workflows, you're not just writing better code—you're building a better business.
Ready to stop scripting the how and start declaring the what? Get started with devs.do and transform your operations into scalable, manageable code today.