> ## Documentation Index
> Fetch the complete documentation index at: https://mintlify.com/vercel/workflow/llms.txt
> Use this file to discover all available pages before exploring further.

# API Reference Overview

> Complete reference for Workflow DevKit core APIs

The Workflow DevKit provides a set of core APIs for building durable workflows. These APIs are available from the `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](/api-reference/workflow/create-hook) - Create a hook to receive external data
* [createWebhook](/api-reference/workflow/create-webhook) - Create a webhook to receive HTTP requests
* [defineHook](/api-reference/workflow/define-hook) - Define a typed hook with validation
* [sleep](/api-reference/workflow/sleep) - Pause workflow execution for a duration
* [fetch](/api-reference/workflow/fetch) - Make HTTP requests from workflows
* [getWorkflowMetadata](/api-reference/workflow/get-workflow-metadata) - Get workflow run metadata

## Step APIs

These functions are available within step functions (functions with `"use step"`):

* [getStepMetadata](/api-reference/workflow/get-step-metadata) - Get current step metadata
* [getWritable](/api-reference/workflow/get-writable) - Get a writable stream for the workflow
* [getWorkflowMetadata](/api-reference/workflow/get-workflow-metadata) - Get workflow run metadata

## Error Handling

Control step retry behavior with error classes:

* [FatalError](/api-reference/workflow/fatal-error) - Throw a non-retryable error
* [RetryableError](/api-reference/workflow/retryable-error) - Throw an error with retry configuration

## Import Pattern

All APIs are exported from the `workflow` package:

```typescript theme={null}
import {
  createHook,
  createWebhook,
  defineHook,
  sleep,
  fetch,
  getStepMetadata,
  getWorkflowMetadata,
  getWritable,
  FatalError,
  RetryableError,
} from 'workflow';
```


This documentation is built and hosted on [Mintlify](https://mintlify.com), a developer documentation platform.