Skip to Content
Functions.do is released 🎉

Workflows.do  Business-as-Code

We believe that you can define, execute, and iterate on business processes as clean & simple code. It should be simple enough for a non-technical business person to read and work with an AI or technical teammate to build and iterate on workflows.

Overview

The workflows.do SDK provides a simple yet powerful way to define AI-powered workflows with strongly-typed functions. It allows you to:

  • Define event-driven workflows with AI capabilities
  • Create strongly-typed AI function schemas
  • Integrate with external APIs and databases
  • Build complex, multi-step AI processes with full TypeScript support

Features

  • Declarative Workflows: Define complex business processes using a simple, declarative syntax
  • AI Integration: Seamlessly incorporate AI functions into your workflows
  • Event-Driven Architecture: Trigger workflows based on events from various sources
  • Error Handling: Built-in mechanisms for handling errors and exceptions
  • Observability: Monitor and debug workflow execution
  • Scalability: Run workflows at any scale, from simple tasks to enterprise processes
  • Type Safety: Full TypeScript support for reliable development

Installation

npm install workflows.do # or yarn add workflows.do # or pnpm add workflows.do

Usage

import { AI } from 'workflows.do' export default AI({ onUserSignup: async ({ ai, api, db, event }) => { const { name, email, company } = event // Enrich content details with lookup from external data 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({ name, email, company, profile: socialProfiles.github }) : undefined // Using the enriched contact details, do deep research on the company and personal background const companyProfile = await ai.researchCompany({ company }) const personalProfile = await ai.researchPersonalBackground({ name, email, enrichedContact }) const socialActivity = await ai.researchSocialActivity({ name, email, enrichedContact, socialProfiles }) const githubActivity = githubProfile ? await ai.summarizeGithubActivity({ name, email, enrichedContact, githubProfile }) : undefined // Schedule a highly personalized sequence of emails to optimize onboarding and activation const emailSequence = await ai.personalizeEmailSequence({ name, email, company, personalProfile, socialActivity, companyProfile, githubActivity }) await api.scheduleEmails({ emailSequence }) // Summarize everything, save to the database, and post to Slack const details = { enrichedContact, socialProfiles, githubProfile, companyProfile, personalProfile, socialActivity, githubActivity, emailSequence } const summary = await ai.summarizeContent({ length: '3 sentences', name, email, company, ...details }) const { url } = await db.users.create({ name, email, company, summary, ...details }) await api.slack.postMessage({ channel: '#signups', content: { name, email, company, summary, url } }) }, })
Last updated on