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

# Build a new pipeline revision

> Create a new executable revision when the reusable pipeline instructions or connector configuration change. Do not create a revision for each run date; use the run endpoint for each execution.



## OpenAPI

````yaml /openapi.json post /v1/workspaces/{workspaceId}/pipelines/{pipelineId}/revisions
openapi: 3.1.0
info:
  title: Erna API
  version: 1.0.0
  description: >-
    AI business operations platform API.


    Erna uses a reusable pipeline lifecycle: Playbook -> Pipeline -> Revision ->
    Run.


    - A playbook defines the repeatable task type, generation behavior, and run
    input/output contract.

    - A pipeline stores reusable instructions and configuration for one
    playbook. Do not create a new pipeline for every execution.

    - A revision is the built executable version of a pipeline definition.

    - A run executes the latest ready revision with playbook-specific input.


    For scheduling, create one pipeline with the reusable business rules, staff
    context, and constraints. Then run that pipeline repeatedly with
    date-specific input such as { "input": { "dateRange": { "start":
    "2026-05-11", "end": "2026-05-17" } } }.
servers:
  - url: https://api.erna.ai
    description: Production
security:
  - bearerAuth: []
paths:
  /v1/workspaces/{workspaceId}/pipelines/{pipelineId}/revisions:
    post:
      tags:
        - Revisions
      summary: Build a new pipeline revision
      description: >-
        Create a new executable revision when the reusable pipeline instructions
        or connector configuration change. Do not create a revision for each run
        date; use the run endpoint for each execution.
      operationId: createPipelineRevision
      parameters:
        - schema:
            type: string
          required: true
          name: workspaceId
          in: path
        - schema:
            type: string
          required: true
          name: pipelineId
          in: path
        - schema:
            type: string
            minLength: 1
            example: unique-idempotency-key
          required: true
          name: Idempotency-Key
          in: header
      requestBody:
        required: true
        content:
          application/json:
            schema:
              $ref: '#/components/schemas/CreatePipelineRevisionRequest'
      responses:
        '202':
          description: Revision accepted
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/PipelineRevisionResponse'
        '400':
          description: Invalid request
          content:
            application/json:
              schema:
                type: object
                properties:
                  error:
                    type: string
                  connector:
                    type: string
                  flow:
                    type: string
                  providerError:
                    type: string
                  details:
                    type: array
                    items:
                      type: object
                      properties:
                        path:
                          type: string
                        message:
                          type: string
                      required:
                        - path
                        - message
                  message:
                    type: string
                  reason:
                    type: string
                  runId:
                    type: string
                  requiredActions:
                    type: array
                    items:
                      type: object
                      properties:
                        id:
                          type: string
                        type:
                          type: string
                          enum:
                            - connect_service
                        connector:
                          type: string
                        href:
                          type: string
                        request:
                          type: object
                          properties: {}
                          default: {}
                          additionalProperties: {}
                      required:
                        - id
                        - type
                        - connector
                        - href
                      additionalProperties: false
                  billing:
                    type: object
                    properties:
                      checkoutPath:
                        type: string
                    required:
                      - checkoutPath
                required:
                  - error
                additionalProperties: false
        '404':
          description: Pipeline not found
          content:
            application/json:
              schema:
                type: object
                properties:
                  error:
                    type: string
                  connector:
                    type: string
                  flow:
                    type: string
                  providerError:
                    type: string
                  details:
                    type: array
                    items:
                      type: object
                      properties:
                        path:
                          type: string
                        message:
                          type: string
                      required:
                        - path
                        - message
                  message:
                    type: string
                  reason:
                    type: string
                  runId:
                    type: string
                  requiredActions:
                    type: array
                    items:
                      type: object
                      properties:
                        id:
                          type: string
                        type:
                          type: string
                          enum:
                            - connect_service
                        connector:
                          type: string
                        href:
                          type: string
                        request:
                          type: object
                          properties: {}
                          default: {}
                          additionalProperties: {}
                      required:
                        - id
                        - type
                        - connector
                        - href
                      additionalProperties: false
                  billing:
                    type: object
                    properties:
                      checkoutPath:
                        type: string
                    required:
                      - checkoutPath
                required:
                  - error
                additionalProperties: false
      security:
        - bearerAuth: []
components:
  schemas:
    CreatePipelineRevisionRequest:
      type: object
      properties:
        summary:
          type: string
          minLength: 1
          description: >-
            Human-readable reason for rebuilding the reusable pipeline
            configuration.
        instructions:
          type: string
          minLength: 1
          description: >-
            Updated reusable business rules and configuration for future runs.
            Omit to keep the current instructions.
        connectors:
          type: array
          items:
            type: object
            properties:
              connector:
                type: string
                minLength: 1
                description: Connector identifier selected from the connector catalog.
              connectionId:
                type: string
                minLength: 1
                description: Stored connection id used by pipeline builds and runs.
            required:
              - connector
              - connectionId
            additionalProperties: false
          description: >-
            Updated connector set for future builds and runs. Omit to keep
            current connectors.
      required:
        - summary
      additionalProperties: false
    PipelineRevisionResponse:
      type: object
      properties:
        revisionId:
          type: string
        pipelineId:
          type: string
        status:
          type: string
          enum:
            - building
            - ready
            - failed
            - canceled
        summary:
          type: string
        error: {}
        createdAt:
          type: string
        updatedAt:
          type: string
        links:
          type: object
          properties:
            self:
              type: string
            pipeline:
              type: string
          required:
            - self
            - pipeline
          additionalProperties: false
        definition:
          type: object
          properties:
            playbookId:
              type: string
              enum:
                - scheduling
                - reporting
              description: >-
                Playbook that defines the reusable pipeline type and run input
                contract.
            instructions:
              type: string
              description: >-
                Reusable business rules and configuration used for every run of
                this pipeline. Do not put one-off run inputs such as a
                scheduling date range here.
            connectors:
              type: array
              items:
                type: object
                properties:
                  connector:
                    type: string
                    minLength: 1
                    description: Connector identifier selected from the connector catalog.
                  connectionId:
                    type: string
                    minLength: 1
                    description: Stored connection id used by pipeline builds and runs.
                required:
                  - connector
                  - connectionId
                additionalProperties: false
              description: >-
                Stored external connections available during pipeline builds and
                runs.
          required:
            - playbookId
            - instructions
            - connectors
          additionalProperties: false
        inputJsonSchema:
          type: object
          properties: {}
          additionalProperties: {}
        outputJsonSchema:
          type: object
          properties: {}
          additionalProperties: {}
        assumptions:
          type: array
          items:
            type: string
        warnings:
          type: array
          items:
            type: string
      required:
        - revisionId
        - pipelineId
        - status
        - summary
        - createdAt
        - updatedAt
        - links
        - definition
        - inputJsonSchema
        - outputJsonSchema
        - assumptions
        - warnings
      additionalProperties: false
  securitySchemes:
    bearerAuth:
      type: http
      scheme: bearer
      description: OAuth2 access token or API key

````