Deployment

Deploy Worker

Deploy and operate the remote compute worker service

Overview

This guide deploys the remote compute worker service used by Workflow Studio.

A typical production setup has:

  • an application service that receives user requests and calls start(...),
  • a remote compute worker service that executes workflow runs.

Railway deployment

Start command

npx workflow-studio worker start

Health endpoint

  • GET /v1/health

Required worker environment variables

VariableDescription
WORKFLOW_POSTGRES_URLWorld storage connection string when using Postgres world
WORKFLOW_COMPUTE_API_KEYAPI key used in worker.auth.seedApiKeys
PORTWorker listen port provided by platform

Artifact rollout procedure

Your workflow functions are compiled, packaged into a deployment archive, uploaded to the server over HTTP, and activated. Build, deploy, and activate using the CLI Commands reference:

npx workflow build
npx workflow-studio compute build
npx workflow-studio compute deploy \
  --artifact .workflow-studio/dist/artifact.tgz \
  --manifest .workflow-studio/tmp/<deploymentId>/manifest.json \
  --url "$WORKFLOW_COMPUTE_BASE_URL" \
  --api-key "$WORKFLOW_COMPUTE_API_KEY"
npx workflow-studio compute activate \
  --deployment-id <deploymentId> \
  --url "$WORKFLOW_COMPUTE_BASE_URL" \
  --api-key "$WORKFLOW_COMPUTE_API_KEY"

Replace <deploymentId> with the value printed by compute build. See CLI Commands for full flag reference, exit codes, and rollback.

Application-side production reroute

Set this environment variable on the application deployment:

WORKFLOW_TARGET_WORLD=workflow-studio/world-remote

Set worker connectivity variables on the application as well:

  • WORKFLOW_COMPUTE_BASE_URL
  • WORKFLOW_COMPUTE_API_KEY

Expected outcome

After activation and reroute configuration:

  • application routes can keep the existing start(...) pattern,
  • workflow execution traffic is processed by the remote compute worker,
  • worker health and ownership validation checks pass.

Troubleshooting

SymptomLikely causeAction
no_active_deploymentActive deployment pointer not setRun compute activate --deployment-id <id>
Strict remote guard startup failureWORKFLOW_TARGET_WORLD missing or mismatchedSet WORKFLOW_TARGET_WORLD=workflow-studio/world-remote
Ownership status failQueue callback traffic reaches app-host compute routesRoute queue callbacks to worker and run validation again
401/403 from workerAPI key missing/invalid or scope mismatchVerify key and required scopes

Post-deploy validation

Run ownership validation to confirm remote routing:

npx workflow-studio compute validate-ownership \
  --url "$WORKFLOW_COMPUTE_BASE_URL" \
  --api-key "$WORKFLOW_COMPUTE_API_KEY" \
  --strict \
  --app-url "https://your-app.example.com"