Get Document Indexing Task
Returns one indexing task of a document, with its progress. Poll it until state is succeeded, failed, canceled, or superseded.
For a task started by Re-index Documents, poll Get Indexing Task with compilation_job.id instead.
For which task operation to use when, see Track Indexing.
1 min read
get/knowledge-fs/spaces/{knowledge_base_id}/logical-documents/{document_id}/processing-tasks/{task_id}
Request example
Response
get/knowledge-fs/spaces/{knowledge_base_id}/logical-documents/{document_id}/processing-tasks/{task_id}
Authorization
Path parameters
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.The document ID, from List Documents.
Indexing task ID:
latest_task.id from Get Document or List Documents, or id from List Document Indexing Tasks. The task must belong to this document.Responses
application/json
The indexing task.
Operations under way in the current phase, such as
parse, chunk, embedding, or publication.When the task ended, ISO 8601.
null while it runs.When the task was created, ISO 8601. Get Indexing Task reports the same task's times in epoch milliseconds.
Document ID.
Revision this task builds.
Error code when
state is failed.The message for
error_code. Can differ from failure.message.Error details when
state is failed. stage is the phase the task failed in, and traceId is the task ID. null otherwise.Indexing task ID. The same ID works with Get Indexing Task, Cancel Indexing Task, and Retry Indexing Task.
Internal ID of the knowledge base. Not the knowledge base ID in the path.
What the task is doing:
queued, parsing, outline_summary, chunking_indexing, graph_admission, publication, or complete.Progress from 0 to 100, derived from
stage.When the automatic retry runs, ISO 8601. Set while
state is retry_wait.Knowledge graph building after the revision publishes. Indexing finishes the knowledge graph before publishing, so it doesn't schedule this step.
state is not_scheduled while the task runs and disabled once it has ended. nodes_completed stays 0.Last checkpoint reached, in forward order:
queued, parsed, outline_built, nodes_generated, projection_built, smoke_eval_passed, published. It stays at the last checkpoint when the task fails or is canceled, so read state for the outcome.Run state:
dispatch_pending,queued: waiting for a worker.retry_wait: an automatic retry is scheduled atretry_at.running: a worker is indexing.succeeded: the revision is published and serves queries.failed: seefailure. Restart it with Retry Indexing Task.canceled.superseded: a newer attempt replaced this one.
succeeded, failed, canceled, and superseded are terminal.
When the task last changed, ISO 8601.