API Reference
Workflow JSON
The JSON format for Sophon workflows.
Overview
Workflows are stored as JSON files in ~/.sophon/workflows/.
Schema
{
"id": "wf_abc123",
"name": "Morning Briefing",
"version": 1,
"trigger": {
"type": "cron",
"expression": "0 7 * * *",
"timezone": "America/New_York"
},
"nodes": [
{
"id": "n1",
"type": "action.skill",
"position": { "x": 200, "y": 100 },
"config": { "skill": "calendar.today" }
}
],
"edges": [
{ "from": "n1", "to": "n2" }
]
}Node Types
action.skill— Run a skill toolaction.llm_prompt— LLM completionaction.send_message— Send via channelaction.execute_code— Sandbox executionaction.api_call— HTTP requestlogic.if_else— Conditionallogic.switch— Multi-branchlogic.loop— Iterationlogic.wait— Delaylogic.parallel— Concurrent executiondata.transform— Data transformationapproval.gate— Human approval
Expressions
Access data with mustache syntax:
{{ $node.n1.output }}
{{ $vars.counter + 1 }}
{{ $trigger.body.event }}