Overview
Peter Wielander from Vercel demonstrates how to transform a simple coding agent into a production-ready durable agent using the Workflow DevKit. The core insight is that workflow patterns separate orchestration from execution steps, enabling agents to run reliably in production with built-in durability, observability, and resumability without complex infrastructure setup.
Key Takeaways
- Use workflow patterns to isolate agent steps - separate your orchestration logic from individual tool calls and LLM interactions to enable automatic retry, caching, and fault tolerance
- Add ‘use step’ directives to tool calls - mark functions as steps to run them in isolated serverless instances with automatic input/output caching and retriability
- Leverage built-in sleep and webhook capabilities - workflows can suspend for days/weeks without consuming resources and resume exactly where they left off, perfect for long-running agent tasks
- Design for resumable streams - disconnect and reconnect to agent sessions at any time since streams persist independently of API handlers, enabling true session durability
- Implement human-in-the-loop workflows easily - use webhook steps to pause agent execution and wait for human approval before continuing with full state preservation
Topics Covered
- 0:00 - Introduction to Workflow DevKit: Overview of the workshop goals and the problem of getting local agents to production
- 1:00 - Demo App Overview: Introduction to the coding agent example from Vercel’s repository
- 3:30 - Workflow Pattern Explanation: Core concepts of orchestration layer vs execution steps
- 5:00 - Code Walkthrough: Examining the existing agent implementation and tool structure
- 9:30 - Installing Workflow DevKit: Adding the library and configuring Next.js compilation
- 11:00 - Creating Workflow Function: Refactoring agent code into a workflow with ‘use workflow’ directive
- 15:30 - Adding Step Directives: Marking tool calls as steps with ‘use step’ for isolation and caching
- 17:30 - Observability UI Demo: Using workflow web UI to inspect runs, steps, and execution flow
- 19:30 - Stream Integration: Connecting tool outputs to streams for real-time UI updates
- 24:00 - Resumable Streams Implementation: Building session resumability with workflow IDs and stream reconnection
- 28:00 - Sleep and Suspension: Using sleep functionality for long-running workflows and cron-like behavior
- 32:00 - Sleep Tool Implementation: Creating a sleep tool for agent-controlled workflow suspension
- 37:30 - Webhook Integration: Human-in-the-loop workflows with webhook suspension and approval
- 43:00 - Q&A Session: Audience questions covering deployment, concurrency, versioning, and advanced features