shiftlabs Start free
Menu Releases

Releases

Stage a new version of each workflow, then make them all current in one step, with any agents and schedules. Everything named moves, or nothing does.

Stage, then release

A release makes new versions of several workflows, and agents, current at once. Deploy each workflow with ?stage=1 first, then name the versions in one release.

shellcurl
# Stage each workflow (developer key).
# Answers {"versionHash", "staged": true, "warnings"}.
# Runs keep starting on the current version.
curl -X PUT "https://api.shiftlabs.org/v1/workflows/refund-check?stage=1" \
  -H "authorization: Bearer $SHIFTLABS_API_KEY" \
  --data-binary @refund-check.ts

curl -X PUT "https://api.shiftlabs.org/v1/workflows/refund-notify?stage=1" \
  -H "authorization: Bearer $SHIFTLABS_API_KEY" \
  --data-binary @refund-notify.ts

# Make both current together. Answers 201 {"release", "changed", "warnings", "unnamed"}.
curl -X POST https://api.shiftlabs.org/v1/releases \
  -H "authorization: Bearer $SHIFTLABS_API_KEY" \
  -H "content-type: application/json" \
  -d '{
    "workflows": {
      "refund-check": "<versionHash>",
      "refund-notify": "<versionHash>"
    }
  }'

A staged deploy is checked like any deploy: the scan, package builds (Python's and npm's) and your quotas all apply. The version is stored. Webhooks and manual runs keep starting on the current one until a release names it.

A deploy with new Python packages or npm packages answers 202 with a deployId. When GET /v1/deploys/:id shows live, the version is stored, still staged, and result.versionHash is the hash to release. A staged version of a workflow that has never been current can be dropped after a day. Release it before then.

What a release changes

Everything is checked before anything changes. A release that is refused changes nothing.

  • The body

    {"workflows": {"name": "versionHash"}} names up to 50 workflows, each with the full 64-character versionHash of one of its stored versions. A hash that isn't a stored version of that workflow returns 409 with the workflow's name. "agents" can name agents beside them, and "schedules" replaces the workspace's schedules. A release names at least one workflow or agent, or sends schedules.

  • All or nothing

    Every workflow, agent and schedule named moves in one step, or none does.

  • Runs

    Webhooks and manual runs start on the new versions from then on. Runs already queued or sleeping finish on the version they started on.

  • New workflows

    A workflow that has never been current needs a free workflow slot, to be staged and again to be released. Over your quota, the release returns 403 {"error": "quota exceeded", "limit": "workflows", "max"}.

  • Nothing to change

    If every workflow and agent named is already current as named, and the schedules sent are the ones in place, no release is recorded and the response is 200 {"release": null, "changed", "current", "warnings", "unnamed"}. A CI job can send the same release on every push. current is the release that already has them, if one of the last 20 does.

  • Nothing deleted

    A workflow or agent the release doesn't name stays as it is. The response's unnamed lists them. Delete a workflow on the dashboard's Workflows screen or with DELETE /v1/workflows/:workflow. Delete an agent on its page on the dashboard's Agents screen or with DELETE /v1/agents/:agent.

  • One workflow

    A deploy without ?stage=1 and POST /v1/workflows/:workflow/rollback still change one workflow at once. They aren't releases and don't appear in the history.

Agents in a release

A release can name agents beside workflows, each with its full definition. shiftlabs deploy and a template's Deploy make such releases.

