workflow package and can be used within workflow and step functions.
Workflow APIs
These functions are available within workflow functions (functions with"use workflow"):
- createHook - Create a hook to receive external data
- createWebhook - Create a webhook to receive HTTP requests
- defineHook - Define a typed hook with validation
- sleep - Pause workflow execution for a duration
- fetch - Make HTTP requests from workflows
- getWorkflowMetadata - Get workflow run metadata
Step APIs
These functions are available within step functions (functions with"use step"):
- getStepMetadata - Get current step metadata
- getWritable - Get a writable stream for the workflow
- getWorkflowMetadata - Get workflow run metadata
Error Handling
Control step retry behavior with error classes:- FatalError - Throw a non-retryable error
- RetryableError - Throw an error with retry configuration
Import Pattern
All APIs are exported from theworkflow package: