In today's fast-paced business environment, automation is no longer a luxury—it's a necessity. But traditional automation often hits a wall. Scripting simple, repetitive tasks is one thing; orchestrating complex, multi-step workflows that require reasoning, data synthesis, and integration across multiple platforms is another. This is where the paradigm shifts from simple automation to true autonomy.
Enter Lexi, your autonomous digital teammate from lexi.do. Lexi isn't just another automation tool; it's an Autonomous AI Agent designed to function as a digital worker. It understands complex instructions, executes sophisticated workflows, and delivers valuable business services as software, all accessible through a simple API.
This guide will walk you, the developer, through the concept of "Business as Code" and show you how to deploy your first autonomous workflow using the lexi.do SDK.
Before we dive into the code, let's clarify what we mean by an Autonomous Agent. Think of Lexi as a new member of your team—one who happens to be a piece of software.
Lexi is an AI-powered agent capable of:
This powerful capability allows you to practice Business as Code: treating complex business operations as simple, declarative function calls within your application.
The best way to understand Lexi's power is to see it in action. Imagine you need to generate a quarterly sales report—a task that typically involves multiple departments, spreadsheets, and hours of manual work. With Lexi, it becomes a few lines of code.
Here’s how you can ask Lexi to perform this complex, multi-step task using the @do/sdk:
import { lexi } from '@do/sdk';
// Ask Lexi to perform a complex, multi-step task
const newReport = await lexi.run({
task: "Generate Q3 sales performance report",
instructions: [
"Analyze sales data from Salesforce CRM",
"Cross-reference with marketing spend from HubSpot",
"Create visualizations for regional performance",
"Summarize key findings and provide recommendations",
"Output the final report as a PDF"
]
});
console.log('Report successfully generated:', newReport.url);
Let's break down what's happening in this powerful snippet.
import { lexi } from '@do/sdk';
This is your entry point. By importing the lexi object from the SDK, you gain access to your Digital Worker directly within your codebase. Integration is designed to be seamless.
await lexi.run({ ... });
This is the core command. The lexi.run() function is where you delegate a job to the agent. It’s an asynchronous call because Lexi might need time to perform complex tasks, so your application can continue its work without being blocked.
task: "Generate Q3 sales performance report"
This is the high-level objective. You're telling Lexi the "what"—the ultimate goal of the workflow.
instructions: [ ... ]
This is the magic. You provide a list of clear, sequential steps that define the "how." Lexi will interpret and execute each one:
console.log('Report successfully generated:', newReport.url);
Once the job is done, Lexi returns a payload. In this case, it's an object containing the URL of the newly generated PDF report. The complex service has been delivered as a simple software artifact.
This reporting example is just the beginning. The power of a Digital Worker lies in its versatility. Any process you can define, Lexi can execute. Consider these other use cases for AI Automation:
Two critical questions for any developer are "How does this fit into my stack?" and "Is it secure?"
Integration: Lexi is built on the API-first principles of the .do platform. The SDK provides a developer-friendly abstraction, but at its core, you are interacting with robust APIs. This means you can trigger and manage Lexi's workflows from your existing applications, microservices, or CI/CD pipelines.
Security: Security is paramount. When Lexi interacts with your company's data, it operates within a secure, sandboxed environment. The .do platform enforces strict data governance, access controls, and encryption, ensuring your sensitive information remains protected throughout the entire workflow.
By treating business logic as code, lexi.do empowers developers to build and deploy incredibly powerful services with unprecedented speed and simplicity. The era of brittle scripts and limited automation tools is giving way to a new generation of intelligent, autonomous agents.
Ready to add a Digital Worker to your team? Explore lexi.do and discover how you can transform your most complex business challenges into a single API call. The future of Workflow Automation is here, and it's autonomous.