Apache Airflow XCom API

The XCom API from Apache Airflow — 2 operation(s) for xcom.

OpenAPI Specification

airflow-xcom-api-openapi.yml Raw ↑
openapi: 3.1.0
info:
  title: Airflow Asset XCom API
  description: Airflow API. All endpoints located under ``/api/v2`` can be used safely, are stable and backward compatible. Endpoints located under ``/ui`` are dedicated to the UI and are subject to breaking change depending on the need of the frontend. Users should not rely on those but use the public ones instead.
  version: '2'
tags:
- name: XCom
paths:
  /api/v2/dags/{dag_id}/dagRuns/{dag_run_id}/taskInstances/{task_id}/xcomEntries/{xcom_key}:
    get:
      tags:
      - XCom
      summary: Airflow Get Xcom Entry
      description: Get an XCom entry.
      operationId: get_xcom_entry
      security:
      - OAuth2PasswordBearer: []
      - HTTPBearer: []
      parameters:
      - name: dag_id
        in: path
        required: true
        schema:
          type: string
          title: Dag Id
      - name: task_id
        in: path
        required: true
        schema:
          type: string
          title: Task Id
      - name: dag_run_id
        in: path
        required: true
        schema:
          type: string
          title: Dag Run Id
      - name: xcom_key
        in: path
        required: true
        schema:
          type: string
          title: Xcom Key
      - name: map_index
        in: query
        required: false
        schema:
          type: integer
          minimum: -1
          default: -1
          title: Map Index
      - name: deserialize
        in: query
        required: false
        schema:
          type: boolean
          default: false
          title: Deserialize
      - name: stringify
        in: query
        required: false
        schema:
          type: boolean
          default: false
          title: Stringify
      responses:
        '200':
          description: Successful Response
          content:
            application/json:
              schema:
                anyOf:
                - $ref: '#/components/schemas/XComResponseNative'
                - $ref: '#/components/schemas/XComResponseString'
                title: Response Get Xcom Entry
        '401':
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/HTTPExceptionResponse'
          description: Unauthorized
        '403':
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/HTTPExceptionResponse'
          description: Forbidden
        '400':
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/HTTPExceptionResponse'
          description: Bad Request
        '404':
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/HTTPExceptionResponse'
          description: Not Found
        '422':
          description: Validation Error
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/HTTPValidationError'
      x-microcks-operation:
        delay: 0
        dispatcher: FALLBACK
    patch:
      tags:
      - XCom
      summary: Airflow Update Xcom Entry
      description: Update an existing XCom entry.
      operationId: update_xcom_entry
      security:
      - OAuth2PasswordBearer: []
      - HTTPBearer: []
      parameters:
      - name: dag_id
        in: path
        required: true
        schema:
          type: string
          title: Dag Id
      - name: task_id
        in: path
        required: true
        schema:
          type: string
          title: Task Id
      - name: dag_run_id
        in: path
        required: true
        schema:
          type: string
          title: Dag Run Id
      - name: xcom_key
        in: path
        required: true
        schema:
          type: string
          title: Xcom Key
      requestBody:
        required: true
        content:
          application/json:
            schema:
              $ref: '#/components/schemas/XComUpdateBody'
      responses:
        '200':
          description: Successful Response
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/XComResponseNative'
        '401':
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/HTTPExceptionResponse'
          description: Unauthorized
        '403':
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/HTTPExceptionResponse'
          description: Forbidden
        '400':
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/HTTPExceptionResponse'
          description: Bad Request
        '404':
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/HTTPExceptionResponse'
          description: Not Found
        '422':
          description: Validation Error
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/HTTPValidationError'
      x-microcks-operation:
        delay: 0
        dispatcher: FALLBACK
    delete:
      tags:
      - XCom
      summary: Airflow Delete Xcom Entry
      description: Delete an XCom entry.
      operationId: delete_xcom_entry
      security:
      - OAuth2PasswordBearer: []
      - HTTPBearer: []
      parameters:
      - name: dag_id
        in: path
        required: true
        schema:
          type: string
          title: Dag Id
      - name: task_id
        in: path
        required: true
        schema:
          type: string
          title: Task Id
      - name: dag_run_id
        in: path
        required: true
        schema:
          type: string
          title: Dag Run Id
      - name: xcom_key
        in: path
        required: true
        schema:
          type: string
          title: Xcom Key
      - name: map_index
        in: query
        required: false
        schema:
          type: integer
          minimum: -1
          default: -1
          title: Map Index
      responses:
        '204':
          description: Successful Response
        '401':
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/HTTPExceptionResponse'
          description: Unauthorized
        '403':
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/HTTPExceptionResponse'
          description: Forbidden
        '400':
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/HTTPExceptionResponse'
          description: Bad Request
        '404':
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/HTTPExceptionResponse'
          description: Not Found
        '422':
          description: Validation Error
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/HTTPValidationError'
      x-microcks-operation:
        delay: 0
        dispatcher: FALLBACK
  /api/v2/dags/{dag_id}/dagRuns/{dag_run_id}/taskInstances/{task_id}/xcomEntries:
    get:
      tags:
      - XCom
      summary: Airflow Get Xcom Entries
      description: 'Get all XCom entries.


        This endpoint allows specifying `~` as the dag_id, dag_run_id, task_id to retrieve XCom entries for all DAGs.'
      operationId: get_xcom_entries
      security:
      - OAuth2PasswordBearer: []
      - HTTPBearer: []
      parameters:
      - name: dag_id
        in: path
        required: true
        schema:
          type: string
          title: Dag Id
      - name: dag_run_id
        in: path
        required: true
        schema:
          type: string
          title: Dag Run Id
      - name: task_id
        in: path
        required: true
        schema:
          type: string
          title: Task Id
      - name: xcom_key
        in: query
        required: false
        schema:
          anyOf:
          - type: string
          - type: 'null'
          title: Xcom Key
      - name: map_index
        in: query
        required: false
        schema:
          anyOf:
          - type: integer
            minimum: -1
          - type: 'null'
          title: Map Index
      - name: limit
        in: query
        required: false
        schema:
          type: integer
          minimum: 0
          default: 50
          title: Limit
      - name: offset
        in: query
        required: false
        schema:
          type: integer
          minimum: 0
          default: 0
          title: Offset
      - name: xcom_key_pattern
        in: query
        required: false
        schema:
          anyOf:
          - type: string
          - type: 'null'
          description: SQL LIKE expression — use `%` / `_` wildcards (e.g. `%customer_%`). or the pipe `|` operator for OR logic (e.g. `dag1 | dag2`). Regular expressions are **not** supported.
          title: Xcom Key Pattern
        description: SQL LIKE expression — use `%` / `_` wildcards (e.g. `%customer_%`). or the pipe `|` operator for OR logic (e.g. `dag1 | dag2`). Regular expressions are **not** supported.
      - name: dag_display_name_pattern
        in: query
        required: false
        schema:
          anyOf:
          - type: string
          - type: 'null'
          description: SQL LIKE expression — use `%` / `_` wildcards (e.g. `%customer_%`). or the pipe `|` operator for OR logic (e.g. `dag1 | dag2`). Regular expressions are **not** supported.
          title: Dag Display Name Pattern
        description: SQL LIKE expression — use `%` / `_` wildcards (e.g. `%customer_%`). or the pipe `|` operator for OR logic (e.g. `dag1 | dag2`). Regular expressions are **not** supported.
      - name: run_id_pattern
        in: query
        required: false
        schema:
          anyOf:
          - type: string
          - type: 'null'
          description: SQL LIKE expression — use `%` / `_` wildcards (e.g. `%customer_%`). or the pipe `|` operator for OR logic (e.g. `dag1 | dag2`). Regular expressions are **not** supported.
          title: Run Id Pattern
        description: SQL LIKE expression — use `%` / `_` wildcards (e.g. `%customer_%`). or the pipe `|` operator for OR logic (e.g. `dag1 | dag2`). Regular expressions are **not** supported.
      - name: task_id_pattern
        in: query
        required: false
        schema:
          anyOf:
          - type: string
          - type: 'null'
          description: SQL LIKE expression — use `%` / `_` wildcards (e.g. `%customer_%`). or the pipe `|` operator for OR logic (e.g. `dag1 | dag2`). Regular expressions are **not** supported.
          title: Task Id Pattern
        description: SQL LIKE expression — use `%` / `_` wildcards (e.g. `%customer_%`). or the pipe `|` operator for OR logic (e.g. `dag1 | dag2`). Regular expressions are **not** supported.
      - name: map_index_filter
        in: query
        required: false
        schema:
          anyOf:
          - type: integer
          - type: 'null'
          title: Map Index Filter
      - name: logical_date_gte
        in: query
        required: false
        schema:
          anyOf:
          - type: string
            format: date-time
          - type: 'null'
          title: Logical Date Gte
      - name: logical_date_gt
        in: query
        required: false
        schema:
          anyOf:
          - type: string
            format: date-time
          - type: 'null'
          title: Logical Date Gt
      - name: logical_date_lte
        in: query
        required: false
        schema:
          anyOf:
          - type: string
            format: date-time
          - type: 'null'
          title: Logical Date Lte
      - name: logical_date_lt
        in: query
        required: false
        schema:
          anyOf:
          - type: string
            format: date-time
          - type: 'null'
          title: Logical Date Lt
      - name: run_after_gte
        in: query
        required: false
        schema:
          anyOf:
          - type: string
            format: date-time
          - type: 'null'
          title: Run After Gte
      - name: run_after_gt
        in: query
        required: false
        schema:
          anyOf:
          - type: string
            format: date-time
          - type: 'null'
          title: Run After Gt
      - name: run_after_lte
        in: query
        required: false
        schema:
          anyOf:
          - type: string
            format: date-time
          - type: 'null'
          title: Run After Lte
      - name: run_after_lt
        in: query
        required: false
        schema:
          anyOf:
          - type: string
            format: date-time
          - type: 'null'
          title: Run After Lt
      responses:
        '200':
          description: Successful Response
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/XComCollectionResponse'
        '401':
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/HTTPExceptionResponse'
          description: Unauthorized
        '403':
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/HTTPExceptionResponse'
          description: Forbidden
        '400':
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/HTTPExceptionResponse'
          description: Bad Request
        '404':
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/HTTPExceptionResponse'
          description: Not Found
        '422':
          description: Validation Error
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/HTTPValidationError'
      x-microcks-operation:
        delay: 0
        dispatcher: FALLBACK
    post:
      tags:
      - XCom
      summary: Airflow Create Xcom Entry
      description: Create an XCom entry.
      operationId: create_xcom_entry
      security:
      - OAuth2PasswordBearer: []
      - HTTPBearer: []
      parameters:
      - name: dag_id
        in: path
        required: true
        schema:
          type: string
          title: Dag Id
      - name: task_id
        in: path
        required: true
        schema:
          type: string
          title: Task Id
      - name: dag_run_id
        in: path
        required: true
        schema:
          type: string
          title: Dag Run Id
      requestBody:
        required: true
        content:
          application/json:
            schema:
              $ref: '#/components/schemas/XComCreateBody'
      responses:
        '201':
          description: Successful Response
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/XComResponseNative'
        '401':
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/HTTPExceptionResponse'
          description: Unauthorized
        '403':
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/HTTPExceptionResponse'
          description: Forbidden
        '400':
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/HTTPExceptionResponse'
          description: Bad Request
        '404':
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/HTTPExceptionResponse'
          description: Not Found
        '422':
          description: Validation Error
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/HTTPValidationError'
      x-microcks-operation:
        delay: 0
        dispatcher: FALLBACK
