Versioned Workflow Definitions
A Workflow Definition is a versioned graph for repeatable autonomous work. It names exact capability versions and may carry versioned secret or connection references. Saving a draft does not execute anything.
Use the lifecycle in this order:
- create a draft;
- edit it with revision compare-and-swap;
- run a dry-run, which resolves the exact references without executing nodes;
- publish that exact revision.
Published versions are immutable. To change a published workflow, create a new semantic version. This keeps review records, audit evidence, and external authoring clients bound to the definition they reviewed. You can review the published graph in Workflow Builder. A single-step readiness workflow can run on a qualified Company runner and open a Test Plan report.
Build it in the UI
Open Workflow builder in the sidebar. It is available on Community and Enterprise, and in Cloud Team with Processing access. The page lists the workspace’s workflows with their version and status. New workflow starts a draft and focuses its identifier. Add at least one step before saving. For autonomous work, open Assistant on Enterprise with Agent Work (A2A).
Find a saved version in Workflow versions. The graph and Steps inspector share the main workspace. Select a node on the graph to jump to that step. Transitions appear below the graph. On a narrow screen, scroll sideways inside the graph to see more steps. The inspector sits below it. Save, Validate draft, and Publish keep their labels on phones.
- Give the workflow an identifier and a version (
1.0.0is suggested). - Pick a capability from the catalogue and press Add step. The first step becomes the entry; every next step continues the chain with a default transition, so a linear workflow needs one click per step. Capabilities you cannot use are shown disabled with the reason.
- For a branch, press Add transition: it proposes a way out that cannot close a loop. A step has one default transition; every other one needs a condition.
- Under Connections and secrets of a step, add a connection as
id@revisionand a secret by store, key and version. - Save (
Ctrl+S). Mistakes are listed above the graph while you edit — the step or branch at fault is outlined — and saving waits until they are fixed. - Validate draft checks capabilities, connections and secrets and shows the cost upper bound and any blockers.
- Publish becomes available after successful validation of the saved draft, to members allowed to deploy. A published version is read-only; New version copies it into the next patch version as a draft.
The JSON button shows the same definition as text: copy it into the CLI or an SDK, or paste an edited one back with Apply JSON.
On a licensed Company server, open a published readiness workflow and choose an eligible Runner. Starting this workflow requires Agent Work, API Testing and write permission in the selected Space. If a connection drops after you start it, use Check original run. The Builder checks the same launch and offers a retry only after the server confirms it has no receipt for that launch.
In connected Desktop, the Builder uses the permissions from the selected Company Space. Open report shows the results and offers JSON and ZIP downloads for that run. If you switch Company profiles or Spaces, reopen the report from the workflow in the original Space.
The examples use
localhost:5770. Replace it with your Mockarty address. Use a concrete workspace namespace;*is never accepted for authoring.
Minimal definition
This example uses Functional testing. Check the capability and version in
your workspace catalogue before using the definition.
{
"contractVersion": "mockarty.workflow/v1",
"namespace": "sandbox",
"id": "release-check",
"version": "1.0.0",
"status": "draft",
"entryNode": "inspect",
"nodes": [
{
"id": "inspect",
"capability": {"key": "mockarty.testing.functional", "version": "1.0.0"}
}
],
"transitions": []
}
Capability identity uses the exact version returned by the capabilities catalogue. Secrets are referenced by store, key, and positive version; their values are never embedded in a definition. A connection is referenced as id@revision; dry-run accepts it only while that revision is the connection’s current one in the same workspace, so a rotated or revoked connection blocks publication until the definition points at the new revision.
Transition conditions use the versioned mockarty.expr/v1 expression contract. Dry-run compiles their syntax and rejects malformed delimiters, strings, or expressions; it does not execute a condition or a workflow node.
REST API
Create a draft:
curl -fsS -X POST http://localhost:5770/api/v1/namespaces/sandbox/workflow-definitions \
-H "Authorization: Bearer $MOCKARTY_API_TOKEN" \
-H 'Content-Type: application/json' \
--data-binary @workflow.json
Keep the returned revision. Resolve the exact draft, then publish the same revision:
curl -fsS -X POST \
http://localhost:5770/api/v1/namespaces/sandbox/workflow-definitions/release-check/versions/1.0.0/dry-run \
-H "Authorization: Bearer $MOCKARTY_API_TOKEN" \
-H 'Content-Type: application/json' \
-d '{"expectedRevision":1}'
curl -fsS -X POST \
http://localhost:5770/api/v1/namespaces/sandbox/workflow-definitions/release-check/versions/1.0.0/publish \
-H "Authorization: Bearer $MOCKARTY_API_TOKEN" \
-H 'Content-Type: application/json' \
-d '{"expectedRevision":1}'
Dry-run returns ready, a stable definition digest, resolved references, a cost upper bound, and blockers. It performs no provider call and starts no mission.
Run a local readiness check
Open a published version with one step using runner.task.api_test@1.0.0.
Keep the step free of connections, secrets, and transitions. Execution requires
a native Company session, active on-premises Agent Work (A2A), API Tester access,
and permission to launch and view Test Plans in the Space. An operator must
enroll a runner in that Space for the local readiness fixture.
The run checks the runner’s enrolled local readiness endpoint and links to its
Test Plan report. The run receipt is available to the member who started it.
The finished report follows the Space’s usual Test Plan read permissions.
The Builder uses these endpoints relative to
/api/v1/namespaces/{namespace}/workflow-definitions/{id}/versions/{version}.
They use the native browser session. CLI, SDK and MCP authoring work as before.
GET /run-readinessreturns the savedrevision, availability, a reason, and
eligible runners byidandname.POST /runsacceptsoperationId(a new UUID),expectedRevisionand the
chosenrunnerIdfrom readiness.GET /runs/{operationId}reads the same user’s receipt for this saved
version after a lost response.pendingmeans the original attempt may
still return.unknownmeans no result arrived in time.reportedincludes
reportUrlwhile the report remains available. An unknown result never
triggers another request on the runner.
CLI
mockarty-cli --namespace sandbox workflow create --file workflow.json
mockarty-cli --namespace sandbox workflow dry-run --id release-check --version 1.0.0 --revision 1
mockarty-cli --namespace sandbox workflow publish --id release-check --version 1.0.0 --revision 1
mockarty-cli --namespace sandbox workflow list --status published
SDKs
Go
created, err := client.WorkflowDefinitions().CreateDraft(ctx, definition)
dryRun, err := client.WorkflowDefinitions().DryRun(ctx, "sandbox", "release-check", "1.0.0", created.Revision)
published, err := client.WorkflowDefinitions().Publish(ctx, "sandbox", "release-check", "1.0.0", created.Revision)
Python
created = client.workflow_definitions.create_draft(definition)
dry_run = client.workflow_definitions.dry_run("release-check", "1.0.0", created["revision"])
published = client.workflow_definitions.publish("release-check", "1.0.0", created["revision"])
Java
JsonNode created = client.workflowDefinitions().createDraft(definition);
JsonNode dryRun = client.workflowDefinitions().dryRun("sandbox", "release-check", "1.0.0", created.path("revision").asLong());
JsonNode published = client.workflowDefinitions().publish("sandbox", "release-check", "1.0.0", created.path("revision").asLong());
MCP tools
Agents use the same authority through workflow_definitions_list, workflow_definition_get, workflow_definition_save, workflow_definition_dry_run, and workflow_definition_publish. Publication still requires the caller’s deployment permission; MCP does not bypass workspace RBAC, licensing, reference checks, or the dry-run gate.
Conflicts and blockers
400invalid definition: the message names the rule that failed, for examplenode "deploy" is unreachable from entryorconditional branch "ok" requires an expression.409revision conflict: fetch the exact version again before editing.409dry-run required: the draft changed after its last successful dry-run, or it still has blockers.409immutable: create a new semantic version instead of overwriting the published one.503authority unavailable: do not publish from cached or guessed data; restore the dependency and repeat dry-run.
Publishing stores a reviewed, immutable authoring contract. Starting a mission plans the work from the mission goal and the capability catalogue, not from a saved definition; see Autonomous Missions for the mission flows that are available now.