Apache Airflow Task State Store API

The Task State Store API from Apache Airflow — 2 operation(s) for task state store.

Operations 6

GET /api/v2/dags/{dag_id}/dagRuns/{dag_run_id}/taskInstances/{task_id}/state-store List Task State Store #
DELETE /api/v2/dags/{dag_id}/dagRuns/{dag_run_id}/taskInstances/{task_id}/state-store Clear Task State Store #
GET /api/v2/dags/{dag_id}/dagRuns/{dag_run_id}/taskInstances/{task_id}/state-store/{key} Get Task State Store #
PUT /api/v2/dags/{dag_id}/dagRuns/{dag_run_id}/taskInstances/{task_id}/state-store/{key} Set Task State Store #
PATCH /api/v2/dags/{dag_id}/dagRuns/{dag_run_id}/taskInstances/{task_id}/state-store/{key} Patch Task State Store #
DELETE /api/v2/dags/{dag_id}/dagRuns/{dag_run_id}/taskInstances/{task_id}/state-store/{key} Delete Task State Store #

Work with this as data

Every API here is available over the APIs.io API and to AI agents over MCP.

MCP server

One button, every client — Claude, Cursor, VS Code and the rest.

https://apis.io/mcp

Tools for apis

7 MCP tools reach this
  • find_apisBrowse and filter every API in the catalog.
  • get_api_artifactsOne API's artifacts, grouped by type.
  • get_openapiThe primary OpenAPI for this API.
  • find_similar_apisAPIs that look like this one.
  • apis_io_searchSTART HERE — APIs, providers and tags for one query, each with its total.
  • resolveTurn a domain, URL or GitHub org into the provider it belongs to.
  • find_cohortsEvery scored population of providers in the catalog.
All 92 tools →

Call it yourself

curl for this page
This API
curl "https://apis.io/api/v1/apis/apache-airflow:apache-airflow-task-state-store-api"
All apis
curl "https://apis.io/api/v1/apis?limit=25"

Discovery needs no key. Ratings and market analysis are Pro.

Get an API key

Free tier, no form to fill in. Signing in shares your email address with us — we store it to create your key and to recognise you if you sign in with another provider. See our Privacy Policy and Terms.

A second provider on the same verified email joins the account you already have.

OpenAPI Specification

