@candoa/workflows
Version:
Type-safe workflow SDK for Candoa with Copilot-friendly syntax. Define chat workflows with triggers, actions, and type safety.
11 lines (9 loc) • 366 B
text/typescript
import { workflow, collectFirstName, saveToContact } from '@candoa/workflows'
export default workflow('welcome-new-user', {
description: "Collects the user's first name when they start a chat",
})
.on('chat.started')
.use(
collectFirstName({ prompt: "Hi! What's your first name?" }),
saveToContact({ field: 'firstName', value: '{{firstName}}' }),
)