Skip to main content

2.2 WorkflowSynapse Protocol

The WorkflowSynapse is the submission format. It is open source, fully inspectable, and any validator can reproduce any miner's score independently.

WorkflowSynapse is the Bittensor synapse that carries task packages from validators to miners and workflow plans back. Defined in cswon/protocol.py.

Class Definition

# cswon/protocol.py

import bittensor as bt
from typing import Optional

class WorkflowSynapse(bt.Synapse):
"""
Validator → Miner: carries the task package.
Miner → Validator: carries the workflow plan (populated by miner).
"""

# ── Validator-populated fields (sent to miner) ──────────────────
task_id: str = ""
task_type: str = ""
description: str = ""
quality_criteria: dict = {}
constraints: dict = {} # max_budget_tao, max_latency_seconds, allowed_subnets
available_tools: dict = {} # per-subnet cost/latency hints
send_block: int = 0 # stamped by query_loop before dispatch

# ── Miner-populated fields (returned to validator) ───────────────
miner_uid: Optional[int] = None
scoring_version: Optional[str] = None
workflow_plan: Optional[dict] = None # nodes, edges, error_handling
total_estimated_cost: Optional[float] = None
total_estimated_latency:Optional[float] = None
confidence: Optional[float] = None
reasoning: Optional[str] = None

def deserialize(self) -> "WorkflowSynapse":
return self

Field Contract

FieldSet ByTypeDescription
task_idValidatorstrUnique task identifier
task_typeValidatorstrcode, rag, agent, data_transform
descriptionValidatorstrNatural language task description
quality_criteriaValidatordictTask-specific quality requirements
constraintsValidatordictmax_budget_tao, max_latency_seconds, allowed_subnets
available_toolsValidatordictPer-subnet cost/latency hints
send_blockValidatorintBlock height at dispatch time
miner_uidMinerOptional[int]Miner's UID on the subnet
scoring_versionMinerOptional[str]Must match validator's SCORING_VERSION
workflow_planMinerOptional[dict]DAG: nodes, edges, error_handling
total_estimated_costMinerOptional[float]Sum of estimated step costs (TAO)
total_estimated_latencyMinerOptional[float]Critical path latency (seconds)
confidenceMinerOptional[float]Self-assessed confidence [0,1]
reasoningMinerOptional[str]Free-text explanation of strategy

Any Optional field left as None by the miner is treated as an invalid response and discarded.


← Previous2.1 System Architecture
→ Next2.3 DAG Execution Model
IndexDocumentation Index