Skip to content

YAML Reference

This is the complete schema reference for SWEny workflow YAML files. Every field, every validation rule, every constraint.

FieldTypeRequiredDescription
idstringYesUnique workflow identifier. Used in CLI commands, exports, and event payloads.
namestringYesHuman-readable display name. Shown in CLI output, Studio, and notifications.
descriptionstringNoWhat this workflow does. Defaults to empty string.
entrystringYesID of the entry node. Execution starts here.
nodesobjectYesMap of node ID to node definition. Keys are the node IDs.
edgesarrayYesArray of edge objects defining the graph structure.

Each key in the nodes object is a node ID (an arbitrary string you choose). The value is a node definition:

FieldTypeRequiredDefaultDescription
namestringYesDisplay name for this node.
instructionstringYesNatural language instruction telling Claude what to do at this step.
skillsstring[]No[]Skill IDs whose tools should be available at this node.
outputobjectNoJSON Schema for structured output validation.

The instruction field is the core of each node. Write it as you would write a prompt for Claude — clear, specific, and focused on a single task. Claude receives the instruction along with the workflow input and all prior node results as context.

Good instructions:

  • Focus on one task per node
  • List explicit steps (numbered or bulleted)
  • Specify what tools to use and what to look for
  • State what output is expected

The skills array lists skill IDs that should be available at this node. Each skill provides a set of tools that Claude can call.

Available skill IDs:

Skill IDCategoryTools provided
githubgitRepository operations, PRs, issues, file read/write, code search
lineartasksIssue CRUD, project/team queries, comments
sentryobservabilityError search, issue details, event data, releases
datadogobservabilityLog search, metric queries, monitor status
betterstackobservabilityIncident list, log search
slacknotificationSend messages, search channels
notificationnotificationDiscord, Teams, webhook, and email notifications

The output field accepts a JSON Schema object. When present, Claude’s response is validated against this schema, and the resulting structured data is available to downstream nodes and routing conditions.

output:
type: object
properties:
severity:
type: string
enum: [critical, high, medium, low]
root_cause:
type: string
is_fixable:
type: boolean
required: [severity, root_cause]

Any valid JSON Schema is accepted. Common patterns:

  • enum to constrain values for routing conditions
  • required to ensure key fields are always present
  • type: array with items for lists

Each entry in the edges array is an edge object:

FieldTypeRequiredDescription
fromstringYesSource node ID.
tostringYesTarget node ID.
whenstringNoNatural language condition. Claude evaluates this at runtime.

An edge without a when clause is unconditional — the executor always follows it. Use these for linear sequences:

edges:
- from: gather
to: analyze
- from: analyze
to: report

If a node has exactly one outgoing edge and that edge is unconditional, the executor follows it without invoking Claude for a routing decision.

An edge with a when clause is conditional. The when value is natural language that Claude evaluates against the current node’s result:

edges:
- from: analyze
to: fix
when: "The issue is fixable with a simple code change"
- from: analyze
to: escalate
when: "The issue requires infrastructure changes or human review"

When a node has multiple outgoing conditional edges, the executor presents all conditions as choices and asks Claude to pick the one that matches. If one edge is unconditional among conditional siblings, it acts as the default/fallback path.

A node with no outgoing edges is a terminal node. When the executor reaches a terminal node, the workflow ends. Every workflow must have at least one terminal node (otherwise execution would never stop).

id: deploy-check
name: Deployment Health Check
description: Verify a deployment succeeded and take action if it didn't
entry: check_health
nodes:
check_health:
name: Check Deployment Health
instruction: |
Check the health of the most recent deployment:
1. Look at error rates in the last 15 minutes
2. Check for new error types that appeared after deploy
3. Compare latency metrics before and after deploy
skills: [datadog, sentry]
output:
type: object
properties:
status:
type: string
enum: [healthy, degraded, failing]
error_rate_change:
type: number
new_errors:
type: array
items:
type: string
latency_p99_ms:
type: number
required: [status]
rollback:
name: Trigger Rollback
instruction: |
The deployment is failing. Create an urgent issue recommending rollback.
Include the specific errors and metrics that indicate failure.
skills: [github, slack]
investigate:
name: Investigate Degradation
instruction: |
The deployment shows degraded performance. Investigate whether this
is expected (e.g., cache warming) or a real problem. Check if
metrics are trending back toward normal.
skills: [datadog, github]
report_healthy:
name: Report Healthy
instruction: |
Deployment looks good. Post a brief confirmation to the team channel.
skills: [slack]
edges:
- from: check_health
to: rollback
when: "Deployment status is failing"
- from: check_health
to: investigate
when: "Deployment status is degraded"
- from: check_health
to: report_healthy
when: "Deployment status is healthy"