shellcurl
# Developer key. Answers 201 {"release", "changed", "warnings", "unnamed"}.
curl -X POST https://api.shiftlabs.org/v1/releases \
  -H "authorization: Bearer $SHIFTLABS_API_KEY" \
  -H "content-type: application/json" \
  -d '{
    "workflows": {"lookup-invoice": "<versionHash>"},
    "agents": {"billing": {
      "title": "Billing assistant",
      "instructions": "Answer questions about invoices. Look them up first.",
      "model": "@cf/zai-org/glm-4.7-flash",
      "tools": [{
        "workflow": "lookup-invoice",
        "description": "Look up an invoice by its id.",
        "approval": "never"
      }]
    }}
  }'
  • An agent whose definition matches its current version keeps that version. A new or changed one gets the next version number.
  • Each workflow tool must name a workflow that exists once the release is in, deployed before or named in the same release. Otherwise the release returns 409.
  • Each workflow tool in a new definition must set approval. One without returns 400 {"error": "invalid release", "detail"}, naming the agent and the tool. A rollback makes the versions it names current as they were stored.
  • Naming agents needs agents turned on (400 otherwise), the agent.deploy capability and models your plan includes (403 {"error": "plan", "detail"}).
  • An agent whose model or fallback Workers AI retires within 30 days is released, with a sentence for each in the response's warnings. One naming a retired model returns 400, or 409 for a rollback.
  • A new agent needs a free agent slot. Over your quota, the release returns 403 {"error": "quota exceeded", "limit": "agents", "max"}.
  • A release, rollback or promotion that names an agent in the trash returns 409 with the item in trash.
  • Rolling back a release makes its agent versions current again. One whose fallback is of a lower tier than its model, possible for a version deployed before that rule, can't be: the rollback returns 409.
  • Rolling back to a release holding an agent named shiftlabs or shiftlabs-draft, which a release made before those names were reserved can, returns 400 with the text its deploy gets, and changes nothing.

Schedules in a release

"schedules" maps each schedule's name to its definition, and replaces every schedule the workspace has. Leave it out and the schedules stay as they are; send {} to remove them all. shiftlabs deploy sends the project's schedules, and the dashboard's Schedules screen sends the whole set with each edit.

shellcurl
# Developer key. Answers 201 {"release", "changed", "warnings", "unnamed"}.
curl -X POST https://api.shiftlabs.org/v1/releases \
  -H "authorization: Bearer $SHIFTLABS_API_KEY" \
  -H "content-type: application/json" \
  -d '{
    "schedules": {
      "nightly": {
        "workflow": "sync",
        "cron": "0 3 * * *",
        "timezone": "America/Detroit",
        "payload": {"full": true}
      },
      "monday-summary": {
        "agent": "billing",
        "message": "Summarize the refunds from last week.",
        "cron": "0 9 * * 1"
      }
    }
  }'
  • A workflow schedule is {"workflow", "cron", "timezone"?, "payload"?, "overlap"?, "jitter"?, "catchup"?, "pauseOnFailure"?}; an agent schedule is {"agent", "message", "cron", "timezone"?, "jitter"?, "catchup"?}. timezone defaults to UTC and payload to {}; the options left out keep a schedule working as before. A bad field returns 400 {"error": "invalid release", "detail"}, such as schedules.nightly: cron: minute: 60 is outside 0-59.
  • Only the schedules a release adds, changes or removes are checked. Schedules it leaves as they are never block it, for example after agents were turned off or the workspace moved to a smaller plan. A schedules that changes nothing is ignored.
  • Each added or changed schedule's workflow or agent must exist once the release is in: deployed before, or named in the same release. Otherwise the release returns 409. A workflow schedule's payload must pass that workflow's payload schema (400). It is checked again whenever a release or rollback changes that workflow's version, whether or not it sends schedules.
  • If another release replaces the schedules while one that changes them is being checked, the later one returns 409 and changes nothing. Send it again.
  • Your plan sets how many schedules you can have and how often each can run: 403 {"error": "quota exceeded", "limit": "schedules", "max"} when a release adds more than your plan allows, or 403 {"error": "plan", "detail"} for an added or changed cron that runs too often. See Schedules.
  • An added or changed workflow schedule needs the run.start capability. An agent schedule needs agents turned on (400 otherwise) and the agent.deploy capability. Developers hold both.
  • Rolling back a release puts its schedules back in place of the current ones, their options included. A release made before schedules existed recorded none, so rolling back to it leaves the current schedules as they are. Only a release that recorded {} removes them all.
  • Whether a schedule is paused isn't part of a release. A release or rollback that changes a paused schedule keeps it paused, one that removes it drops the pause, and none pauses or resumes one.

