Condukt.Workflows.Document (Condukt v1.3.0)

Copy Markdown View Source

Loaded representation of a workflow document.

A document is the canonical form executed by Condukt.Workflows. It is produced by loading an HCL workflow or .exs workflow generator, validating the normalized map, and filling in a default name from the file basename when the normalized document omits one.

Summary

Functions

Validates a decoded document map without touching the filesystem. Useful when the document is produced in memory.

Loads, normalizes, and validates a workflow document at path.

Validates a user-provided inputs map against the document's declared inputs. Inputs without a default are required.

Functions

from_map(decoded, opts \\ [])

Validates a decoded document map without touching the filesystem. Useful when the document is produced in memory.

load(path)

Loads, normalizes, and validates a workflow document at path.

Accepts .hcl and .exs paths. Returns {:ok, %Document{}} when the file parses and matches the workflow document shape. Otherwise returns a tagged error suitable for reporting from the CLI.

validate_inputs(document, provided)

Validates a user-provided inputs map against the document's declared inputs. Inputs without a default are required.