Runyard Docs
Concepts

Workflows

The catalog unit of Runyard - versioned definitions with schemas, immutable source bundles, and portable packages.

A workflow is the unit of the Runyard catalog: a named, versioned definition of something an agent can do. Each workflow has a slug, a display name and description, input/output schemas, and a source program that the runner executes. In older code and database tables the same object is called a capability — that is the legacy/internal synonym; user-facing surfaces say workflow.

Definition

A workflow definition carries:

FieldPurpose
slug, name, description, category, keywordsIdentity and catalog discovery (GET /api/workflows?q= searches).
inputSchema / outputSchemaJSON schemas for run input and output. Required input fields drive preflight questions.
requiredRunnerTagsTags a runner must advertise to be assigned a run.
requiredSkills / requiredAgentsReferences into the shared catalog.
approvalPolicyWhether new runs hold for an approval before executing.
workflowSource configuration — most importantly workflow.bundleId, plus options like hooks.allowedProfiles for post-run hooks and secrets for secret delivery.
audienceCatalog visibility: product for normal team abilities, operations for admin/operator runbooks, internal for Hub plumbing.
enabledDisabled workflows disappear from the catalog for non-admins and cannot be run.

Default discovery (GET /api/workflows, GET /api/menu, CLI, MCP, and the web catalog) returns only product workflows. Admin-scoped callers can explicitly add operator/internal entries with includeAudience=operations,internal or the matching MCP/CLI includeAudience option. Audience is only a catalog filter; scopes, approvals, secret grants, and workflow.adminOnly still enforce authorization.

Workflow source is data, not files

Workflow source is created and edited through the API/MCP (create_workflow / update_workflow with inline source bytes) or by importing a workflow package. You never write workflow files to disk on the Hub or runner: custom workflows must carry source bytes or reference an existing workflow.bundleId — bare workflow.entry file paths are rejected.

DB-backed workflow bundles

Published source lives in the Hub database as workflow bundles: immutable, hash-addressed rows in the workflow_bundles table. Publishing is insert-only — every publish creates a new (workflow slug, version) row with a sha256 of the source, so a bundle id permanently names the exact bytes that were published. Bundles are capped at 500 KB, listing never returns source bytes, and a workflow that references a missing bundle fails preflight rather than silently falling back to a file.

# List bundle versions for one workflow (metadata only, never source bytes)
curl -H "Authorization: Bearer $RUNYARD_TOKEN" \
  "https://hub.example.com/api/workflow-bundles?workflow=idea-to-product"

# Fetch one bundle including its source code
curl -H "Authorization: Bearer $RUNYARD_TOKEN" \
  https://hub.example.com/api/workflow-bundles/wfb_abc123

Prefer create_workflow / update_workflow with inline source — they publish a bundle for you and point the workflow at it.

Versioning

Updating a workflow bumps its integer version and snapshots the previous definition. GET /api/workflows/{name}/versions lists the versions observed on past runs, and every run records the workflowVersion it executed. Bundle versions count separately, per publish.

Workflow packages

A workflow package is a portable .runyard-workflow.json file for moving a workflow between Hubs. Exports contain source bytes, metadata, requirements, and content/workflow hashes — never secret values. Imports publish the source as a new immutable bundle and create the workflow disabled by default, so an admin can configure and preflight it locally before enabling it. validate and preview let you check a package without writing anything.

Enabled and disabled

DELETE /api/workflows/{id} disables a workflow rather than erasing it: historical runs stay intact, non-admins get a 404, and preflight blocks new runs until an admin re-enables it with PATCH /api/workflows/{id}.

API & MCP

EndpointMCP toolNotes
GET /api/workflowslist_workflows, search_workflows?q= searches; admins may add includeAudience=operations,internal.
POST /api/workflowscreate_workflowAdmin. Inline source or workflow.bundleId.
GET /api/workflows/{id}describe_workflowDefinition and input schema.
PATCH /api/workflows/{id}update_workflowAdmin.
DELETE /api/workflows/{id}delete_workflowAdmin; disables.
GET /api/workflows/{id}/sourceget_workflow_sourceSource, metadata, sections, graph.
GET /api/workflows/{name}/versionslist_workflow_versionsVersions seen on runs.
GET /api/workflow-bundleslist_workflow_bundlesMetadata only.
GET /api/workflow-bundles/{id}get_workflow_bundleIncludes source.
POST /api/workflow-bundlespublish_workflow_bundleAdmin.
GET /api/workflow-packages/workflows/{id}/exportexport_workflow_packageAdmin.
POST /api/workflow-packages/validatevalidate_workflow_packageAdmin.
POST /api/workflow-packages/previewpreview_workflow_importAdmin; nothing written.
POST /api/workflow-packages/importimport_workflow_packageAdmin; imports disabled.

Running a workflow (POST /api/workflows/{id}/run, run_workflow) and preflighting it are covered on the Runs page.

On this page