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

<AgentInstructions>

## Submitting Feedback

If you encounter incorrect, outdated, or confusing documentation on this page, submit feedback:

POST https://docs.restate.dev/feedback

```json
{
  "path": "/admin-api/invocation/restart-invocation-as-new",
  "feedback": "Description of the issue"
}
```

Only submit feedback when you have something specific and actionable to report.

</AgentInstructions>

# Restart invocation as new

> Creates a new invocation from a completed invocation, optionally copying partial progress from the original invocation's journal.
The new invocation will have a different invocation ID. Use the `from` parameter to specify how much of the original journal to preserve.



## OpenAPI

````yaml /schemas/openapi-admin.json patch /invocations/{invocation_id}/restart-as-new
openapi: 3.1.0
info:
  title: Admin API
  description: >-
    This API exposes the admin operations of a Restate cluster, such as
    registering new service deployments, interacting with running invocations,
    register Kafka subscriptions, retrieve service metadata. For an overview,
    check out the [Operate documentation](https://docs.restate.dev/operate/). If
    you're looking for how to call your services, check out the [Ingress HTTP
    API](https://docs.restate.dev/invoke/http) instead.
  contact:
    name: restate.dev
  license:
    name: MIT
    url: https://opensource.org/license/mit
  version: 1.6.2
servers: []
security: []
tags:
  - name: deployment
    description: Service Deployment management
  - name: invocation
    description: Invocation management
    externalDocs:
      url: https://docs.restate.dev/operate/invocation
      description: Invocations documentation
  - name: subscription
    description: Subscription management
    externalDocs:
      url: https://docs.restate.dev/operate/invocation#managing-kafka-subscriptions
      description: Kafka subscriptions documentation
  - name: service
    description: Service management
  - name: service_handler
    description: Service handlers metadata
  - name: cluster_health
    description: Cluster health
  - name: health
    description: Admin API health
  - name: version
    description: API Version
  - name: introspection
    description: System introspection
externalDocs:
  url: https://docs.restate.dev/operate/
  description: Restate operations documentation
paths:
  /invocations/{invocation_id}/restart-as-new:
    patch:
      tags:
        - invocation
      summary: Restart invocation as new
      description: >-
        Creates a new invocation from a completed invocation, optionally copying
        partial progress from the original invocation's journal.

        The new invocation will have a different invocation ID. Use the `from`
        parameter to specify how much of the original journal to preserve.
      operationId: restart_as_new_invocation
      parameters:
        - name: invocation_id
          in: path
          description: Invocation identifier.
          required: true
          schema:
            type: string
        - name: from
          in: query
          description: >-
            From which entry index the invocation should restart from.

            By default the invocation restarts from the beginning (equivalent to
            'from = 0'), retaining only the input of the original invocation.

            When greater than 0, the new invocation will copy the old journal
            prefix up to 'from' included, plus eventual completions for commands
            in the given prefix.

            If the journal prefix contains commands that have not been
            completed, this operation will fail.
          required: false
          schema:
            oneOf:
              - type: 'null'
              - $ref: '#/components/schemas/u32'
        - name: deployment
          in: query
          description: >-
            When restarting from journal prefix, provide a deployment id to use
            to replace the currently pinned deployment id.

            If 'latest', use the latest deployment id. If 'keep', keeps the
            pinned deployment id.

            When not provided, the invocation will resume on latest.

            Note: this parameter can be used only in combination with 'from'.
          required: false
          schema:
            oneOf:
              - type: 'null'
              - oneOf:
                  - type: string
                    description: Keep the currently pinned deployment
                    enum:
                      - Keep
                  - type: string
                    description: Use the latest deployment
                    enum:
                      - Latest
                  - type: object
                    description: Use a specific deployment ID
                    required:
                      - Id
                    properties:
                      Id:
                        type: string
                        description: Use a specific deployment ID
                description: >-
                  Specifies which deployment to use when resuming or restarting
                  an invocation.
      responses:
        '200':
          description: Invocation restarted successfully with a new invocation ID
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/RestartAsNewInvocationResponse'
        '400':
          description: >-
            The selected deployment id to restart as new the invocation doesn't
            support the currently pinned service protocol version.
          content:
            application/json:
              schema:
                type: object
                description: |-
                  # Error description response

                  Error details of the response
                required:
                  - message
                properties:
                  message:
                    type: string
                  restate_code:
                    type:
                      - string
                      - 'null'
                    description: |-
                      # Restate code

                      Restate error code describing this error
        '404':
          description: ''
          content:
            application/json:
              schema:
                type: object
                description: |-
                  # Error description response

                  Error details of the response
                required:
                  - message
                properties:
                  message:
                    type: string
                  restate_code:
                    type:
                      - string
                      - 'null'
                    description: |-
                      # Restate code

                      Restate error code describing this error
        '409':
          description: >-
            The invocation is still running or the deployment id is not pinned
            yet, deployment id cannot be changed. The deployment id can be
            changed only if the invocation is paused or suspended, and a
            deployment id is already pinned.
          content:
            application/json:
              schema:
                type: object
                description: |-
                  # Error description response

                  Error details of the response
                required:
                  - message
                properties:
                  message:
                    type: string
                  restate_code:
                    type:
                      - string
                      - 'null'
                    description: |-
                      # Restate code

                      Restate error code describing this error
        '410':
          description: >-
            The invocation cannot be restarted because the input is not
            available. In order to restart an invocation, the journal must be
            available in order to read the input again. Journal can be retained
            after completion by enabling journal retention.
          content:
            application/json:
              schema:
                type: object
                description: |-
                  # Error description response

                  Error details of the response
                required:
                  - message
                properties:
                  message:
                    type: string
                  restate_code:
                    type:
                      - string
                      - 'null'
                    description: |-
                      # Restate code

                      Restate error code describing this error
        '422':
          description: >-
            Restarting the invocation is not supported. Restarting workflows is
            not supported, and restarting invocations created using the old
            service protocol.
          content:
            application/json:
              schema:
                type: object
                description: |-
                  # Error description response

                  Error details of the response
                required:
                  - message
                properties:
                  message:
                    type: string
                  restate_code:
                    type:
                      - string
                      - 'null'
                    description: |-
                      # Restate code

                      Restate error code describing this error
        '425':
          description: >-
            The invocation cannot be restarted because it's not running yet,
            meaning it might have been scheduled or inboxed.
          content:
            application/json:
              schema:
                type: object
                description: |-
                  # Error description response

                  Error details of the response
                required:
                  - message
                properties:
                  message:
                    type: string
                  restate_code:
                    type:
                      - string
                      - 'null'
                    description: |-
                      # Restate code

                      Restate error code describing this error
        '503':
          description: Error when routing the request within restate.
          content:
            application/json:
              schema:
                type: object
                description: |-
                  # Error description response

                  Error details of the response
                required:
                  - message
                properties:
                  message:
                    type: string
                  restate_code:
                    type:
                      - string
                      - 'null'
                    description: |-
                      # Restate code

                      Restate error code describing this error
components:
  schemas:
    u32:
      type: integer
      format: int32
      minimum: 0
    RestartAsNewInvocationResponse:
      type: object
      description: The invocation was restarted as new.
      required:
        - new_invocation_id
      properties:
        new_invocation_id:
          $ref: '#/components/schemas/String'
          description: The invocation id of the new invocation.
    String:
      type: string

````