> ## Documentation Index
> Fetch the complete documentation index at: https://dify-6c0370d8-add-new-agent.mintlify.site/llms.txt
> Use this file to discover all available pages before exploring further.

# パイプラインを実行

> ナレッジベースの完全なナレッジパイプラインを実行します。ストリーミングとブロッキングの両方のレスポンスモードをサポートしています。



## OpenAPI

````yaml /ja/api-reference/openapi_knowledge.json post /datasets/{dataset_id}/pipeline/run
openapi: 3.0.1
info:
  title: ナレッジAPI
  description: >-
    ナレッジベース、ドキュメント、チャンク、メタデータ、タグの管理（作成、取得、設定を含む）のための API です。**注意：**単一のナレッジベース
    API キーは、同じアカウント配下のすべての可視ナレッジベースを操作する権限を持ちます。データセキュリティにご注意ください。
  version: 1.0.0
servers:
  - url: '{apiBaseUrl}'
    description: Knowledge API のベース URL です。
    variables:
      apiBaseUrl:
        default: https://api.dify.ai/v1
        description: API の実際のベース URL
security:
  - ApiKeyAuth: []
tags:
  - name: データセット
    description: ナレッジベースの作成、設定、取得を含むナレッジベース管理の操作です。
  - name: ドキュメント
    description: ナレッジベース内のドキュメントの作成、更新、管理のための操作です。
  - name: チャンク
    description: ドキュメントチャンクと子チャンクの管理のための操作です。
  - name: メタデータ
    description: ナレッジベースのメタデータフィールドとドキュメントメタデータ値の管理のための操作です。
  - name: タグ管理
    description: ナレッジベースタグとタグバインディングの管理のための操作です。
  - name: モデル
    description: 利用可能なモデルを取得するための操作です。
  - name: ナレッジパイプライン
    description: データソースプラグインとパイプライン実行を含むナレッジパイプラインの管理と実行のための操作です。
paths:
  /datasets/{dataset_id}/pipeline/run:
    post:
      tags:
        - ナレッジパイプライン
      summary: パイプラインを実行
      description: ナレッジベースの完全なナレッジパイプラインを実行します。ストリーミングとブロッキングの両方のレスポンスモードをサポートしています。
      operationId: runPipelineJa
      parameters:
        - name: dataset_id
          in: path
          required: true
          schema:
            type: string
            format: uuid
          description: ナレッジベース ID です。
      requestBody:
        required: true
        content:
          application/json:
            schema:
              type: object
              required:
                - inputs
                - datasource_type
                - datasource_info_list
                - start_node_id
                - is_published
                - response_mode
              properties:
                inputs:
                  type: object
                  additionalProperties: true
                  description: パイプラインの入力変数です。
                datasource_type:
                  type: string
                  enum:
                    - online_document
                    - local_file
                    - website_crawl
                    - online_drive
                  description: データソースの種類です。
                datasource_info_list:
                  type: array
                  items:
                    type: object
                    additionalProperties: true
                  description: パイプラインが処理するデータソース情報オブジェクトのリストです。
                start_node_id:
                  type: string
                  description: パイプライン実行を開始するノードの ID です。
                is_published:
                  type: boolean
                  description: >-
                    パイプラインの公開バージョンとドラフトバージョンのどちらを実行するかを指定します。`true`
                    は公開バージョン、`false` はドラフトを実行します。
                response_mode:
                  type: string
                  enum:
                    - streaming
                    - blocking
                  description: >-
                    パイプライン実行のレスポンスモードです。`streaming`
                    はサーバー送信イベントストリームを返し、`blocking` は完了を待って完全な結果を返します。
      responses:
        '200':
          description: >-
            パイプライン実行結果。フォーマットは `response_mode` に依存します：ストリーミングは
            `text/event-stream` を返し、ブロッキングは完全な JSON 結果を返します。
          content:
            text/event-stream:
              schema:
                type: string
                description: >-
                  パイプライン実行の進捗と結果を含むサーバー送信イベントストリームです。`response_mode` が
                  `streaming` の場合に返されます。
            application/json:
              schema:
                type: object
                description: パイプライン実行の完全な結果です。`response_mode` が `blocking` の場合に返されます。
                additionalProperties: true
              examples:
                success:
                  summary: Blocking Response Example
                  value:
                    task_id: a1b2c3d4-e5f6-7890-abcd-ef1234567890
                    workflow_run_id: f1e2d3c4-b5a6-7890-abcd-ef0987654321
                    data:
                      id: f1e2d3c4-b5a6-7890-abcd-ef0987654321
                      status: succeeded
                      outputs: {}
                      created_at: 1741267200
                      finished_at: 1741267210
        '403':
          description: '`forbidden` : アクセスが禁止されています。'
          content:
            application/json:
              examples:
                forbidden:
                  summary: forbidden
                  value:
                    status: 403
                    code: forbidden
                    message: Forbidden.
        '404':
          description: '`not_found` : ナレッジベースが見つかりません。'
          content:
            application/json:
              examples:
                not_found:
                  summary: not_found
                  value:
                    status: 404
                    code: not_found
                    message: Dataset not found.
        '500':
          description: '`pipeline_run_error` : パイプライン実行に失敗しました。'
          content:
            application/json:
              examples:
                pipeline_run_error:
                  summary: pipeline_run_error
                  value:
                    status: 500
                    code: pipeline_run_error
                    message: 'Pipeline execution failed: connection timeout'
components:
  securitySchemes:
    ApiKeyAuth:
      type: http
      scheme: bearer
      bearerFormat: API_KEY
      description: >-
        API Key 認証です。すべての API リクエストにおいて、`Authorization` HTTP ヘッダーに `Bearer `
        プレフィックスを付けた API Key を含めてください。例：`Authorization: Bearer {API_KEY}`。**API
        Key はサーバーサイドに保存し、クライアントサイドで共有・保存しないことを強く推奨します。API Key
        の漏洩は深刻な結果につながる可能性があります。**

````