components:
  schemas:
    HTTPValidationError:
      properties:
        detail:
          items:
            $ref: '#/components/schemas/ValidationError'
          type: array
          title: Detail
      type: object
      title: HTTPValidationError
    XComCollectionResponse:
      properties:
        xcom_entries:
          items:
            $ref: '#/components/schemas/XComResponse'
          type: array
          title: Xcom Entries
        total_entries:
          type: integer
          title: Total Entries
      type: object
      required:
      - xcom_entries
      - total_entries
      title: XComCollectionResponse
      description: XCom Collection serializer for responses.
    XComResponseNative:
      properties:
        key:
          type: string
          title: Key
        timestamp:
          type: string
          format: date-time
          title: Timestamp
        logical_date:
          anyOf:
          - type: string
            format: date-time
          - type: 'null'
          title: Logical Date
        map_index:
          type: integer
          title: Map Index
        task_id:
          type: string
          title: Task Id
        dag_id:
          type: string
          title: Dag Id
        run_id:
          type: string
          title: Run Id
        dag_display_name:
          type: string
          title: Dag Display Name
        task_display_name:
          type: string
          title: Task Display Name
        run_after:
          type: string
          format: date-time
          title: Run After
        value:
          title: Value
      type: object
      required:
      - key
      - timestamp
      - logical_date
      - map_index
      - task_id
      - dag_id
      - run_id
      - dag_display_name
      - task_display_name
      - run_after
      - value
      title: XComResponseNative
      description: XCom response serializer with native return type.
    XComUpdateBody:
      properties:
        value:
          title: Value
        map_index:
          type: integer
          title: Map Index
          default: -1
      additionalProperties: false
      type: object
      required:
      - value
      title: XComUpdateBody
      description: Payload serializer for updating an XCom entry.
    XComResponse:
      properties:
        key:
          type: string
          title: Key
        timestamp:
          type: string
          format: date-time
          title: Timestamp
        logical_date:
          anyOf:
          - type: string
            format: date-time
          - type: 'null'
          title: Logical Date
        map_index:
          type: integer
          title: Map Index
        task_id:
          type: string
          title: Task Id
        dag_id:
          type: string
          title: Dag Id
        run_id:
          type: string
          title: Run Id
        dag_display_name:
          type: string
          title: Dag Display Name
        task_display_name:
          type: string
          title: Task Display Name
        run_after:
          type: string
          format: date-time
          title: Run After
      type: object
      required:
      - key
      - timestamp
      - logical_date
      - map_index
      - task_id
      - dag_id
      - run_id
      - dag_display_name
      - task_display_name
      - run_after
      title: XComResponse
      description: Serializer for a xcom item.
    XComResponseString:
      properties:
        key:
          type: string
          title: Key
        timestamp:
          type: string
          format: date-time
          title: Timestamp
        logical_date:
          anyOf:
          - type: string
            format: date-time
          - type: 'null'
          title: Logical Date
        map_index:
          type: integer
          title: Map Index
        task_id:
          type: string
          title: Task Id
        dag_id:
          type: string
          title: Dag Id
        run_id:
          type: string
          title: Run Id
        dag_display_name:
          type: string
          title: Dag Display Name
        task_display_name:
          type: string
          title: Task Display Name
        run_after:
          type: string
          format: date-time
          title: Run After
        value:
          anyOf:
          - type: string
          - type: 'null'
          title: Value
      type: object
      required:
      - key
      - timestamp
      - logical_date
      - map_index
      - task_id
      - dag_id
      - run_id
      - dag_display_name
      - task_display_name
      - run_after
      - value
      title: XComResponseString
      description: XCom response serializer with string return type.
    XComCreateBody:
      properties:
        key:
          type: string
          title: Key
        value:
          title: Value
        map_index:
          type: integer
          title: Map Index
          default: -1
      additionalProperties: false
      type: object
      required:
      - key
      - value
      title: XComCreateBody
      description: Payload serializer for creating an XCom entry.
    ValidationError:
      properties:
        loc:
          items:
            anyOf:
            - type: string
            - type: integer
          type: array
          title: Location
        msg:
          type: string
          title: Message
        type:
          type: string
          title: Error Type
        input:
          title: Input
        ctx:
          type: object
          title: Context
      type: object
      required:
      - loc
      - msg
      - type
      title: ValidationError
    HTTPExceptionResponse:
      properties:
        detail:
          anyOf:
          - type: string
          - additionalProperties: true
            type: object
          title: Detail
      type: object
      required:
      - detail
      title: HTTPExceptionResponse
      description: HTTPException Model used for error response.
  securitySchemes:
    OAuth2PasswordBearer:
      type: oauth2
      description: To authenticate Airflow API requests, clients must include a JWT (JSON Web Token) in the Authorization header of each request. This token is used to verify the identity of the client and ensure that they have the appropriate permissions to access the requested resources. You can use the endpoint ``POST /auth/token`` in order to generate a JWT token. Upon successful authentication, the server will issue a JWT token that contains the necessary information (such as user identity and scope) to authenticate subsequent requests. To learn more about Airflow public API authentication, please read https://airflow.apache.org/docs/apache-airflow/stable/security/api.html.
      flows:
        password:
          scopes: {}
          tokenUrl: /auth/token
    HTTPBearer:
      type: http
      scheme: bearer