# Function compileSpecToGraph

- compileSpecToGraph(
  markdown: string,
  options?: CompileOptions,
  ): Result<CompiledGraph, PipelineError>

  Compiles a markdown specification into an executable graph.

  Pipeline: markdown → parseSpec → decomposeSpec → GraphBuilder → CompiledGraph

  #### Parameters

  - markdown: string

    Raw markdown specification text

  - `Optional` options: CompileOptions

    Optional compile options (handler factory, etc.)

  #### Returns Result<CompiledGraph, PipelineError>

  - Defined in packages/nexus-agents/src/orchestration/spec-pipeline.ts:44