apache-airflow-task-state-store-api-openapi.yml Raw ↑
openapi: 3.2.0
info:
  title: Airflow Task State Store 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.


    **Filtering with pattern parameters.** Many list endpoints accept ``*_pattern`` and ``*_prefix_pattern`` query parameters. Unless a parameter''s own description says otherwise, ``*_pattern`` is a case-insensitive substring match (SQL ``ILIKE ''%term%''``) where ``%`` matches any sequence and ``_`` matches any single character (e.g. ``%customer_%``) — convenient, but it cannot use B-tree indexes, so it is slow on large tables. ``*_prefix_pattern`` matches the start of the value, is case-sensitive and index-friendly (prefer it at scale); there ``%`` and ``_`` are literal and trailing non-alphanumeric characters are stripped so the range scan stays index-compatible under locale-aware collations (e.g. ``test_`` matches values starting with ``test``, and ``s3://`` matches ``s3``). In both, ``|`` means OR (e.g. ``dag1|dag2``) and ``~`` matches everything. Regular expressions are not supported by these parameters; regex-capable endpoints expose a separate parameter.'
  version: '2'
tags:
- name: Task State Store
paths:
  /api/v2/dags/{dag_id}/dagRuns/{dag_run_id}/taskInstances/{task_id}/state-store:
    get:
      tags:
      - Task State Store
      summary: List Task State Store
      description: List all task state store entries for a task instance.
      operationId: list_task_state_store
      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: map_index
        in: query
        required: false
        schema:
          type: integer
          minimum: -1
          default: -1
          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
      responses:
        '200':
          description: Successful Response
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/TaskStateStoreCollectionResponse'
        '401':
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/HTTPExceptionResponse'
          description: Unauthorized
        '403':
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/HTTPExceptionResponse'
          description: Forbidden
        '422':
          description: Validation Error
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/HTTPValidationError'
    delete:
      tags:
      - Task State Store
      summary: Clear Task State Store
      description: 'Delete all task state store keys for a task instance.


        When ``all_map_indices=true``, state store is cleared for every map index of the task and

        the ``map_index`` parameter is ignored.'
      operationId: clear_task_state_store
      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: all_map_indices
        in: query
        required: false
        schema:
          type: boolean
          default: false
          title: All Map Indices
      - 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
        '404':
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/HTTPExceptionResponse'
          description: Not Found
        '422':
          description: Validation Error
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/HTTPValidationError'
  /api/v2/dags/{dag_id}/dagRuns/{dag_run_id}/taskInstances/{task_id}/state-store/{key}:
    get:
      tags:
      - Task State Store
      summary: Get Task State Store
      description: Get a single task state store entry.
      operationId: get_task_state_store
      security:
      - OAuth2PasswordBearer: []
      - HTTPBearer: []
      parameters:
      - name: key
        in: path
        required: true
        schema:
          type: string
          title: Key
      - 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: map_index
        in: query
        required: false
        schema:
          type: integer
          minimum: -1
          default: -1
          title: Map Index
      responses:
        '200':
          description: Successful Response
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/TaskStateStoreResponse'
        '401':
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/HTTPExceptionResponse'
          description: Unauthorized
        '403':
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/HTTPExceptionResponse'
          description: Forbidden
        '404':
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/HTTPExceptionResponse'
          description: Not Found
        '422':
          description: Validation Error
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/HTTPValidationError'
    put:
      tags:
      - Task State Store
      summary: Set Task State Store
      description: Set a task state store value. Creates or overwrites the key.
      operationId: set_task_state_store
      security:
      - OAuth2PasswordBearer: []
      - HTTPBearer: []
      parameters:
      - name: key
        in: path
        required: true
        schema:
          type: string
          title: Key
      - 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: map_index
        in: query
        required: false
        schema:
          type: integer
          minimum: -1
          default: -1
          title: Map Index
      requestBody:
        required: true
        content:
          application/json:
            schema:
              $ref: '#/components/schemas/TaskStateStoreBody'
      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
        '404':
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/HTTPExceptionResponse'
          description: Not Found
        '422':
          description: Validation Error
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/HTTPValidationError'
    patch:
      tags:
      - Task State Store
      summary: Patch Task State Store
      description: Update the value of an existing task state store key.
      operationId: patch_task_state_store
      security:
      - OAuth2PasswordBearer: []
      - HTTPBearer: []
      parameters:
      - name: key
        in: path
        required: true
        schema:
          type: string
          title: Key
      - 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: map_index
        in: query
        required: false
        schema:
          type: integer
          minimum: -1
          default: -1
          title: Map Index
      requestBody:
        required: true
        content:
          application/json:
            schema:
              $ref: '#/components/schemas/TaskStateStorePatchBody'
      responses:
        '200':
          description: Successful Response
          content:
            application/json:
              schema: {}
        '401':
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/HTTPExceptionResponse'
          description: Unauthorized
        '403':
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/HTTPExceptionResponse'
          description: Forbidden
        '404':
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/HTTPExceptionResponse'
          description: Not Found
        '422':
          description: Validation Error
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/HTTPValidationError'
    delete:
      tags:
      - Task State Store
      summary: Delete Task State Store
      description: Delete a single task state store key. No-op if the key does not exist.
      operationId: delete_task_state_store
      security:
      - OAuth2PasswordBearer: []
      - HTTPBearer: []
      parameters:
      - name: key
        in: path
        required: true
        schema:
          type: string
          title: Key
      - 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: 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
        '404':
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/HTTPExceptionResponse'
          description: Not Found
        '422':
          description: Validation Error
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/HTTPValidationError'
components:
  schemas:
    TaskStateStoreCollectionResponse:
      properties:
        task_state_store:
          items:
            $ref: '#/components/schemas/TaskStateStoreResponse'
          type: array
          title: Task State Store
        total_entries:
          type: integer
          title: Total Entries
      type: object
      required:
      - task_state_store
      - total_entries
      title: TaskStateStoreCollectionResponse
      description: All task state store entries for a task instance.
    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
    JsonValue: {}
    TaskStateStorePatchBody:
      properties:
        value:
          $ref: '#/components/schemas/JsonValue'
      additionalProperties: false
      type: object
      required:
      - value
      title: TaskStateStorePatchBody
      description: Request body for patching only the value of an existing task state store key.
    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.
    HTTPValidationError:
      properties:
        detail:
          items:
            $ref: '#/components/schemas/ValidationError'
          type: array
          title: Detail
      type: object
      title: HTTPValidationError
    TaskStateStoreResponse:
      properties:
        key:
          type: string
          title: Key
        value:
          $ref: '#/components/schemas/JsonValue'
        updated_at:
          type: string
          format: date-time
          title: Updated At
        expires_at:
          anyOf:
          - type: string
            format: date-time
          - type: 'null'
          title: Expires At
      type: object
      required:
      - key
      - value
      - updated_at
      - expires_at
      title: TaskStateStoreResponse
      description: A single task state store key/value pair with metadata.
    TaskStateStoreBody:
      properties:
        value:
          $ref: '#/components/schemas/JsonValue'
        expires_at:
          anyOf:
          - type: string
            format: date-time
          - type: string
            const: default
          - type: 'null'
          title: Expires At
          default: default
      additionalProperties: false
      type: object
      required:
      - value
      title: TaskStateStoreBody
      description: 'Request body for setting a task state store value.


        ``expires_at`` controls expiry:


        - ``"default"``: apply the configured ``[state_store] default_retention_days``.

        - ``null``: never expire.

        - aware datetime: expire at that time.'
  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
x-provenance:
  method: harvested
  publisher: Apache Airflow
  source: https://airflow.apache.org/docs/apache-airflow/stable/_static/dot-dot/src/airflow/api_fastapi/core_api/openapi/v2-rest-api-generated.yaml
  note: split by refine-openapis from the provider's own published document, verified by fetch (openapi/_original/*.fetch.json);
    stamped by stamp-openapi-provenance.py (roadmap#793)