ソースの実行を取得
ソースの実行を 1 件返します。クロールプレビューやそこからのインポートなど、ソース一覧を取得 に表示されない実行も含め、任意の実行を ID で追跡できます。
completed で終了した実行では、すべてのアイテムがインポートまたは更新され、インデックスされてアクティブになっています。実行は各ドキュメントのインデックス処理を最大 10 分待ちます。それより時間がかかるドキュメントがあると、実行は失敗します。
failed になった場合は、failure を確認してから ソースの実行を再試行 を呼び出すか、新しい Idempotency-Key で新しい実行を開始してください。
実行の追跡、再試行、キャンセルの方法については、ソースの実行の追跡 を参照してください。
curl --request GET \
--url https://{api_base_url}/knowledge-fs/spaces/{knowledge_base_id}/source-workflows/{run_id} \
--header 'Authorization: Bearer <token>'import requests
url = "https://{api_base_url}/knowledge-fs/spaces/{knowledge_base_id}/source-workflows/{run_id}"
headers = {"Authorization": "Bearer <token>"}
response = requests.get(url, headers=headers)
print(response.text)const options = {method: 'GET', headers: {Authorization: 'Bearer <token>'}};
fetch('https://{api_base_url}/knowledge-fs/spaces/{knowledge_base_id}/source-workflows/{run_id}', options)
.then(res => res.json())
.then(res => console.log(res))
.catch(err => console.error(err));<?php
$curl = curl_init();
curl_setopt_array($curl, [
CURLOPT_URL => "https://{api_base_url}/knowledge-fs/spaces/{knowledge_base_id}/source-workflows/{run_id}",
CURLOPT_RETURNTRANSFER => true,
CURLOPT_ENCODING => "",
CURLOPT_MAXREDIRS => 10,
CURLOPT_TIMEOUT => 30,
CURLOPT_HTTP_VERSION => CURL_HTTP_VERSION_1_1,
CURLOPT_CUSTOMREQUEST => "GET",
CURLOPT_HTTPHEADER => [
"Authorization: Bearer <token>"
],
]);
$response = curl_exec($curl);
$err = curl_error($curl);
curl_close($curl);
if ($err) {
echo "cURL Error #:" . $err;
} else {
echo $response;
}package main
import (
"fmt"
"net/http"
"io"
)
func main() {
url := "https://{api_base_url}/knowledge-fs/spaces/{knowledge_base_id}/source-workflows/{run_id}"
req, _ := http.NewRequest("GET", url, nil)
req.Header.Add("Authorization", "Bearer <token>")
res, _ := http.DefaultClient.Do(req)
defer res.Body.Close()
body, _ := io.ReadAll(res.Body)
fmt.Println(string(body))
}HttpResponse<String> response = Unirest.get("https://{api_base_url}/knowledge-fs/spaces/{knowledge_base_id}/source-workflows/{run_id}")
.header("Authorization", "Bearer <token>")
.asString();require 'uri'
require 'net/http'
url = URI("https://{api_base_url}/knowledge-fs/spaces/{knowledge_base_id}/source-workflows/{run_id}")
http = Net::HTTP.new(url.host, url.port)
http.use_ssl = true
request = Net::HTTP::Get.new(url)
request["Authorization"] = 'Bearer <token>'
response = http.request(request)
puts response.read_body{
"canceled_at": null,
"checkpoint": "source-committed",
"completed_at": "2026-10-20T10:03:18Z",
"created_at": "2026-10-20T10:00:00Z",
"cursor": null,
"execution_attempts": 1,
"failure": null,
"id": "e1f2a3b4-c5d6-4e7f-8a9b-0c1d2e3f4a5b",
"kind": "crawl-import",
"knowledge_space_id": "0a9d3c2e-5b6f-4e1a-8c7d-2f3e4a5b6c7d",
"last_error_code": null,
"max_execution_attempts": 5,
"progress_completed": 2,
"progress_failed": 0,
"progress_skipped": 0,
"progress_total": 2,
"source_id": "6f1c2b0e-3d0b-4a5e-9f4c-1c0e6a7b8d90",
"state": "completed",
"updated_at": "2026-10-20T10:03:18Z"
}Authorizations
すべてのリクエストは、Authorization: Bearer {API_KEY} ヘッダーに指定した API キーで認証します。アプリのエンドポイントにはアプリの API キーを、ナレッジのエンドポイントにはナレッジベースの API キーを使用します(Dify API クイックスタート)。
キーはサーバーサイドで保管し、クライアントコードには決して埋め込まないでください。キーがない、または無効な場合は HTTP 401(unauthorized)が返ります。
Response
実行です。
実行が到達した最後のステップで、queued、provider-read、preview-staged、selection-frozen、materialized、cleanup-staging、source-committed のいずれかです。ソースの実行を再試行 は、チェックポイントにかかわらず実行を最初からやり直します。
ワーカーが実行を取得した回数です。ソースの実行を再試行 の後の取得も含み、再試行してもリセットされません。
実行 ID です。ソースの実行を取得、ソースの実行をキャンセル、ソースの実行を再試行 に渡します。
実行の処理内容です:
sync:ソースを同期、ソースを更新、スケジュール、または Dify によって開始されます。crawl-preview:ウェブサイトのクロールをプレビュー によって開始されます。選択したページをインポート がこの実行からインポートしている間も、種類は変わりません。crawl-import:ウェブサイトのページをインポート によって開始されます。online-document-import、online-drive-import:ソースのアイテムをインポート によって開始されます。
Dify でソースを追加または編集した場合も、Dify がプレビューとインポートを開始します。
execution_attempts の上限です。上限に達すると、ソースの実行を再試行 は 409 を返します。
実行が処理する予定のアイテム数です。インポートではリクエストされたページまたはアイテム、クロールプレビューではこれまでに一時保存されたページ、同期では一覧の取得後のソースのアイテムを数えます。判明するまでは null です。
ウェブサイトのページをインポート の実行が URL をクロールしている間は、progress_completed と progress_total のどちらも、それまでにクロールしたページ数を数えます。すべての URL のクロールが終わると、URL の数を総数として 0 から数え直します。
実行の進行状況です。
進行中の状態:
queued:ワーカー待ちcrawling:クロールプレビューによるページの取得中preview_ready:クロールプレビューが 選択したページをインポート または ソースの実行をキャンセル を待機中importing:アイテムのインポートとインデックス処理中syncing:ソースのドキュメントを更新中
最終状態:
completed:すべてのアイテムのインポートまたは更新、インデックス処理、アクティブ化が完了zero_results:クロールプレビューで見つかったページが 0 件failed:failureを参照canceled
failed または canceled の後は、ソースの実行を再試行 で再実行でき、ソースを同期 で新しい同期を開始できます。
Was this page helpful?
curl --request GET \
--url https://{api_base_url}/knowledge-fs/spaces/{knowledge_base_id}/source-workflows/{run_id} \
--header 'Authorization: Bearer <token>'import requests
url = "https://{api_base_url}/knowledge-fs/spaces/{knowledge_base_id}/source-workflows/{run_id}"
headers = {"Authorization": "Bearer <token>"}
response = requests.get(url, headers=headers)
print(response.text)const options = {method: 'GET', headers: {Authorization: 'Bearer <token>'}};
fetch('https://{api_base_url}/knowledge-fs/spaces/{knowledge_base_id}/source-workflows/{run_id}', options)
.then(res => res.json())
.then(res => console.log(res))
.catch(err => console.error(err));<?php
$curl = curl_init();
curl_setopt_array($curl, [
CURLOPT_URL => "https://{api_base_url}/knowledge-fs/spaces/{knowledge_base_id}/source-workflows/{run_id}",
CURLOPT_RETURNTRANSFER => true,
CURLOPT_ENCODING => "",
CURLOPT_MAXREDIRS => 10,
CURLOPT_TIMEOUT => 30,
CURLOPT_HTTP_VERSION => CURL_HTTP_VERSION_1_1,
CURLOPT_CUSTOMREQUEST => "GET",
CURLOPT_HTTPHEADER => [
"Authorization: Bearer <token>"
],
]);
$response = curl_exec($curl);
$err = curl_error($curl);
curl_close($curl);
if ($err) {
echo "cURL Error #:" . $err;
} else {
echo $response;
}package main
import (
"fmt"
"net/http"
"io"
)
func main() {
url := "https://{api_base_url}/knowledge-fs/spaces/{knowledge_base_id}/source-workflows/{run_id}"
req, _ := http.NewRequest("GET", url, nil)
req.Header.Add("Authorization", "Bearer <token>")
res, _ := http.DefaultClient.Do(req)
defer res.Body.Close()
body, _ := io.ReadAll(res.Body)
fmt.Println(string(body))
}HttpResponse<String> response = Unirest.get("https://{api_base_url}/knowledge-fs/spaces/{knowledge_base_id}/source-workflows/{run_id}")
.header("Authorization", "Bearer <token>")
.asString();require 'uri'
require 'net/http'
url = URI("https://{api_base_url}/knowledge-fs/spaces/{knowledge_base_id}/source-workflows/{run_id}")
http = Net::HTTP.new(url.host, url.port)
http.use_ssl = true
request = Net::HTTP::Get.new(url)
request["Authorization"] = 'Bearer <token>'
response = http.request(request)
puts response.read_body{
"canceled_at": null,
"checkpoint": "source-committed",
"completed_at": "2026-10-20T10:03:18Z",
"created_at": "2026-10-20T10:00:00Z",
"cursor": null,
"execution_attempts": 1,
"failure": null,
"id": "e1f2a3b4-c5d6-4e7f-8a9b-0c1d2e3f4a5b",
"kind": "crawl-import",
"knowledge_space_id": "0a9d3c2e-5b6f-4e1a-8c7d-2f3e4a5b6c7d",
"last_error_code": null,
"max_execution_attempts": 5,
"progress_completed": 2,
"progress_failed": 0,
"progress_skipped": 0,
"progress_total": 2,
"source_id": "6f1c2b0e-3d0b-4a5e-9f4c-1c0e6a7b8d90",
"state": "completed",
"updated_at": "2026-10-20T10:03:18Z"
}