# Workflow Studio — llm.txt > Format guide for language models (ChatGPT, Claude, Gemini, Llama, Mistral and others). > Read this document completely, then generate workflows that Workflow Studio can import without errors. > Format: "workflow-studio" · Version: 1.2.0 · JSON Schema: /schema/workflow.schema.json · Examples: /examples/ ## 1. What is Workflow Studio Workflow Studio is a free, browser-based visual editor for designing workflows of any kind: AI agents and multi-agent systems, prompts, skills and rules, Specification Driven Development (SDD), software processes, business approvals, research pipelines and operational flows. It does NOT execute workflows. It draws, documents, validates, imports and exports them. JSON is the only official format. When a user asks you to "create a workflow compatible with Workflow Studio", answer with ONE JSON document that follows this specification. The user will paste it into Workflow Studio (Import JSON → Paste JSON). ## 2. Document structure (JSON) A document has an envelope and a "workflow" object: { "format": "workflow-studio", // required, always exactly this string "version": "1.2.0", // required, semantic version of the format "workflow": { "id": "workflow-…", // required, see identifier rules "name": "…", // required, 1–200 characters "description": "…", // optional "tags": ["…"], // optional, unique strings "createdAt": "2026-01-01T00:00:00.000Z", // optional ISO 8601 "updatedAt": "2026-01-01T00:00:00.000Z", // optional ISO 8601 "nodes": [ …Node ], // required (may be empty) "connections": [ …Connection ], // required (may be empty) "subworkflows": [ …Subworkflow ], // optional "view": { …View }, // optional, presentation only "metadata": { } // optional, free-form } } The document separates two concerns inside the same file: - Workflow Definition (meaning): node types, names, descriptions, configuration, ports, connections, subworkflows. - Workflow View (presentation): node "position" and "size", and the "view" object (zoom, offset, theme, grid, groups). Changing the view never changes the meaning of the workflow. Unknown properties are rejected (except inside "configuration" and "metadata"). Do not invent top-level keys. Do not use "config", "edges", "links", "x"/"y" at node level, or "from"/"to" — use the names in this document. ## 3. Nodes { "id": "researcher", // required, unique among the nodes of the same level "type": "agent", // required, a component type from section 5 "typeVersion": 1, // recommended, integer ≥ 1 (all built-in types are version 1) "name": "Research Agent", // required, 1–200 characters, shown on the canvas "description": "…", // optional, longer explanation "position": { "x": 340, "y": 180 }, // required, top-left corner in canvas pixels "size": { "width": 240, "height": 60 }, // optional, omit to use the default size "color": "#8B5CF6", // optional, overrides the category color (#RGB or #RRGGBB) "configuration": { }, // optional, type specific keys (section 5) "inputs": [ { "id": "in", "name": "Input", "kind": "flow" } ], // optional, defaults per type "outputs": [ { "id": "out", "name": "Output", "kind": "flow" } ], // optional, defaults per type "metadata": { } // optional, free-form } Ports: { "id": string, "name": string, "kind": "flow" | "reference" }. - Omit "inputs"/"outputs" to use the defaults of the type (recommended), EXCEPT when you need custom branches (decision, parallel) or a subworkflow interface. If you provide them, provide the complete list. - "flow" ports carry the process (left = inputs, right = outputs on the canvas). - "reference" ports carry resources: resources expose an output port "ref"; consumers expose an input port "resources". ## 4. Connections { "id": "c1", // required, unique among the connections of the same level "source": "start", // required, node id "sourcePort": "out", // recommended, an OUTPUT port id of the source node "target": "researcher", // required, node id "targetPort": "in", // recommended, an INPUT port id of the target node "type": "control-flow", // required, see below "label": "approved", // optional, short text shown on the line "style": "step", // optional line style: bezier | step | straight (since 1.2.0) "metadata": { } // optional } Connection types: - "control-flow" — Control Flow: The order in which steps happen. Port kinds: flow → flow. - "data-flow" — Data Flow: Information passed from one step to another. Port kinds: flow → flow. - "dependency" — Dependency: The target depends on the source being done. Port kinds: any. - "reference" — Reference: A reusable resource used by the target (skill, rule, model…). Port kinds: reference → reference. - "feedback" — Feedback: A loop back to an earlier step. Port kinds: flow → flow. Compatibility rules (violations are import errors): - control-flow, data-flow and feedback connect a flow output port to a flow input port. - reference connects a reference output port ("ref") to a reference input port ("resources"). - dependency may connect any ports, but prefer flow → flow. - Direction always goes from an OUTPUT port of "source" to an INPUT port of "target". - If "sourcePort"/"targetPort" are omitted, the first compatible port is used. Always set them for decision, loop, parallel, approval, review, validation and test outputs, because those have several outputs. - Use "feedback" for loops back to an earlier step (retry, rework). Use "data-flow" when the point is the data passed. ## 5. Component types and categories Categories: "core" (Core), "ai" (AI), "knowledge" (Knowledge), "development" (Development / SDD), "devops" (Git & CI/CD), "integration" (Integration), "human" (Human). Kinds: flow = a step of the process; terminal = start/end; artifact = a deliverable that is also a step (SDD); resource = reusable item referenced by other nodes (never part of the control flow); container = subworkflow. Flow components vs. resources: - Do NOT put resources (llm-model, prompt, memory, skill, rule, context, knowledge-base, document, mcp-server) in the control flow. Connect them with "reference" connections from their "ref" port to the "resources" port of the node that uses them (agent, ai-task, skill, knowledge-base, specification, implementation). - A single resource may be referenced by several nodes (for example one rule shared by several agents). - api, database and external-tool are flow steps AND can be referenced as tools (they also have a "ref" output). ### Category: Core (id "core") - type "start" — Start (terminal). Entry point of the workflow. inputs: none | outputs: out configuration: { trigger: string — one of "manual" | "schedule" | "event" | "webhook" | "message" | "other" (or any text); payload: string } - type "end" — End (terminal). Finishes the workflow. inputs: in | outputs: none configuration: { result: string — one of "success" | "failure" | "cancelled" | "other" (or any text); output: string } - type "process" — Process (flow). A generic step or activity. inputs: in | outputs: out configuration: { action: string; owner: string; duration: string } - type "decision" — Decision (flow). Branches the flow based on a condition. inputs: in | outputs: true, false configuration: { condition: string — required } branches: the "outputs" array is editable (add/rename/remove flow output ports). - type "loop" — Loop (flow). Repeats steps for each item or while a condition holds. inputs: in | outputs: each, done configuration: { loopType: string — one of "for-each" | "while" | "until" | "count"; condition: string; maxIterations: number — range 1..∞ } - type "parallel" — Parallel (flow). Runs several branches at the same time. inputs: in | outputs: branch-1, branch-2 branches: the "outputs" array is editable (add/rename/remove flow output ports). - type "wait" — Wait (flow). Pauses until a time or event. inputs: in | outputs: out configuration: { waitType: string — one of "duration" | "date" | "event"; value: string } - type "merge" — Merge (flow). Joins several branches into one. inputs: in | outputs: out configuration: { strategy: string — one of "wait-all" | "first-completed" | "any" } - type "subworkflow" — Subworkflow (container). An encapsulated workflow you can open and edit. inputs: in | outputs: out configuration: { subworkflowId: string — required } configuration.subworkflowId must match an entry of workflow.subworkflows; the node inputs/outputs must equal that subworkflow's inputs/outputs. ### Category: AI (id "ai") - type "agent" — AI Agent (flow). An autonomous agent with a role, instructions and tools. inputs: in, resources (reference) | outputs: out configuration: { agentType: string — one of "worker" | "supervisor" | "orchestrator" | "planner" | "coder" | "reviewer" | "autonomous"; role: string; instructions: string; input: string; output: string; goal: string; maxIterations: number — range 1..∞ } uses resources via reference connections: Model ← llm-model; Skills ← skill; Rules ← rule; Memory ← memory; Knowledge ← prompt/context/knowledge-base/document; Tools ← api/mcp-server/database/external-tool/webhook/script - type "llm-model" — LLM Model (resource). A language model configuration shared by agents and tasks. inputs: none | outputs: ref (reference) configuration: { modelType: string — one of "chat" | "reasoning" | "embedding" | "reranker" | "vision" | "speech"; provider: string; model: string; temperature: number — range 0..2; maxTokens: number — range 1..∞ } - type "prompt" — Prompt (resource). A reusable prompt template. inputs: none | outputs: ref (reference) configuration: { role: string — one of "system" | "user" | "few-shot" | "template"; template: string; variables: string[] } - type "memory" — Memory (resource). Short or long term memory for agents. inputs: none | outputs: ref (reference) configuration: { memoryType: string — one of "short-term" | "long-term" | "vector" | "episodic" | "shared"; store: string; retention: string } - type "ai-task" — AI Task (flow). A single model call: summarize, classify, extract… inputs: in, resources (reference) | outputs: out configuration: { operation: string — one of "generate" | "summarize" | "classify" | "extract" | "translate" | "evaluate" | "rewrite" | "other"; task: string; outputFormat: string — one of "text" | "markdown" | "json" | "list" } uses resources via reference connections: Model ← llm-model; Prompt ← prompt; Context ← context/knowledge-base/document; Rules ← rule; Tools ← api/mcp-server/database/external-tool/webhook/script - type "guardrail" — Guardrail (flow). Blocks unsafe input, output or actions. inputs: in, resources (reference) | outputs: passed, blocked configuration: { guardrailType: string — one of "input" | "output" | "moderation" | "pii" | "policy" | "tool-use" | "hook"; policy: string — required; action: string — one of "block" | "warn" | "redact" | "ask-human" } accepts reference connections from: rule, document, context, prompt ### Category: Knowledge (id "knowledge") - type "skill" — Skill (resource). A packaged capability an agent can use. inputs: resources (reference) | outputs: ref (reference) configuration: { purpose: string; instructions: string; triggers: string[]; path: string } accepts reference connections from: document, context, knowledge-base, rule, prompt - type "rule" — Rule (resource). A constraint or guideline shared by agents. inputs: none | outputs: ref (reference) configuration: { statement: string — required; severity: string — one of "must" | "should" | "may"; scope: string } - type "context" — Context (resource). Background information given to agents. inputs: none | outputs: ref (reference) configuration: { content: string; source: string } - type "knowledge-base" — Knowledge Base (resource). A searchable collection of knowledge (RAG). inputs: resources (reference) | outputs: ref (reference) configuration: { source: string; storeType: string — one of "vector-store" | "search-index" | "wiki" | "files" | "database"; refreshPolicy: string } accepts reference connections from: document, context - type "document" — Document (resource). A file, page or link. inputs: none | outputs: ref (reference) configuration: { location: string; format: string — one of "markdown" | "pdf" | "html" | "text" | "spreadsheet" | "other" (or any text); summary: string } ### Category: Development / SDD (id "development") - type "requirement" — Requirement (artifact). What must be built and why. inputs: in | outputs: out configuration: { acceptanceCriteria: string[]; priority: string — one of "low" | "medium" | "high" | "critical"; status: string — one of "draft" | "in-review" | "approved" | "in-progress" | "done" | "blocked" } - type "specification" — Specification (artifact). Detailed design of the solution. inputs: in, resources (reference) | outputs: out configuration: { scope: string; decisions: string[]; status: string — one of "draft" | "in-review" | "approved" | "in-progress" | "done" | "blocked"; location: string } accepts reference connections from: document, context, rule, knowledge-base - type "planning" — Planning (artifact). Breaks the work into steps and milestones. inputs: in | outputs: out configuration: { approach: string; milestones: string[]; risks: string[]; status: string — one of "draft" | "in-review" | "approved" | "in-progress" | "done" | "blocked" } - type "task" — Task (artifact). A unit of work. inputs: in | outputs: out configuration: { assignee: string; estimate: string; priority: string — one of "low" | "medium" | "high" | "critical"; status: string — one of "draft" | "in-review" | "approved" | "in-progress" | "done" | "blocked"; checklist: string[] } - type "implementation" — Implementation (artifact). Building the solution. inputs: in, resources (reference) | outputs: out configuration: { components: string[]; repository: string; branch: string; status: string — one of "draft" | "in-review" | "approved" | "in-progress" | "done" | "blocked" } accepts reference connections from: skill, rule, document, context, knowledge-base, mcp-server, external-tool, api, database - type "validation" — Validation (artifact). Checks the result against criteria. inputs: in | outputs: pass, fail configuration: { criteria: string[]; method: string — one of "manual" | "automated" | "peer-review" | "ai-review" } - type "test" — Test (artifact). Automated or manual tests. inputs: in | outputs: pass, fail configuration: { testType: string — one of "unit" | "integration" | "e2e" | "regression" | "smoke" | "contract" | "performance" | "security" | "manual"; command: string; coverage: string } - type "issue" — Issue (artifact). A tracked work item: bug, story, incident… inputs: in | outputs: out configuration: { issueType: string — one of "bug" | "story" | "task" | "epic" | "incident" | "support"; key: string; tracker: string — one of "Jira" | "GitHub Issues" | "GitLab Issues" | "Linear" | "Azure Boards" | "other" (or any text); priority: string — one of "low" | "medium" | "high" | "critical"; status: string — one of "draft" | "in-review" | "approved" | "in-progress" | "done" | "blocked"; severity: string — one of "minor" | "major" | "critical" | "blocker" } ### Category: Git & CI/CD (id "devops") - type "branch" — Branch (flow). Creates a git branch from an allowed source. inputs: in | outputs: out configuration: { branchType: string — one of "feature" | "bugfix" | "hotfix" | "release" | "main" | "integration" | "other" (or any text); naming: string; source: string; forbiddenSources: string[]; protected: boolean } - type "commit" — Commit (flow). Records changes with a standard message. inputs: in | outputs: out configuration: { messagePattern: string; atomic: boolean; signed: boolean } - type "push" — Push (flow). Publishes the branch to the remote repository. inputs: in | outputs: out configuration: { remote: string; setUpstream: boolean; preflight: string[]; protectedBranches: string[] } - type "pull-request" — Pull Request (flow). Opens a pull/merge request for review. inputs: in | outputs: approved, changes configuration: { base: string; titlePattern: string; reviewMode: string — one of "human" | "bot" | "bot-and-human" | "none"; labels: string[]; reviewers: string[]; requiredChecks: string[]; descriptionSections: string[] } - type "git-merge" — Merge (Git) (flow). Merges a branch into its target. inputs: in | outputs: merged, conflict configuration: { target: string; strategy: string — one of "merge-commit" | "squash" | "rebase" | "fast-forward"; requiresConfirmation: boolean; deleteBranch: boolean } - type "git-tag" — Tag / Version (flow). Marks a release with a version tag. inputs: in | outputs: out configuration: { pattern: string; versioning: string — one of "semver" | "calendar" | "sequential" | "custom"; branch: string } - type "pipeline-stage" — Pipeline Stage (flow). A CI/CD stage: source, build, test, deploy… inputs: in, resources (reference) | outputs: success, failure configuration: { stage: string — one of "source" | "build" | "test" | "package" | "deploy" | "approval" | "other"; provider: string — one of "GitHub Actions" | "GitLab CI" | "AWS CodePipeline" | "Azure Pipelines" | "Jenkins" | "CircleCI" | "Bitbucket Pipelines" (or any text); trigger: string; command: string; timeout: string } accepts reference connections from: environment, script, document, rule, external-tool, mcp-server - type "quality-gate" — Quality Gate (flow). Static analysis, coverage or security gate. inputs: in | outputs: passed, failed configuration: { tool: string — one of "SonarQube" | "CodeQL" | "Coverage" | "Linter" | "Snyk" | "Dependency audit" | "other" (or any text); blocking: boolean; conditions: string[] } - type "environment" — Environment (resource). A deployment target: development, staging, production… inputs: none | outputs: ref (reference) configuration: { tier: string — one of "development" | "integration" | "test" | "staging" | "production" (or any text); branch: string; url: string; requiresApproval: boolean; account: string } - type "change-request" — Change Request (flow). Planned change window announced before a release. inputs: in | outputs: approved, rejected configuration: { window: string; version: string; owner: string; channel: string; rollbackPlan: string; approvers: string[] } - type "post-deploy-check" — Post-deploy Check (flow). Verifies a release in production: logs, metrics and business KPIs. inputs: in, resources (reference) | outputs: ok, regression configuration: { sources: string[]; checks: string[]; comparison: string — one of "before-after" | "threshold" | "manual"; window: string } accepts reference connections from: environment, database, document, knowledge-base, external-tool, script, mcp-server ### Category: Integration (id "integration") - type "api" — API (flow). Calls an HTTP API. inputs: in | outputs: out, ref (reference) configuration: { protocol: string — one of "REST" | "GraphQL" | "gRPC" | "SOAP" | "HTTP"; method: string — one of "GET" | "POST" | "PUT" | "PATCH" | "DELETE"; url: string; auth: string — one of "none" | "api-key" | "oauth2" | "basic" | "bearer"; payload: string } - type "mcp-server" — MCP Server (resource). A Model Context Protocol server exposing tools. inputs: none | outputs: ref (reference) configuration: { transport: string — one of "stdio" | "http" | "sse"; endpoint: string; tools: string[] } - type "database" — Database (flow). Reads from or writes to a database. inputs: in | outputs: out, ref (reference) configuration: { engine: string; operation: string — one of "read" | "write" | "query" | "upsert" | "delete"; query: string } - type "external-tool" — External Tool (flow). Any external tool or service. inputs: in | outputs: out, ref (reference) configuration: { tool: string; action: string; inputSchema: string } - type "webhook" — Webhook (flow). Sends or receives an HTTP callback. inputs: in | outputs: out configuration: { direction: string — one of "incoming" | "outgoing"; url: string; event: string } - type "script" — Script (flow). Runs a script, function or CLI command. inputs: in | outputs: out, ref (reference) configuration: { language: string — one of "bash" | "powershell" | "python" | "node" | "sql" | "other" (or any text); command: string; path: string; workingDirectory: string } ### Category: Human (id "human") - type "user-input" — User Input (flow). Asks a person for information. inputs: in | outputs: out configuration: { question: string; inputType: string — one of "text" | "choice" | "file" | "form" | "confirmation"; required: boolean } - type "approval" — Approval (flow). A person approves or rejects. inputs: in | outputs: approved, rejected configuration: { approver: string; criteria: string; sla: string; escalation: string } - type "review" — Review (flow). A person reviews the work. inputs: in | outputs: approved, changes configuration: { reviewerType: string — one of "human" | "bot" | "ai-agent"; reviewer: string; checklist: string[]; sla: string } - type "manual-action" — Manual Action (flow). A task performed by a person. inputs: in | outputs: out configuration: { owner: string; instructions: string; duration: string } - type "notification" — Notification (flow). Sends a message: chat, email, SMS… inputs: in | outputs: out configuration: { channel: string — one of "chat" | "email" | "sms" | "push" | "webhook" (or any text); recipients: string; message: string; requiresApproval: boolean } ### Common variants (use the base type with this configuration) - For Each: type "loop" with configuration {"loopType":"for-each"} - While: type "loop" with configuration {"loopType":"while"} - If / Else: type "decision" - Switch / Case: type "decision" and outputs ["case-1","case-2","case-3","default"] - Fork: type "parallel" - Join: type "merge" with configuration {"strategy":"wait-all"} - Delay: type "wait" with configuration {"waitType":"duration"} - Scheduled Trigger: type "start" with configuration {"trigger":"schedule"} - Event Trigger: type "start" with configuration {"trigger":"event"} - Supervisor Agent: type "agent" with configuration {"agentType":"supervisor","role":"Supervisor"} - Orchestrator Agent: type "agent" with configuration {"agentType":"orchestrator","role":"Orchestrator"} - Coder Agent: type "agent" with configuration {"agentType":"coder","role":"Software engineer"} - Reviewer Agent: type "agent" with configuration {"agentType":"reviewer","role":"Code reviewer"} - Autonomous Agent: type "agent" with configuration {"agentType":"autonomous"} - Embedding Model: type "llm-model" with configuration {"modelType":"embedding"} - Reranker Model: type "llm-model" with configuration {"modelType":"reranker"} - System Prompt: type "prompt" with configuration {"role":"system"} - User Prompt: type "prompt" with configuration {"role":"user"} - AI Classification: type "ai-task" with configuration {"operation":"classify","outputFormat":"json"} - AI Extraction: type "ai-task" with configuration {"operation":"extract","outputFormat":"json"} - AI Summarization: type "ai-task" with configuration {"operation":"summarize","outputFormat":"markdown"} - AI Translation: type "ai-task" with configuration {"operation":"translate"} - AI Evaluation: type "ai-task" with configuration {"operation":"evaluate","outputFormat":"json"} - Moderation: type "guardrail" with configuration {"guardrailType":"moderation","policy":"Block harmful or abusive content."} - Vector Database: type "knowledge-base" with configuration {"storeType":"vector-store"} - Test Data: type "document" with configuration {"format":"spreadsheet"} - Dataset: type "document" - User Story: type "requirement" - Subtask: type "task" - Code Review: type "review" with configuration {"reviewerType":"human","reviewer":"Peer developer"} - Automated Review: type "review" with configuration {"reviewerType":"bot","reviewer":"Review bot"} - Unit Test: type "test" with configuration {"testType":"unit"} - Integration Test: type "test" with configuration {"testType":"integration"} - E2E Test: type "test" with configuration {"testType":"e2e"} - Regression Suite: type "test" with configuration {"testType":"regression"} - Smoke Test: type "test" with configuration {"testType":"smoke"} - Feature Branch: type "branch" with configuration {"branchType":"feature","source":"main"} - Hotfix Branch: type "branch" with configuration {"branchType":"hotfix","source":"main"} - Release Tag: type "git-tag" with configuration {"versioning":"semver","branch":"main"} - Source Stage: type "pipeline-stage" with configuration {"stage":"source"} - Build Stage: type "pipeline-stage" with configuration {"stage":"build"} - Test Stage: type "pipeline-stage" with configuration {"stage":"test"} - Deploy Stage: type "pipeline-stage" with configuration {"stage":"deploy"} - Deploy Approval: type "approval" with configuration {"approver":"Release manager"} - SonarQube Gate: type "quality-gate" with configuration {"tool":"SonarQube","blocking":true} - Production Environment: type "environment" with configuration {"tier":"production","requiresApproval":true} - REST API: type "api" with configuration {"protocol":"REST"} - GraphQL API: type "api" with configuration {"protocol":"GraphQL","method":"POST"} - SQL Query: type "database" with configuration {"operation":"query","engine":"SQL"} - CLI Command: type "script" with configuration {"language":"bash"} - Form: type "user-input" with configuration {"inputType":"form"} - Confirmation: type "user-input" with configuration {"inputType":"confirmation"} - Signature: type "approval" with configuration {"criteria":"Document signed"} - Escalation: type "manual-action" with configuration {"owner":"Next support level"} - Chat Message: type "notification" with configuration {"channel":"chat"} - Email: type "notification" with configuration {"channel":"email"} ## 6. Subworkflows A subworkflow is a workflow encapsulated inside another one: - Define it in "workflow.subworkflows": { "id", "name", "description"?, "inputs": [ports], "outputs": [ports], "nodes": [...], "connections": [...], "view"? , "metadata"? }. - Place a node of type "subworkflow" where it is used: "configuration": { "subworkflowId": "" }, and copy the subworkflow "inputs"/"outputs" into that node's "inputs"/"outputs". - Node and connection ids are independent per level (the same id may appear in the root and in a subworkflow). Subworkflow ids must be unique in the whole document. Subworkflows must not contain themselves (directly or indirectly). - Inside a subworkflow, start with a "start" node and finish with an "end" node. ## 7. View (optional) { "zoom": 1, "offset": { "x": 0, "y": 0 }, "theme": "light" | "dark", "connectionStyle": "bezier" | "step" | "straight", "grid": { "size": 20, "visible": true, "snap": true }, "groups": [ { "id": "group-team", "name": "Research team", "color": "#8B5CF6", "nodeIds": ["researcher", "analyst"] } ], "lanes": { "orientation": "horizontal", "y": 0, "items": [ { "id": "lane-dev", "name": "Developer", "color": "#EC4899", "size": 220 }, { "id": "lane-ci", "name": "CI/CD", "color": "#6366F1", "size": 220 } ] } } Groups are visual frames drawn around their nodes. A node belongs to at most one group. You may omit "view". Lanes (swimlanes, since 1.1.0) are horizontal bands stacked from "y" downwards, each "size" pixels tall (min 80). A node belongs to the lane that contains its vertical center: with the example above, a node with "position.y" between 0 and 220 − its height is in "Developer", and between 220 and 440 − height in "CI/CD". Use lanes for actors (developer, bot, reviewer) or stages/environments (feature, integration, staging, production). "connectionStyle" (since 1.2.0) is the default line style of the whole workflow; omit it to get "step" on levels with lanes and "bezier" elsewhere. Prefer "step" for dense pipelines and process diagrams. ## 8. Positioning rules - Coordinates are canvas pixels; x grows to the right, y grows downwards. Use multiples of 20. - Lay the main flow from left to right: start at x = 80, then add about 300 to x for every next step. - Default node size is 240 × 60 (start/end are 168 × 52). Decision, loop, approval, review, validation and test nodes are taller (about 118) because they list their branches. - Put parallel branches on different rows (about 140 apart in y) and keep each branch moving right. - Place resources BELOW the node that uses them (about 120–160 lower), side by side, 260 apart in x. - Never overlap nodes. If you are unsure, Workflow Studio has an "Auto layout" button that rearranges everything. ## 9. Identifier rules - Pattern: ^[A-Za-z0-9][A-Za-z0-9_.:-]{0,127}$ — start with a letter or digit; use letters, digits, "-", "_", ".", ":". - Prefer short, readable, kebab-case ids that describe the element: "start", "research-agent", "approval-manager". - Node ids are unique per level; connection ids are unique per level; group ids unique per level; subworkflow ids unique. - Every "source", "target", "nodeIds" entry and "subworkflowId" must reference an existing id. - Node "type" must be lowercase kebab-case. Use the built-in types listed in section 5. ## 10. Validation rules applied by Workflow Studio Import errors (the document is rejected): - invalid JSON, wrong "format", missing or newer major "version"; - properties not allowed by the schema, wrong value types, empty names, invalid ids; - duplicate ids; connections pointing to missing nodes or ports; incompatible connection type and port kinds; - subworkflow node without an existing "subworkflowId"; recursive subworkflows. Warnings and information (accepted, shown in the Validate panel): - disconnected nodes, steps without outgoing connection, unconnected branches, unreachable steps; - missing Start or End when the workflow has a control flow; several Start nodes; - cycles with no decision/loop/exit (cycles that use "feedback" connections are fine); - required configuration missing (for example a decision without "condition", a rule without "statement"); - configuration values with the wrong type or outside the allowed options; unknown component types; - resources not used by any node; references a node does not usually use. Workflows may be graphs, cyclic processes or dependency maps — a strictly linear flow is not required. ## 11. Complete examples Minimal but complete workflow (agent with a model, a decision and a feedback loop): { "format": "workflow-studio", "version": "1.2.0", "workflow": { "id": "workflow-research", "name": "AI Research Workflow", "description": "Research and summarize a topic", "nodes": [ { "id": "start", "type": "start", "typeVersion": 1, "name": "Start", "position": { "x": 80, "y": 200 }, "configuration": { "trigger": "manual" } }, { "id": "researcher", "type": "agent", "typeVersion": 1, "name": "Research Agent", "position": { "x": 340, "y": 180 }, "configuration": { "role": "Research Specialist", "instructions": "Research the requested topic and cite sources." } }, { "id": "model", "type": "llm-model", "typeVersion": 1, "name": "Model", "position": { "x": 340, "y": 340 }, "configuration": { "provider": "Any", "model": "general-purpose" } }, { "id": "decision", "type": "decision", "typeVersion": 1, "name": "Enough sources?", "position": { "x": 680, "y": 180 }, "configuration": { "condition": "At least three reliable sources?" }, "outputs": [ { "id": "true", "name": "True", "kind": "flow" }, { "id": "false", "name": "False", "kind": "flow" } ] }, { "id": "end", "type": "end", "typeVersion": 1, "name": "Summary delivered", "position": { "x": 1000, "y": 180 }, "configuration": { "result": "success" } } ], "connections": [ { "id": "c1", "source": "start", "sourcePort": "out", "target": "researcher", "targetPort": "in", "type": "control-flow" }, { "id": "c2", "source": "researcher", "sourcePort": "out", "target": "decision", "targetPort": "in", "type": "control-flow" }, { "id": "c3", "source": "decision", "sourcePort": "true", "target": "end", "targetPort": "in", "type": "control-flow", "label": "yes" }, { "id": "c4", "source": "decision", "sourcePort": "false", "target": "researcher", "targetPort": "in", "type": "feedback", "label": "search more" }, { "id": "c5", "source": "model", "sourcePort": "ref", "target": "researcher", "targetPort": "resources", "type": "reference" } ] } } Full example (/examples/ai-agent.json, compact): {"format":"workflow-studio","version":"1.2.0","workflow":{"id":"template-ai-agent","name":"Basic AI Agent","description":"A single assistant agent with a model, a system prompt, a skill, a rule and memory.","tags":["ai","agent"],"createdAt":"2026-11-28T00:00:00.000Z","updatedAt":"2026-11-28T00:00:00.000Z","nodes":[{"id":"start","type":"start","typeVersion":1,"name":"User message","description":"","position":{"x":80,"y":140},"configuration":{"trigger":"message","payload":"A question or request from the user"},"inputs":[],"outputs":[{"id":"out","name":"Output","kind":"flow"}],"metadata":{}},{"id":"agent","type":"agent","typeVersion":1,"name":"Assistant Agent","description":"","position":{"x":800,"y":80},"configuration":{"role":"Helpful assistant","instructions":"Understand the request, use the available skill when useful and answer clearly.","input":"User message","output":"Answer in markdown"},"inputs":[{"id":"in","name":"Input","kind":"flow"},{"id":"resources","name":"Resources","kind":"reference"}],"outputs":[{"id":"out","name":"Output","kind":"flow"}],"metadata":{}},{"id":"end","type":"end","typeVersion":1,"name":"Answer delivered","description":"","position":{"x":1580,"y":140},"configuration":{"result":"success","output":"Answer shown to the user"},"inputs":[{"id":"in","name":"Input","kind":"flow"}],"outputs":[],"metadata":{}},{"id":"model","type":"llm-model","typeVersion":1,"name":"Default model","description":"","position":{"x":340,"y":180},"configuration":{"provider":"Any provider","model":"general-purpose model","temperature":0.3},"inputs":[],"outputs":[{"id":"ref","name":"Reference","kind":"reference"}],"metadata":{}},{"id":"prompt","type":"prompt","typeVersion":1,"name":"System prompt","description":"","position":{"x":580,"y":180},"configuration":{"role":"system","template":"You are a concise and friendly assistant. Answer in the language of the user."},"inputs":[],"outputs":[{"id":"ref","name":"Reference","kind":"reference"}],"metadata":{}},{"id":"skill","type":"skill","typeVersion":1,"name":"Web search","description":"","position":{"x":820,"y":180},"configuration":{"purpose":"Look up recent facts","instructions":"Search the web and cite the sources used."},"inputs":[{"id":"resources","name":"Resources","kind":"reference"}],"outputs":[{"id":"ref","name":"Reference","kind":"reference"}],"metadata":{}},{"id":"rule","type":"rule","typeVersion":1,"name":"Cite sources","description":"","position":{"x":1040,"y":180},"configuration":{"severity":"must","statement":"Every factual claim must cite a source."},"inputs":[],"outputs":[{"id":"ref","name":"Reference","kind":"reference"}],"metadata":{}},{"id":"memory","type":"memory","typeVersion":1,"name":"Conversation memory","description":"","position":{"x":1280,"y":180},"configuration":{"memoryType":"short-term","store":"conversation buffer"},"inputs":[],"outputs":[{"id":"ref","name":"Reference","kind":"reference"}],"metadata":{}}],"connections":[{"id":"c1","source":"start","sourcePort":"out","target":"agent","targetPort":"in","type":"control-flow","metadata":{}},{"id":"c2","source":"agent","sourcePort":"out","target":"end","targetPort":"in","type":"control-flow","metadata":{}},{"id":"c3","source":"model","sourcePort":"ref","target":"agent","targetPort":"resources","type":"reference","metadata":{}},{"id":"c4","source":"prompt","sourcePort":"ref","target":"agent","targetPort":"resources","type":"reference","metadata":{}},{"id":"c5","source":"skill","sourcePort":"ref","target":"agent","targetPort":"resources","type":"reference","metadata":{}},{"id":"c6","source":"rule","sourcePort":"ref","target":"agent","targetPort":"resources","type":"reference","metadata":{}},{"id":"c7","source":"memory","sourcePort":"ref","target":"agent","targetPort":"resources","type":"reference","metadata":{}}],"subworkflows":[],"view":{"zoom":1,"offset":{"x":0,"y":0},"grid":{"size":20,"visible":true,"snap":true},"groups":[],"theme":"light"},"metadata":{"template":true,"category":"AI"}}} All examples (valid, importable and useful as patterns): - /examples/ai-agent.json — Basic AI Agent: A single assistant agent with a model, a system prompt, a skill, a rule and memory. - /examples/multi-agent.json — Multi-Agent Collaboration: A coordinator delegates research and analysis to specialists in parallel, a writer combines the results and a human reviews them. - /examples/research-agent.json — Research Agent: An agent researches a topic with tools, summarizes the findings and iterates until it has enough sources. - /examples/rag-workflow.json — RAG Workflow: Retrieval augmented generation: rewrite the question, retrieve relevant chunks, answer with citations and check grounding. - /examples/ai-content-generation.json — AI Content Generation: From a brief to a published article: outline, draft, optimization and human review. - /examples/feature-development.json — Feature Development: From request to release, with the build and test loop encapsulated in a subworkflow. - /examples/bug-fixing.json — Bug Fixing: Triage, reproduce, fix with a regression test and verify. - /examples/code-review.json — Code Review: Automated checks, AI-assisted review against team rules and a human approval before merge. - /examples/testing-pipeline.json — Testing Pipeline: Parallel unit and integration tests, then end-to-end and performance tests before deploying to staging. - /examples/business-process.json — Approval Process: A purchase request approved by a manager or a director depending on the amount. - /examples/customer-onboarding.json — Customer Onboarding: Create the account, welcome the customer, collect requirements and confirm satisfaction. - /examples/document-review.json — Document Review: AI extracts key points, legal reviews, the author revises and a final approval closes the cycle. - /examples/support-process.json — Support Process: AI classifies tickets, resolves simple ones with a knowledge base and escalates the rest to people. - /examples/git-delivery.json — Git Delivery with Bot Review: Branch from main, commit, guarded push, pull request reviewed by a bot while the team is notified, required checks, merge and build — with feedback loops for every failure. - /examples/branch-promotion.json — Branch Promotion Strategy: One-way promotion: feature branches start from main and are merged into integration, staging and production — integration branches never flow back into a feature. - /examples/ci-cd-pipeline.json — CI/CD with Quality Gate and Approval: Source, build, tests and a quality gate in CI; staging deploy with smoke tests; manual approval and parallel production deploy with post-deploy checks. Failures are diagnosed by cause. - /examples/hotfix-release.json — Hotfix Release with Change Window: Urgent fix to production: next version, hotfix branch consolidating only approved changes, PR to main, change request in the deploy window, deploy subworkflow, tag and post-deploy verification. - /examples/post-deploy-verification.json — Post-deploy Verification: After a release: confirm pipelines, deployed commit and quality gate; then, change by change, check it ran in production without new errors; finally compare business KPIs before and after. - /examples/gated-agent-delivery.json — Agent Delivery with Gates: AI agents deliver a ticket in lanes: triage picks a small-fix or feature track, the developer approves the plan, a coder agent implements with tests and a reviewer agent approves — at most two review rounds before handing back. - /examples/sdd-workflow.json — SDD Workflow: Specification Driven Development: discovery (brownfield only), product spec with review, plan in waves, tracker tasks, architecture seam when several repositories change, and a delivery subworkflow per task (tech spec → parallel coders → review → tests → PR → quality gate → QA handoff). - /examples/qa-feature-bug.json — QA for Features and Bugs: QA entry point: features are tested scenario by scenario, automation first; bugs are reproduced, varied around the root cause, regression-tested and covered by an E2E. Failures open a defect. - /examples/support-rotation.json — Daily Support Rotation: A rotating engineer collects the day’s cases (with a pre-flight against duplicates), classifies them, updates the bug log, suggests answers, checks alerts and recent deploys, escalates what needs engineering and drafts a summary. ## 12. Instructions for generating a workflow 1. Understand the goal. Choose the process steps, the decision points, the people involved and the AI resources. 2. Start with one "start" node and end with at least one "end" node (one per distinct outcome is fine). 3. Use specific types: agent / ai-task for AI work; requirement → specification → planning → task → implementation → test → validation for SDD; approval / review / user-input / manual-action for people; api / database / webhook / external-tool / mcp-server for integrations; decision / loop / parallel / merge / wait for control. 4. Give every node a clear "name" (2–5 words) and fill "configuration" with meaningful content (role and instructions for agents, condition for decisions, acceptance criteria for requirements…). 5. Model reusable things (models, prompts, skills, rules, memory, knowledge) as resource nodes connected with "reference" connections — do not add them to the control flow. 6. Connect every flow step. For multi-output nodes, connect each relevant branch with the right "sourcePort". 7. Use "feedback" connections for rework and retries; add short "label"s on branches ("approved", "retry"). 8. Use a subworkflow when a part of the process is self-contained and has more than 4–5 steps. 9. Assign positions following section 8. Prefer readability over compactness. 10. Check every rule of sections 2–10 before answering. ## 13. Compatibility rules - Always output "format": "workflow-studio" and "version": "1.2.0". - Only use keys defined in this document. Put extra information in "metadata" (node, connection or workflow). - Keep strings as plain text (markdown is allowed inside descriptions and instructions). No comments in JSON. - Do not reference external files for the workflow content; everything must be inside the document. - Readers must preserve unknown "configuration" and "metadata" keys, so you may add domain-specific configuration keys when the listed ones are not enough. - Future versions keep the major version (1.x) backward compatible; documents with a newer major version are rejected. ## 14. Output instructions - Return ONLY the JSON document. No explanations before or after it, no markdown fences, no comments, no trailing commas, no "..." placeholders. - The output must be valid JSON parsable by JSON.parse and valid against /schema/workflow.schema.json. - If the request is ambiguous, make reasonable assumptions and record them in "workflow.description". - If the workflow is large, still return a single complete document.