History and rollback

Each release gets the next number, its seq. A rollback releases an earlier release's versions again, as a new release. The dashboard's Releases screen lists the same history, and developers and admins can roll back from a release there.

shellcurl
# The newest releases first, 20 at most.
curl https://api.shiftlabs.org/v1/releases \
  -H "authorization: Bearer $SHIFTLABS_API_KEY"

# Make release 3's versions current again.
# Answers 201 {"release", "changed", "warnings"}, with the new release's seq.
curl -X POST https://api.shiftlabs.org/v1/releases/3/rollback \
  -H "authorization: Bearer $SHIFTLABS_API_KEY"
  • release

    {seq, workflows, agents, schedules, releasedBy, releasedByName, releasedAt, cliVersion, promotedFrom}: its number, each workflow's version hash, each agent's version number, every schedule in place after it (null for a release made before schedules), the email of the person or the id of the API key that released it, that key's name (null for a person), the time in milliseconds since the epoch, the version of the CLI that made it (null when the dashboard, the API or MCP made it), and for a promoted release {workspace, release} of the release it copies (null otherwise).

  • changed.workflows · changed.agents · changed.schedules

    Each {name, from, to} that moved: a version hash for a workflow, a version number for an agent, a definition for a schedule. from is null for one the release made current for the first time, and a schedule's to is null when the release removed it.

  • release: null

    Nothing moved and nothing was recorded. current is the newest release that names the same workflow versions, agent versions and schedules, or null. CI uses it to find the release a commit is in.

  • warnings

    A sentence for each model or fallback that retires within 30 days, of every agent the release names, or for a rollback of each agent whose version it changes. shiftlabs deploy prints them.

  • unnamed

    {workflows, agents}: the names of the workspace's workflows and agents that POST /v1/releases didn't name, which it left as they are. Only names your key can see: it needs workflow.view for workflows and agent.view for agents, and a scoped key lists only its own. A rollback's response has none. shiftlabs deploy prints them.

We keep the last 20 releases and every workflow version they name. Rolling back to a release that names a workflow deleted since returns 409. While the workflow is in the trash, the 409 names the trash, and restoring the workflow makes the rollback work again. Once the trash erases it, its versions are gone with it.

Routes
RouteMethodMinimum role
/v1/releases the newest first; ?limit= from 1 to 20, default 20GETviewer
/v1/releases {"workflows": {"name": "versionHash"}, "agents": {"name": definition}, "schedules"?: {"name": schedule}}, up to 50 workflowsPOSTdeveloper
/v1/releases/:seq one release, or 404 {"error": "release not found"}GETviewer
/v1/releases/:seq/rollback no body; that release's versions and schedules, current again as a new releasePOSTdeveloper
/v1/releases/:seq/promote {"to": "workspace"}; that release, as a new release in a linked workspace, or 202 with the approval request therePOSTadmin, or admin key with release.promote
/v1/releases/:seq/promote ?to=workspace; the newest approval request for that release there, and what became of itGETadmin, or admin key with release.promote
/v1/links this workspace's links, each with workspace, direction, status, since and promotionsGETviewer
/v1/links/:workspace {"direction": "to" | "from"}; adds this workspace's side of a linkPUTadmin, or admin key with workspace.link
/v1/links/:workspace {"promotions": "approve" | "direct"}; the workspace promoted to decides whether promotions wait for its approvalPATCHadmin, or admin key with workspace.link
/v1/links/:workspace removes the link, from either sideDELETEadmin, or admin key with workspace.link
/v1/schedules the current schedules, each with nextAt, lastAt, lastRun, lastConversation and lastError, the options it has, pausedAt, pausedBy, pauseNote, buffered and its latest backfillGETviewer
  • Viewers can list and read releases. Developers and admins release and roll back.
  • A key whose scope names some workflows or agents can release only those. An agent's tools, and the workflow or agent of each schedule the release adds, changes (before and after) or removes, must be among them. It sees and rolls back only releases whose every workflow and agent, and every schedule they changed, it reaches, and gets 403 for any other.
  • Each release is written to the audit log as release, with what changed and, for a rollback, rollbackOf.
  • Staged deploys count like any deploy: toward 20 deploys a minute and the new versions you can add in 24 hours. See Rate limits.

