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

# Set how a queued message reaches the running turn

> Changes the delivery of a message still waiting in the queue. `live`: the running turn reads it at its next step, before finishing its current work, when that turn is yours (same person and role); otherwise it waits like the default. `eventually` (the default of every send): it waits for the running turn to end and runs as the next turn. A message set to move the chat to another branch cannot be `live`, because a live message never moves the chat (400). A message that has already started into a turn is left as it is.



## OpenAPI

````yaml /openapi/customer-api.json patch /ai/agents/{id}/messages/{jobId}
openapi: 3.0.0
info:
  contact: {}
  description: >-
    Flow customer API reference. Start with the [quickstart](/api/quickstart)
    and [authentication guide](/api/authentication).
  title: Customer API
  version: 1.0.0
servers:
  - description: Flow API
    url: '{baseUrl}'
    variables:
      baseUrl:
        default: https://backend.branch.flowengineering.com
security: []
tags:
  - name: Audit
  - name: Automations
  - name: Branches
  - name: Comments
  - name: Convert
  - name: Data Model
  - name: Diagrams
  - name: Entities
  - name: Events
  - name: Files
  - name: Import
  - name: Notifications
  - name: Persistent agents
  - name: Projects
  - name: ReqIF
  - name: ReqIF Import
  - name: Review policy
  - name: Shared Access Grants
  - name: User Groups
  - name: Users
  - name: Views
paths:
  /ai/agents/{id}/messages/{jobId}:
    patch:
      tags:
        - Automations
      summary: Set how a queued message reaches the running turn
      description: >-
        Changes the delivery of a message still waiting in the queue. `live`:
        the running turn reads it at its next step, before finishing its current
        work, when that turn is yours (same person and role); otherwise it waits
        like the default. `eventually` (the default of every send): it waits for
        the running turn to end and runs as the next turn. A message set to move
        the chat to another branch cannot be `live`, because a live message
        never moves the chat (400). A message that has already started into a
        turn is left as it is.
      operationId: AgentChatController_setQueuedMessageDelivery
      parameters:
        - in: path
          name: id
          required: true
          schema:
            type: string
        - in: path
          name: jobId
          required: true
          schema:
            type: string
        - description: Workspace identifier
          in: header
          name: customer
          required: true
          schema:
            type: string
      requestBody:
        content:
          application/json:
            schema:
              $ref: '#/components/schemas/QueuedMessageDeliveryDto'
        required: true
      responses:
        '200':
          description: Queued message delivery set
      security:
        - api-key: []
        - bearer: []
components:
  schemas:
    QueuedMessageDeliveryDto:
      properties:
        delivery:
          description: >-
            How the waiting message reaches the chat. `live`: the running turn
            reads it at its next step, so the agent sees it before finishing its
            current work; this needs the running turn to be yours (same person
            and role), otherwise the message waits like the default.
            `eventually`: it waits for the running turn to end and runs as the
            next turn, which every send does unless set otherwise.
          enum:
            - live
            - eventually
          type: string
      required:
        - delivery
      type: object
  securitySchemes:
    api-key:
      in: header
      name: X-API-Key
      type: apiKey
    bearer:
      bearerFormat: JWT
      scheme: bearer
      type: http

````

This documentation is built and hosted on [Mintlify](https://mintlify.com), a developer documentation platform.