Synapse.Workflow.Spec (Synapse v0.1.1)

View Source

Declarative workflow specification consumed by Synapse.Workflow.Engine.

Provides helper builders for steps and outputs plus validation to ensure dependencies reference known step identifiers.

Summary

Functions

Builds a workflow spec from keyword options.

Convenience helper for creating an output mapping.

Types

t()

@type t() :: %Synapse.Workflow.Spec{
  description: String.t() | nil,
  metadata: map(),
  name: atom(),
  outputs: [Synapse.Workflow.Spec.Output.t()],
  steps: [Synapse.Workflow.Spec.Step.t()]
}

Functions

new(opts)

@spec new(keyword()) :: t()

Builds a workflow spec from keyword options.

  • :name - atom identifier used in telemetry/audit (default: :workflow)
  • :description - optional human readable description
  • :steps - required list of step structs/definitions
  • :outputs - optional list of outputs mapping results to response keys
  • :metadata - arbitrary map stored on the spec

output(key, opts)

@spec output(
  atom(),
  keyword()
) :: Synapse.Workflow.Spec.Output.t()

Convenience helper for creating an output mapping.