In modern business, our processes are more complex than ever. A single event, like a new user signing up, can trigger a cascade of necessary actions: qualifying the lead, enriching their data, personalizing an onboarding sequence, and notifying the right team members. Stitching these steps together with custom scripts, brittle third-party connectors, and manual effort is a recipe for unreliable, unscalable chaos.
What if you could capture that entire complex process in a single, reliable, and intelligent service? What if you could deliver that service as code?
This is the promise of Workflows.do. We provide the platform to transform convoluted business processes into robust, event-driven services. With AI agents built-in, you can move beyond simple automation and build workflows that research, reason, and execute with human-like intelligence.
Before we dive into the code, let's clarify a key concept: Agentic Workflows.
Traditional automation is often a simple "if this, then that" sequence. An Agentic Workflow, however, uses AI Agents as active participants in the process. Instead of just executing predefined logic, these agents can be tasked with complex, dynamic goals.
Think of an AI Agent as a specialist you can call on within your code. Need to research a new lead's company and synthesize their recent activity? There's an agent for that. Need to draft a hyper-personalized email based on a user's GitHub profile and professional background? There's an agent for that, too.
Workflows.do empowers you to embed these agents directly into your business logic, creating a powerful fusion of code-based reliability and AI-driven decision-making.
The best way to understand the power of Workflows.do is to see it in action. Let's break down a common and critical business process: new user onboarding.
Here’s how you can transform it into a fully automated, intelligent workflow with a simple Typescript file.
import { AI } from 'workflows.do'
export default AI({
onUserSignup: async ({ ai, api, db, event }) => {
const { name, email, company } = event
// 1. Enrich: Gather data from external sources
const enrichedContact = await api.apollo.search({ name, email, company })
const socialProfiles = await api.peopleDataLabs.findSocialProfiles({ name, email, company })
const githubProfile = socialProfiles.github ? await api.github.profile({ profile: socialProfiles.github }) : undefined
// 2. Research: Use AI Agents for deep analysis
const companyProfile = await ai.researchCompany({ company })
const personalProfile = await ai.researchPersonalBackground({ name, enrichedContact })
const githubActivity = githubProfile ? await ai.summarizeGithubActivity({ githubProfile }) : undefined
// 3. Personalize & Execute: Orchestrate actions across services
const emailSequence = await ai.personalizeEmailSequence({ name, company, personalProfile, companyProfile, githubActivity })
await api.scheduleEmails({ to: email, sequence: emailSequence })
// 4. Summarize & Store: Finalize and notify
const details = { enrichedContact, socialProfiles, githubProfile, companyProfile, personalProfile, githubActivity, emailSequence }
const summary = await ai.summarizeContent({ length: '3 sentences', details })
const { url } = await db.users.create({ name, email, company, summary, ...details })
await api.slack.postMessage({ channel: '#signups', content: { name, email, company, summary, url } })
},
})
Let's walk through what’s happening here.
The entire process kicks off with onUserSignup. This is an event-driven trigger. It could just as easily be a webhook from Stripe (onPaymentSuccess), a CRON schedule (everyFriday), or a direct API call from your application.
The workflow immediately uses the api helper to enrich the initial data. It calls Apollo, PeopleDataLabs, and GitHub to gather a complete picture of the new user—a task that would otherwise be a tedious manual job for a sales or success team.
This is where the magic happens. We hand off the enriched data to our AI Agents using the ai helper.
With a rich, AI-generated context, the workflow doesn't just send a generic "Welcome!" email. It calls ai.personalizeEmailSequence to craft a truly unique onboarding experience tailored to the user's specific profile, company, and even their recent coding activity. The result is then passed to api.scheduleEmails to be automatically delivered.
Finally, the workflow orchestrates the closing steps. It uses another AI agent, ai.summarizeContent, to create a concise summary of everything it discovered and did. This summary, along with all the rich detail, is saved to your database via the db helper. A notification is then posted to Slack, giving your team immediate visibility with a complete, actionable summary.
While workflows are defined in developer-friendly Typescript, their purpose is to create "Services-as-Software" that can be used by the entire organization.
Stop wrestling with brittle scripts and manual processes. With Workflows.do, you can design, deploy, and scale intelligent, AI-powered business processes as easily as writing a function. It's time to deliver your business logic as reliable, event-driven services.
Ready to turn your most complex processes into simple, intelligent code? Explore Workflows.do today!