healthCheck

Verify a deployment's workflow infrastructure by sending a message through the queue pipeline.

Performs an end-to-end health check of a deployment's workflow infrastructure by sending a message through the queue pipeline and verifying it is processed by the workflow endpoint. Because it goes through the queue rather than direct HTTP, it works even when the deployment is behind Deployment Protection on Vercel.

import { getWorld, healthCheck } from "workflow/runtime";

const world = await getWorld();
const result = await healthCheck(world);

if (!result.healthy) {
  console.error("Workflow infrastructure unhealthy:", result.error);
}

API signature

Parameters

ParameterTypeDescription
worldWorldThe World instance to send the health check through
endpoint"workflow" | "step"Which endpoint to check
optionsHealthCheckOptions & { namespace?: string }Optional configuration

Where HealthCheckOptions is:

OptionTypeDescription
timeoutnumberMilliseconds to wait for the health check response. Default: 30000.
deploymentIdstringDeployment to target. Falls back to process.env.VERCEL_DEPLOYMENT_ID.

Returns

Returns a Promise<HealthCheckResult>:

PropertyTypeDescription
healthybooleanWhether the endpoint processed the health check message
errorstring | undefinedError message when the check failed
latencyMsnumber | undefinedRound-trip latency when the check succeeded
specVersionnumber | undefinedWorkflow spec version of the responding deployment
workflowCoreVersionstring | undefined@workflow/core version of the responding deployment