Skip to main content
Version: Next — Unreleased

WorkflowDefinition schema

The workflow document type, validated against the published JSON schema.

Example

workflow.json
{
"kind": "WORKFLOW",
"schemaVersion": 1,
"id": "quick-start",
"name": "Quick Start",
"description": "A single agent step that completes immediately — the shortest runnable workflow.",
"steps": [
{
"kind": "STEP",
"stepId": "greet",
"name": "Greet",
"behaviour": {
"type": "AGENT",
"agentRef": "quick-start-agent",
"transition": "AUTO"
}
}
]
}

Properties

PropertyTypeRequiredDescription
kindconst WORKFLOWyes
schemaVersionconst 1yesWorkflow definition format version this document is authored against. Required; consumers accept only schema versions they know and reject anything else. The framework's supported version is the single compatibility contract across framework, catalog, and builder releases.
idstringyesUnique workflow identifier. Must match the workflow directory name stem.
namestringyesHuman-readable workflow name.
descriptionstringnoOptional workflow description.
uuidstring (uuid)noOptional stable workflow identity for server-side cost estimates (independent of directory id).
stepsarray of Executableyes
requirementsarray of WorkflowRequirementnoCentral, self-targeting requirement declarations. Opaque to the framework; interpreted by the configured RequirementResolver keyed on requirement type.

Definitions

WorkflowRequirement

PropertyTypeRequiredDescription
idstringyesUnique requirement id within the workflow.
typestringyesOpaque requirement type; interpreted by the configured RequirementResolver. Not interpreted by the framework core.
scopeenum (WORKFLOW, STEP, STEP_ACTION)yes
stepIdstringnoTarget step id when scope is STEP or STEP_ACTION.
actionstringnoOpaque target action when scope is STEP_ACTION.
requiredbooleannoWhether the workflow cannot run unless this requirement resolves.
defaultobjectnoOptional opaque default payload; carried as raw JSON and never interpreted by the framework.
resolutionenum (INSTALL, RUN_START, INSTALL_OR_RUN_START, DEFERRED)yes

Executable

No properties.

StepDefinition

PropertyTypeRequiredDescription
kindconst STEPyes
stepIdstringyes
namestringyes
behaviourStepBehaviouryes
contextMappingContextMappingno
stepPromptstringnoOptional prompt content for the step; may be blank depending on behaviour.
maxUserPromptRoundsintegernoMaximum blocking USER_PROMPT pauses for this step before the run fails.
modelTierenum (LITE, STANDARD, POWERFUL, null)noOptional capability tier overriding the agent tier for this step. A raw model pin always wins over the tier. Null inherits the agent tier.
estimatedInputTokensintegernoOptional execution-estimation hint: expected input tokens consumed by this step. Advisory only; never affects runtime behaviour.
estimatedOutputTokensintegernoOptional execution-estimation hint: expected output tokens generated by this step. Advisory only; never affects runtime behaviour.

BlueprintRef

PropertyTypeRequiredDescription
kindconst BLUEPRINT_REFyes
blueprintIdstringyes

StepBehaviour

PropertyTypeRequiredDescription
typeenum (AGENT, SPAR, WORKFLOW, INPUT, RESOURCE, BRANCH, FAIL, RETRY_PREVIOUS, VALIDATE, ASSIGN_CONTEXT, AGGREGATE)yes

AgentBehaviour

PropertyTypeRequiredDescription
typeconst AGENTyes
agentRefstringyes
transitionStepTransitionyes
retryPolicyRetryPolicyno

SparBehaviour

PropertyTypeRequiredDescription
typeconst SPARyes
agentRefstringyes
sparConfigSparConfigyes
transitionStepTransitionyes
retryPolicyRetryPolicyno

WorkflowBehaviour

PropertyTypeRequiredDescription
typeconst WORKFLOWyes
workflowRefstringyes
transitionStepTransitionyes

InputBehaviour

PropertyTypeRequiredDescription
typeconst INPUTyes
artifactIdstringyes
transitionStepTransitionyes

ResourceBehaviour

PropertyTypeRequiredDescription
typeconst RESOURCEyes
resourcePathstringyesResource path resolved by the runtime resource resolver under allowed roots.
contextKeystringyesContext key under which the resource content is stored.
transitionStepTransitionyes

BranchBehaviour

PropertyTypeRequiredDescription
typeconst BRANCHyes
contextKeystringyes
branchesobjectno
predicatesarray of BranchPredicatenoOrdered predicates evaluated before the exact-match branches; first match wins.
defaultBranchExecutableno
failOnUnmatchedbooleannoWhen true, an unmatched value with no defaultBranch fails the run instead of completing.

BranchPredicate

PropertyTypeRequiredDescription
kindenum (MEMBER_OF, EMPTY)yes
membersarray of stringno
targetnull | Executableno

FailBehaviour

PropertyTypeRequiredDescription
typeconst FAILyes
reasonstringyes

RetryPreviousBehaviour

PropertyTypeRequiredDescription
typeconst RETRY_PREVIOUSyes
retryStepIdstringyes
retryModeenum (SINGLE_STEP, FROM_STEP)yes
maxAttemptsintegeryes
fallbackExecutableyes

ValidateBehaviour

PropertyTypeRequiredDescription
typeconst VALIDATEyes
validatorIdstringyesId of the ArtifactValidator applied to the captured artifacts.
requiredArtifactsarray of stringyesAllowlist of artifact paths that must be exactly present (no unexpected files).
contextEqualityContractsarray of ContextEqualityContractno

ContextEqualityContract

PropertyTypeRequiredDescription
artifactPathstringyes
jsonPointerstringyes
contextKeystringyes

AggregateBehaviour

PropertyTypeRequiredDescription
typeconst AGGREGATEyes
aggregatorIdstringyesId of the registered ContextAggregator applied over this step's declared contextMapping input keys.
outputContextKeyPrefixstringyesPrefix every field returned by the aggregator is written under, joined with '.'.
transitionStepTransitionyes

AssignContextBehaviour

PropertyTypeRequiredDescription
typeconst ASSIGN_CONTEXTyes
contextKeystringyes
valueScalarContextValueyes

ScalarContextValue

PropertyTypeRequiredDescription
typeenum (STRING, NUMBER, BOOLEAN)yes
valueobjectyes

StepTransition

No properties.

SparConfig

PropertyTypeRequiredDescription
challengerAgentIdstringyes
maxRoundsintegeryes
resolutionPromptstringyes

RetryPolicy

PropertyTypeRequiredDescription
allowRetrybooleanno
allowRetryFromPreviousbooleanno
maxAttemptsintegerno

ContextMapping

PropertyTypeRequiredDescription
inputKeysarray of stringno
outputKeysarray of stringno