workflows

package
v0.30.8 Latest Latest
Warning

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

Go to latest
Published: Jul 6, 2026 License: MIT Imports: 11 Imported by: 0

Documentation

Index

Constants

View Source
const (
	RunStatusRunning = "running"
	RunStatusStopped = "stopped"
)

Variables

This section is empty.

Functions

func DefaultPath

func DefaultPath() string

Types

type Definition

type Definition struct {
	Name        string    `json:"name" yaml:"name"`
	Description string    `json:"description,omitempty" yaml:"description,omitempty"`
	Nodes       []Node    `json:"nodes" yaml:"nodes"`
	Edges       []Edge    `json:"edges,omitempty" yaml:"edges,omitempty"`
	Source      string    `json:"source,omitempty" yaml:"-"`
	CreatedAt   time.Time `json:"createdAt" yaml:"-"`
	UpdatedAt   time.Time `json:"updatedAt" yaml:"-"`
}

type Edge

type Edge struct {
	From string `json:"from" yaml:"from"`
	To   string `json:"to" yaml:"to"`
}

type Node

type Node struct {
	ID     string         `json:"id" yaml:"id"`
	Type   string         `json:"type" yaml:"type"`
	Prompt string         `json:"prompt,omitempty" yaml:"prompt,omitempty"`
	Inputs map[string]any `json:"inputs,omitempty" yaml:"inputs,omitempty"`
}

type Run

type Run struct {
	ID           string    `json:"id"`
	WorkflowName string    `json:"workflowName"`
	Status       string    `json:"status"`
	ParentRunID  string    `json:"parentRunId,omitempty"`
	CreatedAt    time.Time `json:"createdAt"`
	UpdatedAt    time.Time `json:"updatedAt"`
}

type Store

type Store struct {
	Definitions map[string]Definition `json:"definitions"`
	Runs        map[string]Run        `json:"runs"`
	// contains filtered or unexported fields
}

func Load

func Load(path string) (*Store, error)

func LoadDefault

func LoadDefault() (*Store, error)

func (*Store) Get

func (s *Store) Get(name string) (Definition, bool)

func (*Store) GetRun

func (s *Store) GetRun(id string) (Run, bool)

func (*Store) Install

func (s *Store) Install(def Definition) (Definition, error)

func (*Store) InstallFile

func (s *Store) InstallFile(path string) (Definition, error)

func (*Store) List

func (s *Store) List() []Definition

func (*Store) Resume

func (s *Store) Resume(id string) (Run, error)

func (*Store) Run

func (s *Store) Run(name string) (Run, error)

func (*Store) Save

func (s *Store) Save() error

func (*Store) Stop

func (s *Store) Stop(id string) error

Jump to

Keyboard shortcuts

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