Automate complex business processes and deliver powerful services-as-software. Lena transforms your operational logic into executable code, seamlessly.
import { Lena } from '@do/sdk';
// Initialize Lena with your API key
const lena = new Lena({ apiKey: 'YOUR_API_KEY' });
// Define and execute a business workflow
async function processNewInvoice(invoiceData: any) {
const result = await lena.run({
task: "Process a new vendor invoice and schedule payment",
data: invoiceData,
instructions: [
"1. Extract invoice number, amount, and due date.",
"2. Verify the vendor exists in our system.",
"3. Schedule a payment for 5 days before the due date.",
"4. Send a confirmation email to [email protected]."
]
});
console.log('Workflow Status:', result.status);
return result;
}
// Example usage with new invoice data
processNewInvoice({
vendorId: "VND_1001",
invoiceUrl: "https://example.com/invoice.pdf"
});