Skip to main content
GET
Get Source Run

Authorizations

Authorization
string
header
required

Every request authenticates with an API key: Authorization: Bearer {API_KEY}. App endpoints take an app API key; knowledge endpoints take a knowledge base API key (Get Started).

Keep keys server-side; never embed them in client code. Requests with a missing or invalid key fail with HTTP 401 (unauthorized).

Path Parameters

knowledge_base_id
string<uuid>
required

Knowledge base ID: the last segment of the Service API endpoint shown in the knowledge base's API Access dialog (…/knowledge-fs/spaces/<knowledge base ID>), and the segment after /datasets/new/ in the address bar.

run_id
string<uuid>
required

Run ID, from the response that started the run (id), from Update Source (sync_workflow.id), or from List Source Runs (id).

Response

The run.

canceled_at
string | null

When the run was canceled. null unless state is canceled.

checkpoint
string

Last step the run reached: queued, provider-read, preview-staged, selection-frozen, materialized, cleanup-staging, or source-committed. Retry Source Run starts the run over whatever its checkpoint.

completed_at
string | null

When the run ended (completed, zero_results, failed, or canceled), ISO 8601. null while it runs.

created_at
string

Creation time, ISO 8601.

cursor
string | null

Provider cursor the run resumes from. null when the run has not paged.

execution_attempts
integer

Times a worker has picked up the run, including after Retry Source Run, which does not reset it.

failure
object | null

Error details when state is failed. stage is the run's checkpoint at the failure, and traceId is the run ID. null otherwise.

id
string
kind
string

What the run does:

Dify also starts previews and imports when a source is added or edited there.

knowledge_space_id
string

Internal ID of the knowledge base. Not the knowledge base ID in the path.

last_error_code
string | null

failure.code when state is failed. null otherwise.

max_execution_attempts
integer

Limit on execution_attempts. Once it is reached, Retry Source Run answers 409.

progress_completed
integer

Items finished, including unchanged items a sync checked.

progress_failed
integer

Always 0 for source runs: a failing item fails the whole run.

progress_skipped
integer

Always 0 for source runs.

progress_total
integer | null

Items the run expects to process: the pages or items an import requested, the pages a crawl preview has staged so far, or the source's items once a sync has listed them. null until known.

While an Import Website Pages run crawls its URLs, progress_completed and progress_total both count the pages crawled so far. Once every URL is crawled, they restart at 0 of the number of URLs.

source_id
string | null

Source the run belongs to.

state
string

Progress of the run.

Live states:

  • queued: waiting for a worker
  • crawling: a crawl preview is fetching pages
  • preview_ready: a crawl preview is waiting for Import Selected Pages or Cancel Source Run
  • importing: importing and indexing items
  • syncing: refreshing the source's documents

Terminal states:

  • completed: every item was imported or refreshed, indexed, and made active
  • zero_results: a crawl preview found no pages
  • failed: see failure
  • canceled

After failed or canceled, Retry Source Run runs it again, and Sync Source starts a new sync.

updated_at
string

Last change, ISO 8601.