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

# Wait for Bot Execution

> Synchronously wait for a bot execution to complete and get its outputs. This endpoint will wait until the bot has finished executing or times out after 5 minutes.



## OpenAPI

````yaml GET /webhooks/{triggerId}/trigger/invocation/{invocationId}/sync
openapi: 3.0.3
info:
  title: lil'bots Webhook Triggers API
  description: API for triggering bot executions from external platforms
  version: 1.0.0
servers:
  - url: https://www.lilbots.io/api
    description: Production server
security:
  - triggerKeyHeader: []
paths:
  /webhooks/{triggerId}/trigger/invocation/{invocationId}/sync:
    get:
      summary: Wait for bot execution to complete
      description: >-
        Synchronously wait for a bot execution to complete and get its outputs.
        This endpoint will wait until the bot has finished executing or times
        out after 5 minutes.
      operationId: waitForBotExecution
      parameters:
        - name: triggerId
          in: path
          required: true
          description: The ID of the trigger
          schema:
            type: string
        - name: invocationId
          in: path
          required: true
          description: The ID of the bot invocation received from the trigger endpoint
          schema:
            type: string
      responses:
        '200':
          description: Bot execution completed successfully
          content:
            application/json:
              schema:
                type: object
                properties:
                  success:
                    type: boolean
                  outputs:
                    type: array
                    description: The outputs returned by the bot
                    items:
                      type: object
                      additionalProperties: true
              example:
                success: true
                outputs:
                  - title: Result
                    message: Operation completed successfully
        '401':
          description: Unauthorized - Invalid trigger key
        '404':
          description: Not found - Invalid trigger ID or invocation ID
        '408':
          description: Request timeout - The bot execution is taking longer than 5 minutes
components:
  securitySchemes:
    triggerKeyHeader:
      type: apiKey
      in: header
      name: X-Key
      description: >-
        The key associated with the trigger. This key is displayed when you view
        the trigger in the UI.

````