docs/src/course/04-workflows/10-updating-the-workflow.md
Now you'll update your workflow to include all three steps: validate, enhance, and summarize.
Replace your existing workflow with this updated version:
export const contentWorkflow = createWorkflow({
id: 'content-processing-workflow',
description: 'Validates, enhances, and summarizes content',
inputSchema: z.object({
content: z.string(),
type: z.enum(['article', 'blog', 'social']).default('article'),
}),
outputSchema: z.object({
content: z.string(),
type: z.string(),
wordCount: z.number(),
metadata: z.object({
readingTime: z.number(),
difficulty: z.enum(['easy', 'medium', 'hard']),
processedAt: z.string(),
}),
summary: z.string(),
}),
})
.then(validateContentStep)
.then(enhanceContentStep)
.then(generateSummaryStep)
.commit()
summary fieldYou can now test this workflow in the playground to validate it works as expected.
Your workflow now:
Each step builds on the previous one, creating a comprehensive content processing pipeline!
Next, you'll learn about using workflows with agents.