Approve or direct

The workspace promoted to decides how promotions reach it, for each link. An admin there sets it with PATCH /v1/links/:workspace {"promotions": "approve" | "direct"}, or in the dashboard. The promoting workspace sees the setting and can't change it: 409 {"error": "set by the workspace promoted to"}.

  • approve, the default

    Each promotion waits in the target's Approvals until someone there approves it. Admins of the promoting workspace, and its keys that list release.promote, can ask for a promotion, but they can't change the target's code. A key that leaks there fills the target's inbox at worst.

  • direct

    Each promotion applies at once. Anyone who can promote from the other workspace then decides what code the target runs, and that code runs with the target's secrets. Choose it only when the promoting workspace is guarded as well as the target, such as when the same admins run both. The dashboard asks you to confirm and says so.

  • Either way, the target's secrets, vars, connections, members, keys and limits stay its own, and its audit log records every promotion.
  • Switching is recorded in the target's audit log as link_promotions_set, with the new setting and who chose it.

Promote a release

A promotion copies a release to a linked workspace as a new release there. Test a release in acme-staging, then promote that exact release to acme-production.

shellcurl
# An admin key of acme-staging that lists release.promote.
# Answers 201 {"release", "changed", "workspace"}, or 202
# {"status": "waiting for approval", "approval", ...} where acme-production
# approves promotions.
curl -X POST https://api.shiftlabs.org/v1/releases/12/promote \
  -H "authorization: Bearer $SHIFTLABS_API_KEY" \
  -H "content-type: application/json" \
  -d '{"to": "acme-production"}'
  • What it copies

    Each workflow version the release names, byte for byte, so it has the same versionHash in both workspaces. The release's agent definitions with their code, and its schedules, which replace the target's as a rollback does. Each workflow's connections are linked as they are in the source.

  • What stays

    Secrets, vars, connections, API keys, members, limits and audit logs belong to each workspace. Nothing of them is copied.

  • Checks

    The target must have every secret and var the versions read that the source has, with each secret scoped to the workflows that read it, and every connection their workflows are linked to. Otherwise nothing changes and the answer is 409 {"error": "missing names", "workspace", "missing": {"secrets", "vars", "connections", "unscoped"?}, "detail", "hint"}, such as "detail": "acme-production has no secret STRIPE_KEY or connection twilio". unscoped lists {"secret", "workflow"} for a secret the target has but hasn't scoped to that workflow, and the detail says secret STRIPE_KEY is not scoped to workflow refund-check in acme-production. Then the target's plan and quotas apply, as to any release.

  • The new release

    It gets the target's next number and records promotedFrom: {"workspace", "release"}, with "approval" when an approval let it in. Its releasedBy is whoever promoted it.

  • Nothing to change

    When the target already runs those versions and schedules, no release is recorded: 200 {"release": null, "changed", "current"}.

  • Promoting needs the release.promote capability. A signed-in admin holds it. An API key holds it only when an admin lists it in the key's capabilities: for CI, a key with ["release.promote"] alone. Admin keys made without a list, developer keys and keys limited to some workflows or agents can't promote.
  • The link must be active, or the answer is 403 {"error": "not linked"}. A suspended target answers 403 {"error": "workspace suspended"}.
  • Names are read from the code as secrets.NAME, secrets["NAME"], reveal("NAME"), sign("NAME", …), vars.NAME and vars["NAME"], in TypeScript and Python. Names read any other way aren't checked.
  • The target's limits apply as on a deploy: its workflows, agents, schedules and versions per 24 hours, the models its plan includes, and its concurrent runs for a workflow's concurrency.
  • The code is scanned again, as a deploy is (400 {"error": "deploy blocked by the code scan"}). A version on a runtime that takes no new deploys returns 409. Deploy it again, release it, and promote that release.
  • A release holding an agent named shiftlabs or shiftlabs-draft, which a release made before those names were reserved can, returns 400 with the text its deploy gets, and a request for it waiting for approval fails when approved.
  • The source's audit log records release_promote. The target's records the new release, with promotedFrom and who promoted it.
  • On the dashboard's Releases screen, a release's popup has Promote to … for each active link.
  • Deploy from GitHub deploys to staging on every push to main and promotes on a tag.

