Workspaces
Workspace policy controls how workflow tasks overlap in one workspace. Declare the policy on a task or child workflow invocation.
Seqlane starts each ready task when its dependencies and execution policies permit it. It does not serialize tasks by declaration order.
workspace: "exclusive" is the default. An exclusive task waits for other workspace work to finish. Then it runs alone.
workspace: "shared" permits concurrent workspace work. Use it for tasks that can overlap safely.
Choose a policy
Use exclusive as soon as a task can write to the workspace. This includes agents that can edit files and shell tasks that can change repository state.
Use shared only for read-only work that can overlap safely, such as analysis, search, or tests that do not write to the workspace. If you are not certain, use exclusive.
.task("inspect", inspect, ({ input }) => input, {
workspace: "shared",
})
.task("apply", apply, ({ input }) => input, {
workspace: "exclusive",
})Example: workflow and execution order
Workflow
This minimal workflow produces the execution order shown below. Task definitions and schemas are omitted.
const workflow = createFlow({ id: "workspace-order", input, output })
.task("api", reviewApi, ({ input }) => input, { workspace: "shared" })
.task("ui", reviewUi, ({ input }) => input, { workspace: "shared" })
.task("docs", scanDocs, ({ input }) => input, { workspace: "shared" })
.task(
"plan",
plan,
({ tasks }) => ({ api: tasks.api.output, ui: tasks.ui.output }),
{ workspace: "shared" },
)
.task("apply", apply, ({ tasks }) => tasks.plan.output, {
workspace: "exclusive",
})
.task("verify", verify, ({ tasks }) => tasks.apply.output, {
workspace: "shared",
})
.output(({ tasks }) => tasks.verify.output)
.define();Apply has no data dependency on docs. It still waits for Scan docs because it needs exclusive workspace access.
Execution order
The example shows three shared tasks that start together. Plan waits only for its data dependencies. Apply waits for Plan and for active shared workspace work to finish.
When Apply releases the workspace, Verify can start. Other ready shared tasks can also start at that point.
Workspace policy is scheduling policy. It does not grant tool permissions, restrict file access, or make a task read-only. The selected runtime remains responsible for permissions.