SWEny validates workflows before execution. The sweny workflow validate command runs the same checks. Every rule is listed below.

RuleError codeDescription
Entry existsMISSING_ENTRYThe entry value must match a key in nodes.
Valid edge sourcesUNKNOWN_EDGE_SOURCEEvery edge from must reference an existing node ID.
Valid edge targetsUNKNOWN_EDGE_TARGETEvery edge to must reference an existing node ID.
No self-loopsSELF_LOOPAn edge cannot have the same from and to value.
All nodes reachableUNREACHABLE_NODEEvery node must be reachable from the entry node via BFS traversal.
Known skillsUNKNOWN_SKILLIf a skill catalog is provided, all referenced skill IDs must exist in it.

Validation runs in two phases. First, structural checks (entry exists, edges reference valid nodes, no self-loops). If those pass, reachability is checked via breadth-first search from the entry node.

SWEny publishes a static JSON Schema for workflow files. Use it for editor autocomplete, CI validation, or integration with other tools:

{
"$schema": "https://json-schema.org/draft/2020-12/schema",
"$id": "https://sweny.ai/schemas/workflow.json",
"title": "SWEny Workflow",
"description": "A DAG workflow definition for skill-based orchestration",
"type": "object",
"required": ["id", "name", "nodes", "edges", "entry"],
"additionalProperties": false,
"properties": {
"id": { "type": "string", "minLength": 1 },
"name": { "type": "string", "minLength": 1 },
"description": { "type": "string" },
"entry": {
"type": "string",
"minLength": 1,
"description": "ID of the entry node"
},
"nodes": {
"type": "object",
"additionalProperties": {
"type": "object",
"required": ["name", "instruction"],
"additionalProperties": false,
"properties": {
"name": { "type": "string", "minLength": 1 },
"instruction": {
"type": "string",
"minLength": 1,
"description": "What Claude should do at this node"
},
"skills": {
"type": "array",
"items": { "type": "string" },
"description": "Skill IDs available at this node"
},
"output": {
"type": "object",
"description": "Optional JSON Schema for structured output"
}
}
}
},
"edges": {
"type": "array",
"items": {
"type": "object",
"required": ["from", "to"],
"additionalProperties": false,
"properties": {
"from": { "type": "string", "minLength": 1 },
"to": { "type": "string", "minLength": 1 },
"when": {
"type": "string",
"description": "Natural language condition — Claude evaluates at runtime"
}
}
}
}
}
}

Reference it in your YAML editor by adding a schema comment:

# yaml-language-server: $schema=https://sweny.ai/schemas/workflow.json
id: my-workflow
name: My Workflow
# ...
CommandDescription
sweny workflow validate <file>Validate a workflow YAML/JSON file. Exit 0 if valid, 1 if errors.
sweny workflow run <file>Execute a workflow file.
sweny workflow run <file> --dry-runValidate and show structure without running.
sweny workflow run <file> --jsonOutput results as JSON on stdout.
sweny workflow export triagePrint the built-in triage workflow as YAML.
sweny workflow export implementPrint the built-in implement workflow as YAML.
sweny workflow create <description>Generate a workflow from a natural-language description.
sweny workflow create <description> --jsonGenerate and output as JSON (non-interactive).
sweny workflow edit <file> [instruction]Edit a workflow file with natural-language instructions.
sweny workflow listList all available skills.
sweny workflow list --jsonList skills as JSON array.