runner

package
v0.0.1 Latest Latest
Warning

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

Go to latest
Published: Nov 11, 2026 License: Apache-2.0 Imports: 25 Imported by: 0 modules, 0 packages

The first number is the count of modules that contain a package that imports this one. The module count is a better indicator of popularity than the package count. A module with 100 importing packages is counted only once instead of 100 times, reflecting the fact that the choice to use the package was likely made only once, not 100 times.
A '?' means that the value hasn't been computed yet.

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func ResolveWorkflowInputs

func ResolveWorkflowInputs(doc *higharazzo.Arazzo, workflowID string, src InputSources) (map[string]any, error)

ResolveWorkflowInputs resolves workflow inputs from multiple sources in precedence order: env < env-file < inputs-file < --inputs, then applies workflow input schema defaults.

Types

type InputSources

type InputSources struct {
	Env        []string  // KEY=VALUE entries; defaults to os.Environ() when nil.
	EnvFile    string    // path to .env file; ignored when empty.
	InputsFile string    // path to JSON/YAML inputs file, or "-" for Stdin; ignored when empty.
	Inputs     string    // JSON object from --inputs flag; ignored when empty or "{}".
	Stdin      io.Reader // Stdin reader used when InputsFile == "-"; defaults to os.Stdin when nil.
}

InputSources specifies sources of workflow inputs in increasing precedence: env (ARAZZO_INPUT_<NAME>) < env-file < inputs-file < inputs (--inputs JSON flag).

type Option

type Option func(*options)

Option configures a Runner.

func WithBaseURL

func WithBaseURL(baseURL string) Option

WithBaseURL sets the default API base URL. ExecuteWorkflow overrides this when inputs contain a non-empty "baseUrl" string (as login.arazzo.yaml does).

func WithFastRetries

func WithFastRetries() Option

WithFastRetries skips waiting between Arazzo retryAfter delays. Intended for tests.

func WithHTTPClient

func WithHTTPClient(client *http.Client) Option

WithHTTPClient sets the HTTP client used for workflow steps and source fetches. If the client has no cookie jar, the runner clones it and attaches one.

func WithLogger

func WithLogger(logger *slog.Logger) Option

WithLogger sets the logger used for request traces. Secret fields are redacted.

func WithSkipValidate

func WithSkipValidate() Option

WithSkipValidate skips structural validation of the Arazzo document.

func WithTimeout

func WithTimeout(d time.Duration) Option

WithTimeout sets the HTTP client timeout when the runner creates the client.

type Result

type Result = libarazzo.WorkflowResult

Result is the outcome of a single workflow run.

type Runner

type Runner struct {
	// contains filtered or unexported fields
}

Runner loads an Arazzo document and executes its workflows. An Engine (and therefore a Runner) is not safe for concurrent use.

func FromBytes

func FromBytes(name string, data []byte, opts ...Option) (*Runner, error)

FromBytes parses, optionally validates, and prepares an Arazzo document from memory. name is used as the document path for relative source resolution.

func FromFile

func FromFile(path string, opts ...Option) (*Runner, error)

FromFile parses, optionally validates, and prepares an Arazzo document from a file path.

func (*Runner) CookieJar

func (r *Runner) CookieJar() http.CookieJar

CookieJar returns the cookie jar used across workflow steps, if any.

func (*Runner) DescribeWorkflow

func (r *Runner) DescribeWorkflow(workflowID string) (*WorkflowInfo, error)

DescribeWorkflow returns metadata for a single workflow.

func (*Runner) Document

func (r *Runner) Document() *higharazzo.Arazzo

Document returns the parsed Arazzo document.

func (*Runner) ExecuteWorkflow

func (r *Runner) ExecuteWorkflow(ctx context.Context, workflowID string, inputs map[string]any) (*Result, error)

ExecuteWorkflow runs a workflow by ID. If inputs contains "baseUrl", that value is used as the HTTP API root for this run.

func (*Runner) HTTPClient

func (r *Runner) HTTPClient() *http.Client

HTTPClient returns the client used for workflow steps (including its cookie jar).

func (*Runner) ListWorkflows

func (r *Runner) ListWorkflows() []WorkflowInfo

ListWorkflows returns metadata for every workflow in the document.

func (*Runner) ResolveWorkflowInputs

func (r *Runner) ResolveWorkflowInputs(workflowID string, src InputSources) (map[string]any, error)

ResolveWorkflowInputs merges inputs from env, env-file, inputs-file, and --inputs, coercing string types against the workflow input schema and applying schema defaults.

type StepInfo

type StepInfo struct {
	StepID        string
	Description   string
	OperationID   string
	OperationPath string
	WorkflowID    string
}

StepInfo is a brief description of one workflow step.

type WorkflowInfo

type WorkflowInfo struct {
	WorkflowID  string
	Summary     string
	Description string
	StepIDs     []string
	Steps       []StepInfo
	OutputNames []string
}

WorkflowInfo is metadata about a workflow in an Arazzo document.

Jump to

Keyboard shortcuts

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