Skip to content

Workflow DSL format spec + server-side parser #163

Description

@theuseless-ai

Goal: Define a text-based DSL for describing workflow topology and node configuration, with a Python parser on the Pipelit side for validation and import.

Context: The existing POST /validate-dsl/ endpoint validates YAML DSL. This extends it with a line-oriented format optimized for LLM consumption — compact, unambiguous, easy to diff. The DSL has two layers: topology (what connects to what) and node config (system prompts, models, tools).

DSL Format (draft):

# topology
trigger_chat -> deep_agent -> categorizer -> router
router -> auto_respond [routine]
router -> human_review [urgent]
router -> escalate [unknown]
auto_respond -> done
human_review -> done
escalate -> done

# nodes
deep_agent:
  type: agent
  model: claude-sonnet
  system: |
    You are a customer support agent...
  tools: ticket_lookup, customer_history

categorizer:
  type: agent
  model: gpt-4o-mini
  system: |
    Classify the support ticket...
  output_parser: json {category, urgency, summary}

router:
  type: switch
  field: categorizer.urgency

Acceptance Criteria:

  • DSL format spec documented
  • Python parser: DSL text → workflow + nodes + edges data structures
  • Parser validates topology (no orphans, valid edge types, no missing targets)
  • Parser validates node configs (required fields per component_type)
  • POST /api/v1/workflows/import-dsl/ endpoint — accepts DSL text, creates workflow + nodes + edges
  • GET /api/v1/workflows/{slug}/export-dsl/ endpoint — exports existing workflow as DSL text
  • Round-trip fidelity: export → import produces equivalent workflow
  • Unit tests for parser edge cases

Dependencies: None

Priority: P0 (foundation for prompt chain agents)

Metadata

Metadata

Assignees

No one assigned

    Labels

    enhancementNew feature or request

    Type

    No type

    Fields

    No fields configured for issues without a type.

    Projects

    Status
    Backlog

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions