Sophon Docs
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 tool
  • action.llm_prompt — LLM completion
  • action.send_message — Send via channel
  • action.execute_code — Sandbox execution
  • action.api_call — HTTP request
  • logic.if_else — Conditional
  • logic.switch — Multi-branch
  • logic.loop — Iteration
  • logic.wait — Delay
  • logic.parallel — Concurrent execution
  • data.transform — Data transformation
  • approval.gate — Human approval

Expressions

Access data with mustache syntax:

{{ $node.n1.output }}
{{ $vars.counter + 1 }}
{{ $trigger.body.event }}