Skip to content

SWEny Workflow Specification v1.0

The SWEny Workflow Specification defines a YAML-based format for describing AI agent orchestration as a directed graph. Each node in the graph contains a natural language instruction executed by an AI model, with access to a declared set of skills (tool bundles). Edges define execution flow, with optional natural language conditions evaluated at runtime by the AI model.

This specification defines the format and its execution semantics. It is independent of any particular AI model, runtime, or hosting environment.

Version: 1.0
Status: Draft
License: Apache 2.0

The key words “MUST”, “MUST NOT”, “REQUIRED”, “SHALL”, “SHALL NOT”, “SHOULD”, “SHOULD NOT”, “RECOMMENDED”, “MAY”, and “OPTIONAL” in this specification are to be interpreted as described in RFC 2119.

  • MUST / REQUIRED / SHALL — absolute requirement.
  • MUST NOT / SHALL NOT — absolute prohibition.
  • SHOULD / RECOMMENDED — valid reasons may exist to deviate, but implications must be understood.
  • MAY / OPTIONAL — truly optional; implementations may or may not include the feature.
SectionDescription
WorkflowTop-level document structure: id, name, nodes, edges, entry.
NodesThe Node object: instruction, skills, output schema.
Edges & RoutingThe Edge object: when conditions, max_iterations, routing algorithm.
Skills & ToolsSkill and Tool interfaces: config resolution, tool invocation contract.
Execution ModelContext accumulation, node execution, events, trace, dry-run semantics.

Canonical JSON Schemas for use with IDE autocomplete, CI validation, and alternative implementations:

Reference a schema from a YAML workflow file:

# $schema: https://spec.sweny.ai/schemas/workflow.json
id: my-workflow
name: My Workflow
entry: start
nodes:
start:
name: Start
instruction: Do the thing.
edges: []

The reference implementation is @sweny-ai/core, published on npm. Source code, built-in workflows, and tests are available in the SWEny monorepo.

This specification follows semantic versioning:

  • Non-breaking additions (new optional fields, new event types) are additive to the current version.
  • Breaking changes (field removals, semantic changes) require a new major version.

The current version lives at the root (spec.sweny.ai/). When v2 ships, v1 will move to spec.sweny.ai/v1/.