484a7699db feat: move a live ai session into a workspace fork with its drafts (#11602)
* feat: move a live ai session into a workspace fork with its drafts

Co-Authored-By: Claude Opus 5.5 (1M context) <noreply@anthropic.com>

* fix: guard session moves against concurrent turns and unsaved edits

Co-Authored-By: Claude Opus 5.5 (1M context) <noreply@anthropic.com>

* fix: harden the draft transfer against bound tokens, key drift and concurrent saves

Co-Authored-By: Claude Opus 5.5 (1M context) <noreply@anthropic.com>

* chore: point ee-repo-ref at the moved_to_fork registration

Co-Authored-By: Claude Opus 5.5 (1M context) <noreply@anthropic.com>

* chore: point ee-repo-ref at the ee branch merged with its matching main

Co-Authored-By: Claude Opus 5.5 (1M context) <noreply@anthropic.com>

* fix: re-copy drafts into a new fork and keep other tabs in step with a move

- A new fork now gets the same transfer as an existing one, with
  replace_existing set only when this move created the fork, so a draft
  saved after the clone reaches the fork and an existing fork's own drafts
  still go through the conflict check.
- The transfer runs the operator composition check on each draft in the
  target workspace, the same check as a direct save there.
- Editors already open on a moved item in the fork reload it from the
  server.
- Other tabs on the session hold their composer during a move and adopt
  the session's new workspace when it ends.

Co-Authored-By: Claude Opus 5.5 (1M context) <noreply@anthropic.com>

* fix: lock the composer during a move and copy only the locked source drafts

- The tab doing a move disables its composer until the move ends, and the
  move checks again for a running turn once a new fork exists.
- Saves still pending in editors open in an existing fork are flushed
  before the transfer, so they surface as conflicts instead of landing on
  the moved draft later.
- The transfer copies, conflict-checks and removes only the source rows it
  locked and validated; a draft saved at a requested key after the lock is
  left out.

Co-Authored-By: Claude Opus 5.5 (1M context) <noreply@anthropic.com>

* fix: keep fork drafts with no source row and re-read the move's drafts on confirm

- replace_existing deletes only the fork drafts the transfer replaces, so a
  draft discarded in the parent after the clone does not take the fork's
  copy with it.
- Confirming a move lists the session's drafts again once no turn can
  start, and sends the user back to the dialog if the list changed.

Co-Authored-By: Claude Opus 5.5 (1M context) <noreply@anthropic.com>

* fix: let a move be retried after its conflicts are resolved

- Move stays enabled while the dialog lists conflicts; confirming re-reads
  them, so a draft discarded in the fork meanwhile no longer blocks it.
- A dialog left open while another tab moved the session closes instead of
  moving from the old workspace.

Co-Authored-By: Claude Opus 5.5 (1M context) <noreply@anthropic.com>

* fix: refuse to confirm a move while a turn runs

A turn started while the move dialog was open owns the cross-tab hold the
move would take, and the move would release it while the turn still runs.

Co-Authored-By: Claude Opus 5.5 (1M context) <noreply@anthropic.com>

* fix: disable moving a session again while a move runs

Co-Authored-By: Claude Opus 5.5 (1M context) <noreply@anthropic.com>

* fix: re-read the session's drafts once a new fork exists

Creating the fork takes seconds, during which an edit in the session's
preview can save a draft in the parent that the move's list did not have.
The move now flushes and lists the drafts again before the transfer, and
reopens the dialog on the created fork when they changed.

Co-Authored-By: Claude Opus 5.5 (1M context) <noreply@anthropic.com>

* fix: keep restricted roles from creating a fork through a session move

The move's fork gate checked only the workspace's forking rule. A role
missing a capability would get the default role in a fork it creates, so
the gate also refuses restricted roles, as the workspace picker does.

Co-Authored-By: Claude Opus 5.5 (1M context) <noreply@anthropic.com>

* fix: hold the session read-only while it moves into a fork

An edit in the session's preview during a move saves a draft in the
workspace being left, after the move listed what it brings, at any of
its awaits. The session now reads as read-only for the whole move, so
the preview shows its items without an editor until the move ends.

Co-Authored-By: Claude Opus 5.5 (1M context) <noreply@anthropic.com>

* fix: close only draft editors during a move, and say why

Variable, resource and trigger editors save on click and write no draft,
so closing them during a move protected nothing and lost a half-filled
form when the move stopped. Only the editors that save drafts close, and
the pipeline tab names the move instead of Use mode.

Co-Authored-By: Claude Opus 5.5 (1M context) <noreply@anthropic.com>

* fix: close variable, resource and trigger editors during a move too

They keep their edits as drafts like the other editors, so an edit during
the move could save one in the workspace being left. Their state lives in
the draft, so closing them loses nothing; they reopen in the fork.

Co-Authored-By: Claude Opus 5.5 (1M context) <noreply@anthropic.com>

* fix: flush every code editor through one registry, and name the move in editor tabs

- Monaco's Editor registers in pendingEditorFlush next to SimpleEditor,
  and the move drains that registry, so SimpleEditor buffers (step input
  expressions, resource and variable JSON fields) also land before it.
  The separate keystroke registry is gone.
- A flow, script or app editor tab closed for a move says it reopens
  once the move ends, instead of showing the parent's viewer.

Co-Authored-By: Claude Opus 5.5 (1M context) <noreply@anthropic.com>

* fix: re-point unresolvable identities in drafts a move copies into a fork

Fork creation re-points an app policy or trigger in a cloned draft that
names nobody in the fork at its creator, since a deploy there rejects an
identity that does not resolve. The transfer copied drafts without that
step, and replace_existing overwrote the clone's repaired copy. The draft
half of the repoint is now shared and runs on the rows a transfer copies.

Co-Authored-By: Claude Opus 5.5 (1M context) <noreply@anthropic.com>

* fix: drop script lineage a fork does not have when copying drafts into it

A script draft kept its base and parent_hash on the grounds that a fork
shares its parent's script hashes. That holds for what the fork cloned,
but not for a version deployed in the parent afterwards, and a deploy in
the fork naming it as parent is refused. The copy now keeps the lineage
only when the target has that version.

Co-Authored-By: Claude Opus 5.5 (1M context) <noreply@anthropic.com>

* test: pin that a transfer keeps script lineage the fork has

Co-Authored-By: Claude Opus 5.5 (1M context) <noreply@anthropic.com>

* fix: drain draft editors before closing them for a move

Closing an editor drops an edit it has not yet handed to its draft save,
so a keystroke typed just before the move could be lost. The editors are
now flushed while still mounted, and closed right after with no await in
between.

Co-Authored-By: Claude Opus 5.5 (1M context) <noreply@anthropic.com>

* fix: hold every turn during a move, and state the repoint's contract

- The chat manager refuses sends, retries and message edits while a move
  runs, from its first step, handing the text back. The composer was
  locked but a retry or an edit could still start a turn in the parent.
- A move into an existing fork checks again for a running turn after
  saving that fork's pending edits.
- repoint_unresolvable_draft_identities documents that it authorizes
  nothing and when its unscoped form may be used.

Co-Authored-By: Claude Opus 5.5 (1M context) <noreply@anthropic.com>

* fix: refuse a move while an editor holds text that is not valid JSON

That text never reaches the draft, and the move closes the editor holding
it. The move now refuses before closing anything, as opening a session
from a page drawer already does.

Co-Authored-By: Claude Opus 5.5 (1M context) <noreply@anthropic.com>

* fix: check for invalid JSON after the editors have parsed what was flushed

The JSON editors parse a flushed buffer in an effect, so the check reads
the registry after a tick, as RunForm and the page drawer already do. The
message says the editor is in the preview.

Co-Authored-By: Claude Opus 5.5 (1M context) <noreply@anthropic.com>

* perf: look script lineage up by key when copying drafts

The lineage check compared a hex rendering of every script hash, which
ruled out the primary key and scanned the target's script versions for
each script draft, fork creation included. It now converts the draft's
16-digit hex to the bigint column, guarded so a malformed value never
reaches the cast.

Co-Authored-By: Claude Opus 5.5 (1M context) <noreply@anthropic.com>

* fix: stop preview input from the move's first step

The editors stay mounted while the move drains them, and a keystroke
typed during that drain was lost when they closed, or left in the parent
of an existing fork. The preview tabs are inert from the move's first
step, so nothing new reaches an editor after the drain starts.

Co-Authored-By: Claude Opus 5.5 (1M context) <noreply@anthropic.com>

* fix: update the local draft markers for drafts a move transfers

The transfer bypasses the syncer that keeps localDraftHints, and lists
prefer a hint over the server's flag, so the parent kept its markers after
"Remove these drafts". The parent's hints are cleared for removed drafts
and the fork's set for copied ones.

Co-Authored-By: Claude Opus 5.5 (1M context) <noreply@anthropic.com>

* feat: move a session to any workspace of its family

A session could only move into a direct fork of its workspace. The picker
now lists the whole family and lets a new fork be based on any of its
workspaces, and /drafts/transfer accepts any target with the same root.
A fork the move creates from elsewhere holds that base's drafts, so its
drafts are never replaced.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>

* fix: gate fork creation in the move picker on the fork capability

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>

* fix: refuse to move a pipeline draft based on a version the target lacks

A pipeline node deploys with its script hash as parent_hash, so a move to a
workspace without that version left a draft whose Deploy all fails there.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>

* fix: check the move's token against the target by re-authenticating it

The transfer endpoint looked the caller's token up in the `token` table, so
an external-JWT login, which has no row there, could never move a session.
It now resolves the same token against the target workspace, which refuses a
token bound to the source whatever its kind, and still refuses job tokens.

Also stop calling the move target a fork in the model note, the menu item,
the editor placeholders and the moving notices: it can be the root or a
sibling.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>

* fix: check a move's writes with the rights its token carries in the target

The transfer re-authenticated the token against the target but then checked
writes with the user's database membership there, so a JWT whose claims are
narrower than that membership could copy a draft to a path it cannot save to
directly. The identity the re-authentication returns is now the one the
checks and the copy use.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>

* fix: keep an unsent session out of the move after main's session refactor

An unsent session holds its workspace in `pending_workspace_id`, which
`createSession` rewrites when it reuses the blank session; moving it set
`workspace_id`, so a later new session from the old workspace acted on the
fork. The move menu item is hidden until the session has a `workspace_id`.

The transfer test's JWT claims also set main's new `mcp_client` field.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>

* fix: move the drafts a session's user edited by hand

The move's draft list read only the chats' `modifiedItems`, so a draft the
user edited in a session tab, which main now records in `sessionHandEdits`
and the Changes bar counts, stayed behind in the workspace left.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>

* fix: keep raw app edits and report draft races on session move

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>

* feat: offer to move the session when switching fork in the breadcrumb

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>

* fix: pass the optional don't move handler through onClick

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>

* chore: update ee-repo-ref to 3ad072124c3682e282829dd7213e42a6e28cf1fa

This commit updates the EE repository reference after PR #856 was merged in windmill-ee-private.

Previous ee-repo-ref: 90af10fe72bfcb981abaa119239a63d085030215

New ee-repo-ref: 3ad072124c3682e282829dd7213e42a6e28cf1fa

Automated by sync-ee-ref workflow.

---------

Co-authored-by: Claude Opus 5.5 (1M context) <noreply@anthropic.com>
Co-authored-by: Ruben Fiszel <ruben@windmill.dev>
Co-authored-by: windmill-internal-app[bot] <windmill-internal-app[bot]@users.noreply.github.com>
2026-11-11 16:55:42 +01:00
2024-02-08 16:09:11 +01:00
2026-11-11 12:40:51 +01:00
2026-11-11 12:40:51 +01:00
2023-08-26 09:17:07 +02:00
2026-08-19 14:18:37 +00:00
2025-04-21 16:53:23 +02:00
2026-04-16 06:26:25 -07:00
2025-12-08 10:34:16 +00:00
2022-05-05 04:25:58 +02:00
2024-02-08 16:09:11 +01:00

windmill.dev

Open-source, self-hostable code-first platform for workflows, apps and AI agents, running on the fastest self-hostable orchestrator. Engineers write code in 20+ languages and sync it with Git. Business teams build on the same platform with AI, while review, promotion between environments and isolated workers keep engineers in control of what ships. Self-hostable alternative to Lovable, Retool, n8n and a simplified Temporal.

Scripts are turned into sharable UIs, APIs and cron jobs automatically, and can be composed together into flows, data pipelines, AI agents or full-code React and Svelte apps. Supported languages: Python, TypeScript, Go, Bash, SQL, GraphQL, PowerShell, Rust, and more.

Package version Docker Image CI Package version

Commit activity Discord Shield

Try it - Website - Docs - Discord - Hub - Contributing

Windmill - Code-first platform for workflows, apps and AI agents

Windmill is fully open-sourced (AGPLv3) and Windmill Labs offers dedicated instances and commercial support and licenses.

Windmill Diagram

https://github.com/user-attachments/assets/d80de1d9-64de-4d89-aacd-6df23fa81fc4

Build with AI, ship with review

Business teams and engineers build on the same Windmill instance. What the AI builds is an ordinary script, flow or app, and goes through the same review as code written by engineers:

  • AI sessions build scripts, flows and apps with AI in a workspace fork, with a live preview and a diff to review before deploying.
  • Workspace roles decide what each team can author, and folders scope the resources, skills and MCP servers its AI can reach.
  • Protection rulesets block direct deployment, so changes reach production only after an engineer reviews and deploys them.
  • Dev workspaces keep their own credentials, and promote to prod through Compare & Deploy or a Git pull request.
  • Worker groups run AI-built code on its own workers, or on a separate instance.

See let business teams build with AI safely for the full setup. Engineers keep writing code locally with the CLI, the VS Code extension and their coding agent, synced with Git.

Main Concepts

  1. Define a minimal and generic script in Python, TypeScript, Go or Bash that solves a specific task. The code can be defined in the provided Web IDE or synchronized with your own GitHub repo (e.g. through VS Code extension): provided Web IDE or synchronized with your own GitHub repo (e.g. through VS Code extension):

Step 1

  1. Your scripts parameters are automatically parsed and generate a frontend.

Step 2

Step 3

  1. Make it flow! You can chain your scripts or scripts made by the community shared on WindmillHub.

Step 3

  1. Build complex UIs on top of your scripts and flows.

Step 4

Scripts and flows can be triggered by schedules, webhooks, HTTP routes, Kafka, WebSockets, emails, and more.

Build your entire infra on top of Windmill!

What the code looks like

A script is a plain function. Its typed arguments become a generated form, an HTTP endpoint and a CLI command:

import * as wmill from "windmill-client";
import dayjs from "dayjs"; // any npm package, resolved and pinned automatically

export async function main(
  customerId: string,
  plan: "starter" | "pro", // a union of strings becomes a dropdown
  trialDays = 14 // defaults infer the type
) {
  const trialEnd = dayjs().add(trialDays, "day").toISOString();

  // a data table: the workspace's Postgres, queried without a connection string
  const sql = wmill.datatable();
  await sql`INSERT INTO trials (customer_id, plan, trial_end) VALUES (${customerId}, ${plan}, ${trialEnd})`.fetch();

  // secrets are permissioned by path
  const slackToken = await wmill.getVariable("f/sales/slack_token");
  await fetch("https://slack.com/api/chat.postMessage", {
    method: "POST",
    headers: { Authorization: `Bearer ${slackToken}`, "Content-Type": "application/json" },
    body: JSON.stringify({ channel: "#sales", text: `New ${plan} trial: ${customerId}` }),
  });

  console.log(`Trial started for ${customerId}`); // logs stream live in the UI
  return { customerId, plan, trialEnd }; // returned as JSON
}

Workflows are code too. Each task runs as its own job with its own logs, and waiting for an approval releases the worker:

import { task, waitForApproval, workflow } from "windmill-client";

async function plan(env: string) {
  return { env, changes: 3 };
}

async function apply(plan: { env: string; changes: number }) {
  return `applied ${plan.changes} changes to ${plan.env}`;
}

export const main = workflow(async (env: string) => {
  const changes = await task(plan)(env);
  const approval = await waitForApproval({ timeout: 3600 });
  if (!approval.approved) {
    return `rejected by ${approval.approver}`;
  }
  return await task(apply)(changes);
});

Flows can also be built in the visual flow editor or as YAML, with scripts like the first one as steps. See workflows as code.

Data: data tables, DuckDB and DuckLake

  • Data tables give each workspace managed Postgres tables, queried with type-checked SQL from TypeScript, Python and DuckDB scripts without exposing a connection string.
  • DuckDB scripts query S3 and Azure Blob files (CSV, Parquet, JSON), data tables, Postgres, MySQL and BigQuery in SQL, on your workers.
  • DuckLake stores large datasets as lakehouse tables in your workspace object storage, queried in plain SQL.
  • Pipelines (alpha) wire scripts by the data they read and write instead of a hand-drawn DAG. This script runs whenever events is materialized, and materializes its own table:
-- pipeline
-- on ducklake://main/events
-- materialize ducklake://main/events_by_kind
ATTACH 'ducklake://main' AS dl;
SELECT kind, count(*) AS n
FROM dl.events
GROUP BY kind;

Existing dbt projects run unmodified as scripts. See the pipelines quickstart.

Develop locally or in the browser

Engineers work from their editor and coding agent, business teams build with AI in the browser, and both land in the same workspace:

Tool Description
CLI Sync a workspace with local files and Git, run scripts and flows from the command line. wmill init generates AGENTS.md and skill files for Claude Code, Cursor and other AI tools
VS Code extension Edit and test scripts and flows from VS Code or Cursor with full IDE support
Git sync Two-way sync between a workspace and your Git repository
MCP server Let coding agents and AI clients run scripts, manage resources and monitor jobs in a workspace
AI sessions The same agent loop in the browser, with nothing to install: plan mode, skills and MCP servers, a live preview, and a diff to review before deploying, in a fork of the workspace

https://github.com/user-attachments/assets/c541c326-e9ae-4602-a09a-1989aaded1e9

You can run scripts locally by passing the right environment variables for the wmill client library to fetch resources and variables from your instance. See local development docs.

Stack

  • Database: Postgres (compatible with Aurora, Cloud SQL, Neon, Azure PostgreSQL)
  • Backend: Rust - stateless API servers and workers pulling jobs from a Postgres queue
  • Frontend: Svelte 5
  • Sandboxing: nsjail and PID namespace isolation
  • Runtimes:
    • TypeScript/JavaScript: Bun (default); Deno only on the windmill-full images
    • Python: python3 with uv for dependency management
    • PHP: only on the windmill-full images
    • Go, Bash, PowerShell, Rust, C#, Java, Ansible

Fastest Self-Hostable Workflow Engine

We have compared Windmill to other self-hostable workflow engines (Airflow, Prefect & Temporal) and Windmill is the most performant solution for both benchmarks: one flow composed of 40 lightweight tasks & one flow composed of 10 long-running tasks.

All methodology & results on our Benchmarks page.

Fastest workflow engine

Security

  • Sandboxing: nsjail for filesystem/resource isolation, and PID namespace isolation (enabled by default) to prevent jobs from accessing worker process memory
  • Secrets: One encryption key per workspace for credentials stored in Windmill's K/V store. We recommend encrypting the Postgres database as well.

See Security documentation for details.

Performance

Once a job started, there is no overhead compared to running the same script on the node with its corresponding runner (Deno/Go/Python/Bash). The added latency from a job being pulled from the queue, started, and then having its result sent back to the database is ~50ms. A typical lightweight deno job will take around 100ms total.

Architecture

Stateless API servers and workers share a PostgreSQL database that holds the job queue and all workspace state (remote agent workers go through the API servers instead). Workers pull jobs by tag, so each worker group can run in its own network, for example dev workers that only reach dev systems and prod workers that only run reviewed code.

Windmill architecture: business teams and engineers build through stateless API servers into workspaces, where changes move from dev and forks to prod after review. PostgreSQL holds the job queue and state. Worker groups for dev and prod, native workers and remote agent workers pull jobs by tag and reach your databases, APIs and AI model providers.

How to self-host

For detailed setup options, see Self-Host documentation.

Docker compose

Deploy Windmill with 3 files (docker-compose.yml, Caddyfile, .env):

curl https://raw.githubusercontent.com/windmill-labs/windmill/main/docker-compose.yml -o docker-compose.yml
curl https://raw.githubusercontent.com/windmill-labs/windmill/main/Caddyfile -o Caddyfile
curl https://raw.githubusercontent.com/windmill-labs/windmill/main/.env -o .env

docker compose up -d

Go to http://localhost - default credentials: admin@windmill.dev / changeme

Using an external database: Set DATABASE_URL in .env to point to your managed Postgres (AWS RDS, GCP Cloud SQL, Azure, Neon, etc.) and set db replicas to 0.

Kubernetes (Helm charts)

helm repo add windmill https://windmill-labs.github.io/windmill-helm-charts/
helm install windmill-chart windmill/windmill --namespace=windmill --create-namespace

See windmill-helm-charts for configuration options.

Cloud providers

Windmill works on AWS (EKS/ECS), GCP, Azure, Ubicloud, Fly.io, Render.com, Hetzner, Digital Ocean, and others. Rule of thumb: 1 worker per 1vCPU and 1-2 GB RAM.

OAuth, SSO & SMTP

Configure OAuth and SSO (Google Workspace, Microsoft/Azure, Okta) directly from the superadmin UI. See documentation.

License

  • Using the Community Edition as is, internally or through its APIs, is free and needs no commercial license, within the limits and quotas set in the software.
  • Selling, reselling or serving the Community Edition as a managed service, modifying or wrapping it, or re-exposing it to your users as a feature of your product (iframed public apps excepted) requires a commercial license: contact sales@windmill.dev.
  • The binary built from this repository without the enterprise feature flag is open source under AGPLv3: the same uses are then allowed under the AGPLv3 terms, or with a commercial license. The API clients and the OpenAPI spec are Apache 2.0.

See LICENSE for the full terms and Pricing for plans.

Integrations

In Windmill, integrations are referred to as resources and resource types. Each Resource has a Resource Type that defines the schema that the resource needs to implement.

On self-hosted instances, you might want to import all the approved resource types from WindmillHub. A setup script will prompt you to have it being synced automatically everyday.

Environment Variables

The variables most deployments set:

Environment Variable name Default Description Api Server/Worker/All
DATABASE_URL The Postgres database url. All
MODE standalone The mode of the binary: standalone, server, worker, agent (EE), indexer (EE image, full-text search), mcp All
WORKER_GROUP default The worker group the worker belongs to and gets its configuration pulled from Worker
BASE_URL http://localhost:8000 The base url that is exposed publicly to access your instance. Is overriden by the instance settings if any. Server
LICENSE_KEY (EE only) None License key checked at startup for the Enterprise Edition of Windmill Worker

All other variables (database pool, queue, runtimes, private registries, certificates, zombie jobs and more) are documented in the environment variables reference.

Contributing

At this time, we are not seeking outside contribution. Bug reports and feature requests remain very welcome, and small, trivially-verified PRs that fix a problem are still accepted. See CONTRIBUTING.md for the full policy.

To run Windmill from source, see frontend/README_DEV.md.

© 2023-2026 Windmill Labs, Inc.

S
Description
Open-source developer platform to power your entire infra and turn scripts into webhooks, workflows and UIs. Fastest workflow engine (13x vs Airflow). Open-source alternative to Retool and Temporal.
Readme
948 MiB
Languages
Rust 36.2%
TypeScript 25.2%
Svelte 23.9%
HTML 11.1%
JavaScript 1.4%
Other 2%