graph

package
v0.2.2 Latest Latest
Warning

This package is not in the latest version of its module.

Go to latest
Published: May 23, 2026 License: Apache-2.0 Imports: 6 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func ApplyGraph

func ApplyGraph(base core.Scenario, graph ScenarioGraph) (core.Scenario, error)

ApplyGraph merges a Studio graph into a scenario, replacing the main workflow and any named subgraph workflows present in the graph payload.

func GenerateBuilderCode

func GenerateBuilderCode(scenario core.Scenario) (string, error)

GenerateBuilderCode renders a builder-style Go snippet for the scenario workflow.

func ImportWorkflow

func ImportWorkflow(view GraphView) (core.Workflow, error)

ImportWorkflow converts a Studio graph view into a core workflow DAG.

Types

type GraphEdge

type GraphEdge struct {
	From      string `json:"from"`
	To        string `json:"to"`
	Condition string `json:"condition,omitempty"`
}

GraphEdge connects two workflow nodes.

type GraphNode

type GraphNode struct {
	ID         string          `json:"id"`
	Kind       string          `json:"kind"`
	Ref        string          `json:"ref,omitempty"`
	Input      json.RawMessage `json:"input,omitempty"`
	Condition  string          `json:"condition,omitempty"`
	DependsOn  []string        `json:"depends_on,omitempty"`
	Interrupt  bool            `json:"interrupt,omitempty"`
	Resumable  bool            `json:"resumable"`
	ResumeHint string          `json:"resume_hint,omitempty"`
}

GraphNode is a workflow node for visualization.

type GraphPosition

type GraphPosition struct {
	X float64 `json:"x"`
	Y float64 `json:"y"`
}

GraphPosition stores a Studio canvas coordinate for a node.

type GraphView

type GraphView struct {
	ID     string                   `json:"id,omitempty"`
	Nodes  []GraphNode              `json:"nodes"`
	Edges  []GraphEdge              `json:"edges"`
	Layout map[string]GraphPosition `json:"layout,omitempty"`
}

GraphView describes one workflow DAG.

type ScenarioGraph

type ScenarioGraph struct {
	Name      string               `json:"name"`
	Mode      string               `json:"mode"`
	Workflow  *GraphView           `json:"workflow,omitempty"`
	Workflows map[string]GraphView `json:"workflows,omitempty"`
}

ScenarioGraph is a Studio-friendly view of orchestration topology.

func ExportScenario

func ExportScenario(scenario core.Scenario) ScenarioGraph

ExportScenario builds a nested graph from a core.Scenario.

func MergeLayout

func MergeLayout(edited, exported ScenarioGraph) ScenarioGraph

MergeLayout copies canvas layout from edited onto exported, preserving node positions after save/reload.

Jump to

Keyboard shortcuts

? : This menu
/ : Search site
f or F : Jump to
y or Y : Canonical URL