> ## Documentation Index
> Fetch the complete documentation index at: https://docs.sagescreen.dev/llms.txt
> Use this file to discover all available pages before exploring further.

# Start full culture generation workflow

> Starts a workflow run and asynchronously fires the full culture generation
pipeline. Returns the workflow run payload immediately (~100ms). The actual
generation happens in a background thread.

The workflow type is determined by the `customizable` flag:
- `true` or `1` → `sage` workflow (full AI pipeline)
- `false` or `0` → `sage-nc` workflow (non-customizable, skips AI steps)




## OpenAPI

````yaml /openapi/private/specs/services/culture.yml post /culture/{council_sage_id}/save/full
openapi: 3.1.0
info:
  title: Culture Service API
  description: >
    Manages the culture generation pipeline for council sages. Culture
    encompasses

    the tone, instructions, intro questions, and scoring configuration that
    define

    how a sage conducts screening interviews.


    ## Authentication

    All endpoints require authentication via one of two methods:

    - **API Key**: Pass the key in the `X-Auth` header (service-to-service
    calls)

    - **JWT Token**: Pass a Bearer token in the `Authorization` header
    (user-facing calls)


    The required permission level is noted per endpoint.


    ## Culture Pipeline

    1. **Process** -- Collect all culture inputs (instructions, tone, duration,
    scoring)

    2. **Save Full** -- Start a workflow run and asynchronously generate the
    culture

    3. **Generate** -- Run the full generation pipeline (context analysis, tone
    crafting, intro questions, scoring)

    4. **Save** -- Save individual culture step results to the Prompt Library

    5. **End** -- Finalize the council sage after culture generation


    ## Business Rules

    - Culture data is stored in Redis during the generation pipeline

    - The `save/full` endpoint starts a workflow run and fires async generation

    - The `generate` endpoint validates payload via `CreateSageGenerate` schema

    - Customizable sages use the full pipeline; non-customizable sages skip AI
    tone/context steps

    - The `end` endpoint finalizes the council sage in the Prompt Library
  version: 1.0.0
  contact:
    name: Platform Team
servers:
  - url: '{protocol}://{host}:{port}'
    description: Culture Service
    variables:
      protocol:
        default: https
        enum:
          - http
          - https
      host:
        default: localhost
      port:
        default: '5000'
security: []
tags:
  - name: Culture
    description: Culture CRUD, generation, and pipeline operations
  - name: Service
    description: Health checks and initialization
paths:
  /culture/{council_sage_id}/save/full:
    post:
      tags:
        - Culture
      summary: Start full culture generation workflow
      description: >
        Starts a workflow run and asynchronously fires the full culture
        generation

        pipeline. Returns the workflow run payload immediately (~100ms). The
        actual

        generation happens in a background thread.


        The workflow type is determined by the `customizable` flag:

        - `true` or `1` → `sage` workflow (full AI pipeline)

        - `false` or `0` → `sage-nc` workflow (non-customizable, skips AI steps)
      operationId: saveCultureFull
      parameters:
        - $ref: '#/components/parameters/CouncilSageId'
        - $ref: '#/components/parameters/RequiredPermission_council_sage'
      requestBody:
        required: true
        content:
          application/json:
            schema:
              $ref: '#/components/schemas/CreateSageGenerate'
            example:
              council_sage_id: c3d4e5f6-7890-4abc-def0-123456789abc
              context_id: a1b2c3d4-e5f6-4a7b-8c9d-0e1f2a3b4c5d
              name: Senior Software Engineer
              context: We are looking for a senior software engineer...
              role: Software Engineer
              role_level: senior
              instructions: Focus on problem-solving
              duration: 30
              tone:
                - professional
              intro_question: Tell me about a challenging project
              intro_question_results: Evaluating depth
              scoring_low: 50
              scoring_exclude: []
              scoring_include:
                - 3
                - 4
                - 5
              customizable: true
      responses:
        '200':
          description: Workflow run started, generation running asynchronously
          content:
            application/json:
              schema:
                type: object
                description: Workflow run data from the workflow service
        '400':
          description: Missing council sage ID or validation error
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/ErrorResponse'
              examples:
                missingCouncilSageId:
                  summary: Missing council_sage_id
                  value:
                    error: council_sage_id is required
                noJsonBody:
                  summary: No JSON payload
                  value:
                    error: No JSON data provided
        '401':
          $ref: '#/components/responses/Unauthorized'
        '500':
          description: Error starting workflow or generation
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/ErrorResponse'
              example:
                error: >-
                  Error starting culture generation: ConnectionError('Workflow
                  service unavailable')
      security:
        - jwtAuth: []
components:
  parameters:
    CouncilSageId:
      name: council_sage_id
      in: path
      required: true
      description: UUID of the council sage
      schema:
        type: string
        format: uuid
      example: c3d4e5f6-7890-4abc-def0-123456789abc
    RequiredPermission_council_sage:
      name: X-Permission-Info
      in: header
      required: false
      description: >-
        **Required JWT permission: `council_sage`** (informational only --
        enforced server-side)
      schema:
        type: string
  schemas:
    CreateSageGenerate:
      type: object
      required:
        - council_sage_id
        - context_id
        - name
        - role
        - role_level
        - duration
        - scoring_low
      properties:
        council_sage_id:
          type: string
          format: uuid
          description: UUID of the council sage
        context_id:
          type: string
          format: uuid
          description: UUID of the context
        name:
          type: string
          description: Display name for the sage
        context:
          type: string
          default: ''
          description: Job description text
        role:
          type: string
          description: Role title
        role_level:
          type: string
          description: Experience level
        instructions:
          type: string
          default: ''
          description: Interview instructions
        duration:
          type: integer
          description: Interview duration in minutes
        tone:
          type: array
          items:
            type: string
          default: []
          description: Tone descriptors
        intro_question:
          type: string
          default: ''
          description: Opening question
        intro_question_results:
          type: string
          default: ''
          description: Evaluation criteria for intro question
        scoring_low:
          type: integer
          description: Low scoring threshold percentage
        scoring_exclude:
          type: array
          items:
            type: integer
          default: []
        scoring_include:
          type: array
          items:
            type: integer
          default: []
        customizable:
          type: boolean
          default: true
          description: >-
            Whether this is a customizable sage (true = full AI pipeline, false
            = non-customizable)
        language_code:
          type:
            - string
            - 'null'
          description: Language code for the interview
    ErrorResponse:
      type: object
      required:
        - error
      properties:
        error:
          type: string
          description: Human-readable error message
  responses:
    Unauthorized:
      description: Authentication failed
      content:
        application/json:
          schema:
            $ref: '#/components/schemas/ErrorResponse'
          examples:
            noApiKey:
              summary: Missing API key
              value:
                error: Unauthorized - API key required
            invalidApiKey:
              summary: Invalid API key
              value:
                error: Unauthorized - Invalid API key
            noToken:
              summary: Missing JWT token
              value:
                error: Unauthorized - No valid token
            invalidToken:
              summary: Invalid or expired JWT
              value:
                error: Unauthorized3
            insufficientPermissions:
              summary: Token lacks required permission
              value:
                error: Unauthorized4
  securitySchemes:
    jwtAuth:
      type: http
      scheme: bearer
      bearerFormat: JWT
      description: User JWT token passed in Authorization header

````