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

# Answer a workflow's question

> Answers the question being asked (`key`), or skips an optional one (`value` null), and returns the next question — or, after the last, the task to send. A `key` that isn't the question being asked is a 409.



## OpenAPI

````yaml post /api/chat/threads/{thread_id}/workflow/answer
openapi: 3.1.0
info:
  title: Nx1 AI API
  description: |

    AI API for Nx1 Data Platform Management and Automated Data Tasks.

    Authentication is required via PSK in Authorization header.

    Default PSK is | [ask a friend] |
  version: 0.10.2
servers: []
security: []
paths:
  /api/chat/threads/{thread_id}/workflow/answer:
    post:
      tags:
        - Chat
      summary: Answer a workflow's question
      description: >-
        Answers the question being asked (`key`), or skips an optional one
        (`value` null), and returns the next question — or, after the last, the
        task to send. A `key` that isn't the question being asked is a 409.
      operationId: answer_workflow_api_chat_threads__thread_id__workflow_answer_post
      parameters:
        - name: thread_id
          in: path
          required: true
          schema:
            type: string
            format: uuid
            title: Thread Id
      requestBody:
        required: true
        content:
          application/json:
            schema:
              $ref: '#/components/schemas/WorkflowAnswerRequest'
      responses:
        '200':
          description: Successful Response
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/ChatWorkflowProgress'
        '403':
          description: You can't post in this chat.
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/ErrorResponse'
        '404':
          description: Thread or workflow not found.
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/ErrorResponse'
        '409':
          description: >-
            Not now: the chat has messages, the step was sent, or the workflow
            is no longer available.
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/ErrorResponse'
        '422':
          description: An answer the form can't take.
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/ErrorResponse'
        '500':
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/ErrorResponse'
          description: Internal Server Error
      security:
        - OAuth2AuthorizationCodeBearer: []
        - APIKeyHeader: []
components:
  schemas:
    WorkflowAnswerRequest:
      properties:
        key:
          type: string
          pattern: ^[a-z][a-z0-9_]{0,39}$
          title: Key
          description: The question being answered, so a stale tab can't answer another.
        value:
          anyOf:
            - type: string
              maxLength: 4000
            - type: 'null'
          title: Value
      type: object
      required:
        - key
      title: WorkflowAnswerRequest
      description: Answer the question being asked, or skip it (``value`` null).
    ChatWorkflowProgress:
      properties:
        item_id:
          type: string
          format: uuid
          title: Item Id
        version:
          anyOf:
            - type: string
            - type: 'null'
          title: Version
          description: The version it follows.
        title:
          type: string
          title: Title
        transcript:
          items:
            $ref: '#/components/schemas/WorkflowTranscriptEntry'
          type: array
          title: Transcript
        current:
          anyOf:
            - $ref: '#/components/schemas/ChatWorkflowQuestionOut'
            - type: 'null'
          description: The question waiting for an answer; null once done.
        total:
          type: integer
          title: Total
          description: Questions the workflow can ask.
        done:
          type: boolean
          title: Done
          default: false
        task:
          anyOf:
            - type: string
            - type: 'null'
          title: Task
          description: 'Once done: the message to send to the assistant.'
        available:
          type: boolean
          title: Available
          description: False when the version was withdrawn or is no longer yours to see.
          default: true
        can_continue:
          type: boolean
          title: Can Continue
          description: 'Whether you may answer: who started it, or a manager.'
          default: true
      type: object
      required:
        - item_id
        - title
        - total
      title: ChatWorkflowProgress
      description: Where a workflow conversation stands.
    ErrorResponse:
      properties:
        error:
          type: string
          title: Error
          description: A brief description of the error that occurred.
        code:
          type: integer
          title: Code
          description: The HTTP status code associated with the error.
          default: 500
      type: object
      required:
        - error
      title: ErrorResponse
    WorkflowTranscriptEntry:
      properties:
        key:
          type: string
          title: Key
        question:
          type: string
          title: Question
        answer:
          anyOf:
            - type: string
            - type: 'null'
          title: Answer
          description: Null when skipped.
      type: object
      required:
        - key
        - question
      title: WorkflowTranscriptEntry
      description: A question asked and how it was answered.
    ChatWorkflowQuestionOut:
      properties:
        key:
          type: string
          title: Key
        text:
          type: string
          title: Text
        type:
          type: string
          enum:
            - choice
            - text
            - number
            - date
            - yes_no
          title: Type
        choices:
          items:
            type: string
          type: array
          title: Choices
        allow_other:
          type: boolean
          title: Allow Other
        required:
          type: boolean
          title: Required
        placeholder:
          anyOf:
            - type: string
            - type: 'null'
          title: Placeholder
        number:
          type: integer
          title: Number
          description: 1-based, counting the questions asked so far.
      type: object
      required:
        - key
        - text
        - type
        - allow_other
        - required
        - number
      title: ChatWorkflowQuestionOut
      description: The question being asked.
  securitySchemes:
    OAuth2AuthorizationCodeBearer:
      type: oauth2
      flows:
        authorizationCode:
          scopes: {}
          authorizationUrl: >-
            https://sso-rapid.rapid.nx1cloud.com/realms/rapid/protocol/openid-connect/auth
          tokenUrl: >-
            https://sso-rapid.rapid.nx1cloud.com/realms/rapid/protocol/openid-connect/token
    APIKeyHeader:
      type: apiKey
      in: header
      name: Authorization-PSK

````

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