In the fast-paced world of modern business, complexity is the new normal. Workflows are no longer linear; they are intricate webs of data processing, multi-system communication, and critical decision-making. While traditional automation can handle simple, repetitive tasks, it often falls short when faced with dynamic, multi-step processes. This is where a new paradigm of automation is needed.
Enter Lena, your autonomous digital worker from .do. Lena isn't just a tool; she's an intelligent agent designed to understand and execute complex business workflows with precision and speed. The key to unlocking her power lies in a single, elegant function: lena.assign().
This post will take a deep dive into this core function, exploring how it turns your business logic into a fully automated service.
Think of lena.assign() as the ultimate delegation command. It's the moment you hand off a complex project to your most capable team member, providing a clear objective and all the necessary resources, confident that it will be executed flawlessly.
At its core, interacting with Lena is as simple as writing a few lines of code. Let's look at the cornerstone of the .do SDK:
import { Do } from '@do-inc/sdk';
const agent = new Do(process.env.DO_API_KEY);
// Assign a complex task to Lena
const task = await agent.lena.assign({
objective: 'Generate a comprehensive quarterly sales report.',
parameters: {
quarter: 'Q3',
year: 2024,
outputFormat: 'pdf',
distributionList: ['ceo@example.com', 'sales-leads@example.com']
}
});
console.log(`Task ${task.id} assigned to Lena. Status: ${task.status}`);
This simple snippet is all it takes to set a powerful agentic workflow in motion. But the true magic lies within the payload you send to Lena. Let's break it down.
The assign function takes a single object with two key properties: objective and parameters.
The objective is a high-level, natural language description of your goal. This is not a rigid command; it's a statement of intent. You're not programming a script; you're communicating with an intelligent agent.
Why this is powerful:
In our example, the objective is 'Generate a comprehensive quarterly sales report.'. Lena understands what "comprehensive" implies—gathering data from multiple sources, calculating key metrics, and presenting it in a digestible format.
Other examples of objectives could be:
If the objective is the "what," the parameters are the "with what" and "how." This object provides the concrete data, context, and constraints Lena needs to execute the task accurately.
In our example:
The parameters object is incredibly versatile. It can contain anything from simple strings and numbers to complex nested objects, API keys (managed securely via the .do platform), or database connection strings. This ensures Lena has everything she needs to perform her job without requiring further intervention.
When you call lena.assign(), you're not just triggering a script. You are initiating an agentic workflow. This is what truly sets Lena apart as an autonomous worker.
Here’s what happens behind the scenes:
The lena.assign() function is more than just a piece of an SDK; it's your direct line to a new level of business automation. It bridges the gap between high-level business goals and low-level technical execution. By simply defining what you want to achieve, you empower an autonomous AI agent to handle the how, no matter how complex.
Stop building brittle scripts and start delegating complex workflows. Free your team from operational overhead and allow them to focus on what humans do best: strategy, creativity, and growth.
Ready to delegate your first task? Get started with Lena and discover the future of business automation.