Skip to main content
get/knowledge-fs/spaces/{knowledge_base_id}/source-workflows/{run_id}
Request example
Response
get/knowledge-fs/spaces/{knowledge_base_id}/source-workflows/{run_id}

Authorization

Authorizationstringheaderrequired#

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_idstringrequired#
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_idstringrequired#
Run ID, from the response that started the run (id), from Update Source (sync_workflow.id), or from List Source Runs (id).

Responses

application/json
The run.
canceled_atstring#
When the run was canceled. null unless state is canceled.
checkpointstring#
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_atstring#
When the run ended (completed, zero_results, failed, or canceled), ISO 8601. null while it runs.
created_atstring#
Creation time, ISO 8601.
cursorstring#
Provider cursor the run resumes from. null when the run has not paged.
execution_attemptsinteger#
Times a worker has picked up the run, including after Retry Source Run, which does not reset it.
failureobject#
Error details when state is failed. stage is the run's checkpoint at the failure, and traceId is the run ID. null otherwise.
idstring#
kindstring#

What the run does:

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

knowledge_space_idstring#
Internal ID of the knowledge base. Not the knowledge base ID in the path.
last_error_codestring#
failure.code when state is failed. null otherwise.
max_execution_attemptsinteger#
Limit on execution_attempts. Once it is reached, Retry Source Run answers 409.
progress_completedinteger#
Items finished, including unchanged items a sync checked.
progress_failedinteger#
Always 0 for source runs: a failing item fails the whole run.
progress_skippedinteger#
Always 0 for source runs.
progress_totalinteger#

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_idstring#
Source the run belongs to.
statestring#

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_atstring#
Last change, ISO 8601.