Promotion approvals

Where the target approves promotions, a promotion is a request in the target's Approvals, beside agents' and workflow runs' requests. Every check runs first, so a request that can't apply is refused at once, as a direct promotion is.

shellcurl
# Answers 202 {"status": "waiting for approval", "approval", "workspace",
# "requestedBy", "expiresAt", "changes", ...}.
curl -X POST https://api.shiftlabs.org/v1/releases/12/promote \
  -H "authorization: Bearer $SHIFTLABS_API_KEY" \
  -H "content-type: application/json" \
  -d '{"to": "acme-production"}'

# The newest request for release 12 there: status waiting for approval,
# approved, applied, denied, expired or failed.
curl "https://api.shiftlabs.org/v1/releases/12/promote?to=acme-production" \
  -H "authorization: Bearer $SHIFTLABS_API_KEY"
  • What approvers see

    The promoting workspace, its release number, who asked, and changes, each with its value there now and after: - Workflows: the version hashes. - Agents: the version in the promoting workspace, with the hashes of its definition and code. - Schedules: when each runs, and what it sends. - Connections: the ones each promoted workflow is linked to.

  • Who approves

    Members and keys of the target with approval.decide that may deploy all of it (workflow.deploy, no scope), in the dashboard, with the API or in Slack. It needs the approvals the target's Settings → Approvals asks for. The request goes out in approval notices like any other.

  • Approved

    Everything is checked again with the target as it is then: the link, its names, its plan and its quotas. Then the release is applied once, with promotedFrom: {"workspace", "release", "approval"}. The request's status becomes applied, with the new release.

  • Not applied

    A denied request, one nobody answered within 72 hours, and one whose checks fail when it's approved apply nothing. The status says denied, expired or failed, with error and detail for a failure.

  • A request is never applied after its link is removed, or removed and added again: it fails with "error": "not linked".
  • Nothing is applied unless it is what was approved: - If the promoting workspace links a promoted workflow to other connections, the request fails with connections changed since the request. - If the target deploys or links something the request would change, it fails with target changed since the request. - Promote again to ask for the changes as they are then.
  • A promotion that changes no workflow, agent or schedule there asks nobody and changes nothing: 200 {"release": null}.
  • Each request counts toward the target's 20 deploys a minute, so another workspace can't bury its Approvals. See Rate limits.
  • Promoting a release that already waits there answers the same request. Once it's answered, promoting again makes a new one.
  • Both audit logs record what became of each request: release and release_promote with the approval, or promotion_denied, promotion_expired or promotion_failed with the reason. Only the target's names who answered it. The promoting workspace sees the status and the note, never who decided. Its changes list only what it sends: each change's to. They leave out the target's current versions, schedules and connections, and the target's schedules the release would remove.
  • shiftlabs promote 12 --to acme-production --wait waits for the answer and exits 7 unless the release is applied. The GitHub Action takes wait: true.