Operator Guide
Deploy, activate, roll back, and operate Workflow Studio from the CLI and operator API
Overview
Workflow Studio CLI provides the operator-facing workflows for deployment lifecycle, run control, and ownership validation.
Use the top-level commands for normal operations. The workflow-studio compute ... subcommands remain available as lower-level packaging and validation helpers.
Recommended operator flows
Deploy and activate the latest build
npx workflow build
npx workflow-studio deploy \
--url "$WORKFLOW_COMPUTE_BASE_URL" \
--api-key "$WORKFLOW_COMPUTE_API_KEY"This command validates the generated workflow bundles, packages .well-known/workflow/v1/{flow.js,step.js,webhook.js} plus manifest metadata, uploads the archive, activates the uploaded deployment, and prints the deploymentId.
Roll back to a previous deployment
npx workflow-studio rollback \
--deployment-id <deploymentId> \
--url "$WORKFLOW_COMPUTE_BASE_URL" \
--api-key "$WORKFLOW_COMPUTE_API_KEY"Rollback is implemented as deployment activation. It switches the active deployment pointer without rebuilding or reuploading artifacts.
Split packaging from upload when needed
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"Worker commands
Validate worker configuration
npx workflow-studio worker check-configExit codes:
0- valid configuration2- valid with warnings1- invalid configuration
Start worker
npx workflow-studio worker startOptional flags:
npx workflow-studio worker start \
--config ./workflow.config.ts \
--port 3001 \
--host 0.0.0.0 \
--require-https trueLower-level deployment artifact commands
These commands expose the individual build, upload, and activation stages.
Build deployment artifact
npx workflow-studio compute buildOutputs the generated deployment ID and manifest path to stdout:
Built artifact: .workflow-studio/dist/artifact.tgz
Deployment ID: dep_abc123...
Manifest: .workflow-studio/tmp/dep_abc123.../manifest.jsonDeploy artifact
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"Activate deployment
npx workflow-studio compute activate \
--deployment-id <deploymentId> \
--url "$WORKFLOW_COMPUTE_BASE_URL" \
--api-key "$WORKFLOW_COMPUTE_API_KEY"Roll back deployment
npx workflow-studio compute rollback \
--deployment-id <deploymentId> \
--url "$WORKFLOW_COMPUTE_BASE_URL" \
--api-key "$WORKFLOW_COMPUTE_API_KEY"Validate remote ownership
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"Optional:
--config ./workflow.config.tsto load typedremoteWorldTargetfrom config.
Checks performed:
- worker health endpoint is reachable
- active deployment exists
Strict validation
npx workflow-studio compute validate-ownership \
--url https://worker.example.com \
--app-url https://app.example.com \
--strictAdditional strict checks:
- app diagnostics endpoint is reachable
- app runtime target world matches expected remote target
- diagnostics ownership status is not
fail
Production diagnostics authentication
npx workflow-studio compute validate-ownership \
--url https://worker.example.com \
--app-url https://app.example.com \
--strict \
--diagnostics-token "$WORKFLOW_STUDIO_DIAGNOSTICS_TOKEN"Common failures
No active deployment
Output includes an active deployment failure.
Action:
- run
workflow-studio rollback --deployment-id <id> ...or callPOST /v1/deployments/:id/activate
Target world mismatch
App runtime target world does not match expected remote target.
Action:
- set
WORKFLOW_TARGET_WORLD=workflow-studio/world-remoteon the application deployment.
Diagnostics endpoint unavailable
App diagnostics endpoint cannot be reached.
Action:
- verify route registration
- verify auth token configuration
- rerun with correct
--app-url
CI usage
- name: Validate Remote Ownership
run: |
npx workflow-studio compute validate-ownership \
--url "$WORKFLOW_COMPUTE_BASE_URL" \
--app-url "$APP_URL" \
--strict
env:
WORKFLOW_COMPUTE_BASE_URL: ${{ secrets.WORKFLOW_COMPUTE_BASE_URL }}
APP_URL: ${{ vars.APP_URL }}Operator API workflows
The worker also exposes API-key-scoped operator endpoints for automation and dashboards.
Deployments
POST /v1/deploymentscreates a deployment from uploaded manifest and artifact data.POST /v1/deployments/:id/activateactivates a deployment.GET /v1/deployments/:idreads deployment metadata.GET /v1/deployments/activereads the active deployment pointer.
Run control
POST /v1/runstriggers a run and requires anIdempotency-Keyheader.POST /v1/runs/:id/cancelcancels a run.POST /v1/runs/resumeresumes a run.POST /v1/runs/:id/rerunre-enqueues the run against the selected deployment.POST /v1/runs/:id/wakeemits validwait_completedevents for matching waits.
Observability
GET /v1/runs/:idGET /v1/runs/:id/stepsGET /v1/runs/:id/hooksGET /v1/steps/:idGET /v1/hooks/:idGET /v1/eventsGET /v1/events/correlation/:id
See Observability for query patterns and resolveData defaults.
Queue behavior in v1
Queue behavior stays intentionally narrow in v1. There is no separate worker-owned queue settings API yet.
Operator queue control happens through run actions:
resumefor paused runs,rerunto enqueue a fresh execution path for an existing run,waketo complete waits that are ready to resume,cancelto stop in-flight work.
The raw POST /v1/queue/publish path exists only for internal world-remote traffic and is not a general public operator API.
Exit codes
worker check-config
0- valid configuration2- valid with warnings1- invalid configuration
compute validate-ownership
0- all checks passed2- warnings only1- hard failure
Typical rollout sequence
npx workflow-studio worker check-confignpx workflow-studio worker startnpx workflow buildnpx workflow-studio deploynpx workflow-studio compute validate-ownership --strict