workflow
Core workflow primitives including steps, context management, streaming, webhooks, and error handling.
Installation
npm i workflowFunctions
Workflow DevKit contains the following functions you can use inside your workflow functions:
getWorkflowMetadata()
A function that returns context about the current workflow execution.
getStepMetadata()
A function that returns context about the current step execution.
sleep()
Sleeping workflows for a specified duration. Deterministic and replay-safe.
fetch()
Make HTTP requests from within a workflow with automatic retry semantics.
createHook()
Create a low-level hook to receive arbitrary payloads from external systems.
defineHook()
Type-safe hook helper for consistent payload types.
createWebhook()
Create a webhook that suspends the workflow until an HTTP request is received.
getWritable()
Access the current workflow run's default stream.
Error Classes
Workflow DevKit includes error classes that can be thrown in a workflow or step to change the error exit strategy of a workflow.