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

# Get status of an asynchronous execution on a Devbox.

> Get the latest status of a previously launched asynchronous execuction including stdout/error and the exit code if complete.



## OpenAPI

````yaml /openapi-specs/stainless-processed-openapi.json get /v1/devboxes/{devbox_id}/executions/{execution_id}
openapi: 3.1.0
info:
  title: RunLoop API
  version: '0.1'
  description: >-
    The RunLoop API spec that allows you to host lambda functions and Devboxes
    to enable scaled long running ai workflows.
  contact:
    name: Runloop AI Support
    url: https://runloop.ai
    email: support@runloop.ai
servers:
  - url: https://api.runloop.ai
    description: Runloop API
    variables: {}
security:
  - bearerAuth: []
tags:
  - name: Benchmark
  - name: Blueprint
  - name: Blueprint-Lifecycle
  - name: Blueprint-ObservabilityTools
  - name: Devbox
  - name: Devbox-FileTools
  - name: Devbox-Lifecycle
  - name: Devbox-NetworkTools
  - name: Devbox-ObservabilityTools
  - name: Devbox-PersistenceTools
  - name: Devbox-ShellTools
  - name: Scenario
  - name: ScenarioScorer
  - name: accounts
  - name: agents
  - name: apikeys
  - name: axons
  - name: executions
  - name: gateway-configs
  - name: mcp-configs
  - name: network-policies
  - name: objects
  - name: restricted_keys
  - name: secrets
  - name: streaming
paths:
  /v1/devboxes/{devbox_id}/executions/{execution_id}:
    get:
      tags:
        - Devbox
        - Devbox-ShellTools
      summary: Get status of an asynchronous execution on a Devbox.
      description: >-
        Get the latest status of a previously launched asynchronous execuction
        including stdout/error and the exit code if complete.
      operationId: queryAsyncCommand
      parameters:
        - name: devbox_id
          in: path
          description: The Devbox ID
          required: true
          schema:
            type: string
        - name: execution_id
          in: path
          description: The Execution ID
          required: true
          schema:
            type: string
        - name: last_n
          in: query
          description: >-
            Last n lines of standard error / standard out to return (default:
            100)
          allowEmptyValue: true
          schema:
            type: string
      responses:
        '200':
          description: OK
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/DevboxAsyncExecutionDetailView'
        '404':
          description: Devbox not found.
      x-codeSamples:
        - lang: JavaScript
          source: >-
            import Runloop from '@runloop/api-client';


            const client = new Runloop({
              bearerToken: process.env['RUNLOOP_API_KEY'], // This is the default and can be omitted
            });


            const devboxAsyncExecutionDetailView = await
            client.devboxes.executions.retrieve(
              'devbox_id',
              'execution_id',
            );


            console.log(devboxAsyncExecutionDetailView.devbox_id);
        - lang: Python
          source: >-
            import os

            from runloop_api_client import Runloop


            client = Runloop(
                bearer_token=os.environ.get("RUNLOOP_API_KEY"),  # This is the default and can be omitted
            )

            devbox_async_execution_detail_view =
            client.devboxes.executions.retrieve(
                execution_id="execution_id",
                devbox_id="devbox_id",
            )

            print(devbox_async_execution_detail_view.devbox_id)
components:
  schemas:
    DevboxAsyncExecutionDetailView:
      type: object
      properties:
        devbox_id:
          type: string
          description: Devbox id where command was executed.
        execution_id:
          type: string
          description: Ephemeral id of the execution in progress.
        status:
          $ref: '#/components/schemas/DevboxExecutionStatus'
          description: Current status of the execution.
        shell_name:
          description: Shell name.
          type:
            - string
            - 'null'
        stdout:
          description: >-
            Standard out generated by command. This field will remain unset
            until the execution has completed.
          type:
            - string
            - 'null'
        stderr:
          description: >-
            Standard error generated by command. This field will remain unset
            until the execution has completed.
          type:
            - string
            - 'null'
        exit_status:
          format: int32
          description: >-
            Exit code of command execution. This field will remain unset until
            the execution has completed.
          type:
            - integer
            - 'null'
        stdout_truncated:
          description: Indicates whether the stdout was truncated due to size limits.
          type:
            - boolean
            - 'null'
        stderr_truncated:
          description: Indicates whether the stderr was truncated due to size limits.
          type:
            - boolean
            - 'null'
      required:
        - devbox_id
        - execution_id
        - status
    DevboxExecutionStatus:
      type: string
      enum:
        - queued
        - running
        - completed
  securitySchemes:
    bearerAuth:
      scheme: bearer
      type: http

````