# Function loadTemplateFile

Workflows exports - Workflow engine with parallel execution Split from index.ts for file size compliance (Issue #285)

- loadTemplateFile(
  filePath: string,
  allowedRoot?: string,
  ): Promise<Result<ParsedTemplate, SecurityError | ParseError>>

  Load a template from a file path.

  #### Parameters

  - filePath: string

    Path to the YAML template file

  - `Optional` allowedRoot: string

    Optional root directory for path validation (skipped if undefined)

  #### Returns Promise<Result<ParsedTemplate, SecurityError | ParseError>>

  Result with ParsedTemplate or ParseError/SecurityError

  - Defined in packages/nexus-agents/src/workflows/template-loader.ts:163