Documentation
¶
Index ¶
- func ResolveWorkflowInputs(doc *higharazzo.Arazzo, workflowID string, src InputSources) (map[string]any, error)
- type InputSources
- type Option
- type Result
- type Runner
- func (r *Runner) CookieJar() http.CookieJar
- func (r *Runner) DescribeWorkflow(workflowID string) (*WorkflowInfo, error)
- func (r *Runner) Document() *higharazzo.Arazzo
- func (r *Runner) ExecuteWorkflow(ctx context.Context, workflowID string, inputs map[string]any) (*Result, error)
- func (r *Runner) HTTPClient() *http.Client
- func (r *Runner) ListWorkflows() []WorkflowInfo
- func (r *Runner) ResolveWorkflowInputs(workflowID string, src InputSources) (map[string]any, error)
- type StepInfo
- type WorkflowInfo
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 ¶
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 ¶
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 ¶
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 ¶
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 ¶
FromBytes parses, optionally validates, and prepares an Arazzo document from memory. name is used as the document path for relative source resolution.
func FromFile ¶
FromFile parses, optionally validates, and prepares an Arazzo document from a file path.
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 ¶
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 ¶
ResolveWorkflowInputs merges inputs from env, env-file, inputs-file, and --inputs, coercing string types against the workflow input schema and applying schema defaults.