{"componentChunkName":"component---src-templates-simple-markdown-js","path":"/docs/ai/document-ai/processing-documents/","matchPath":"","result":{"data":{"markdownRemark":{"html":"<h1 style=\"position:relative;\"><a href=\"#how-processing-works\" aria-label=\"how processing works permalink\" class=\"anchor before\"><svg aria-hidden=\"true\" focusable=\"false\" height=\"16\" version=\"1.1\" viewBox=\"0 0 16 16\" width=\"16\"><path fill-rule=\"evenodd\" d=\"M4 9h1v1H4c-1.5 0-3-1.69-3-3.5S2.55 3 4 3h4c1.45 0 3 1.69 3 3.5 0 1.41-.91 2.72-2 3.25V8.59c.58-.45 1-1.27 1-2.09C10 5.22 8.98 4 8 4H4c-.98 0-2 1.22-2 2.5S3 9 4 9zm9-3h-1v1h1c1 0 2 1.22 2 2.5S13.98 12 13 12H9c-.98 0-2-1.22-2-2.5 0-.83.42-1.64 1-2.09V6.25c-1.09.53-2 1.84-2 3.25C6 11.31 7.55 13 9 13h4c1.45 0 3-1.69 3-3.5S14.5 6 13 6z\"></path></svg></a><div class=\"hidden-anchor\" id=\"how-processing-works\"></div>How Processing Works</h1>\n<p>Document processing is asynchronous. Upload and reprocessing requests return after a run is accepted; processing continues independently.</p>\n<h2 style=\"position:relative;\"><a href=\"#documents-runs-and-results\" aria-label=\"documents runs and results permalink\" class=\"anchor before\"><svg aria-hidden=\"true\" focusable=\"false\" height=\"16\" version=\"1.1\" viewBox=\"0 0 16 16\" width=\"16\"><path fill-rule=\"evenodd\" d=\"M4 9h1v1H4c-1.5 0-3-1.69-3-3.5S2.55 3 4 3h4c1.45 0 3 1.69 3 3.5 0 1.41-.91 2.72-2 3.25V8.59c.58-.45 1-1.27 1-2.09C10 5.22 8.98 4 8 4H4c-.98 0-2 1.22-2 2.5S3 9 4 9zm9-3h-1v1h1c1 0 2 1.22 2 2.5S13.98 12 13 12H9c-.98 0-2-1.22-2-2.5 0-.83.42-1.64 1-2.09V6.25c-1.09.53-2 1.84-2 3.25C6 11.31 7.55 13 9 13h4c1.45 0 3-1.69 3-3.5S14.5 6 13 6z\"></path></svg></a><div class=\"hidden-anchor\" id=\"documents-runs-and-results\"></div>Documents, runs, and results</h2>\n<p>Document AI uses three related resources:</p>\n<ul>\n<li>\nA \n<strong>document</strong>\n represents the uploaded file and its current state.\n</li>\n<li>\nA \n<strong>run</strong>\n represents one processing attempt with a fixed configuration snapshot.\n</li>\n<li>\nA \n<strong>result</strong>\n contains structured output from a completed run. Split processing can produce multiple results from one document.\n</li>\n</ul>\n<p>Every new processing attempt creates a new run. Prior runs and results remain available for comparison and audit.</p>\n<h2 style=\"position:relative;\"><a href=\"#configuration-snapshot\" aria-label=\"configuration snapshot permalink\" class=\"anchor before\"><svg aria-hidden=\"true\" focusable=\"false\" height=\"16\" version=\"1.1\" viewBox=\"0 0 16 16\" width=\"16\"><path fill-rule=\"evenodd\" d=\"M4 9h1v1H4c-1.5 0-3-1.69-3-3.5S2.55 3 4 3h4c1.45 0 3 1.69 3 3.5 0 1.41-.91 2.72-2 3.25V8.59c.58-.45 1-1.27 1-2.09C10 5.22 8.98 4 8 4H4c-.98 0-2 1.22-2 2.5S3 9 4 9zm9-3h-1v1h1c1 0 2 1.22 2 2.5S13.98 12 13 12H9c-.98 0-2-1.22-2-2.5 0-.83.42-1.64 1-2.09V6.25c-1.09.53-2 1.84-2 3.25C6 11.31 7.55 13 9 13h4c1.45 0 3-1.69 3-3.5S14.5 6 13 6z\"></path></svg></a><div class=\"hidden-anchor\" id=\"configuration-snapshot\"></div>Configuration snapshot</h2>\n<p>When a run is created, its selected processing configuration is captured as a complete snapshot. Later edits to a saved configuration do not change an existing run.</p>\n<p>Learn how to select the appropriate settings in <a href=\"/docs/ai/document-ai/processing-configurations/\">Choosing a Configuration</a>.</p>\n<h2 style=\"position:relative;\"><a href=\"#status-lifecycle\" aria-label=\"status lifecycle permalink\" class=\"anchor before\"><svg aria-hidden=\"true\" focusable=\"false\" height=\"16\" version=\"1.1\" viewBox=\"0 0 16 16\" width=\"16\"><path fill-rule=\"evenodd\" d=\"M4 9h1v1H4c-1.5 0-3-1.69-3-3.5S2.55 3 4 3h4c1.45 0 3 1.69 3 3.5 0 1.41-.91 2.72-2 3.25V8.59c.58-.45 1-1.27 1-2.09C10 5.22 8.98 4 8 4H4c-.98 0-2 1.22-2 2.5S3 9 4 9zm9-3h-1v1h1c1 0 2 1.22 2 2.5S13.98 12 13 12H9c-.98 0-2-1.22-2-2.5 0-.83.42-1.64 1-2.09V6.25c-1.09.53-2 1.84-2 3.25C6 11.31 7.55 13 9 13h4c1.45 0 3-1.69 3-3.5S14.5 6 13 6z\"></path></svg></a><div class=\"hidden-anchor\" id=\"status-lifecycle\"></div>Status lifecycle</h2>\n<table>\n<thead>\n<tr>\n<th>Status</th>\n<th>Meaning</th>\n<th>What to do</th>\n</tr>\n</thead>\n<tbody>\n<tr>\n<td><code class=\"language-text\">pending</code></td>\n<td>The run was accepted and is waiting to start.</td>\n<td>Continue polling or wait for an event.</td>\n</tr>\n<tr>\n<td><code class=\"language-text\">processing</code></td>\n<td>Work is in progress.</td>\n<td>Display progress and continue waiting.</td>\n</tr>\n<tr>\n<td><code class=\"language-text\">completed</code></td>\n<td>Processing finished successfully.</td>\n<td>Retrieve and use the results.</td>\n</tr>\n<tr>\n<td><code class=\"language-text\">failed</code></td>\n<td>Processing could not complete.</td>\n<td>Inspect <code class=\"language-text\">error</code>, correct the input or configuration, then create a new run if appropriate.</td>\n</tr>\n<tr>\n<td><code class=\"language-text\">skipped</code></td>\n<td>Processing was not applicable to the stored file.</td>\n<td>Review the skip reason and file eligibility.</td>\n</tr>\n<tr>\n<td><code class=\"language-text\">oversized</code></td>\n<td>The file exceeds a processing limit but may still be stored.</td>\n<td>Review the reported reason and current file-type limits.</td>\n</tr>\n</tbody>\n</table>\n<p>Treat <code class=\"language-text\">completed</code>, <code class=\"language-text\">failed</code>, <code class=\"language-text\">skipped</code>, and <code class=\"language-text\">oversized</code> as terminal for that run.</p>\n<!-- SCREENSHOT PLACEHOLDER\nFile: images/processing-status-lifecycle.png\nCapture: A public-safe status diagram showing pending, processing, completed, failed, skipped, and oversized.\nAlt: Document processing status lifecycle\n-->\n<h2 style=\"position:relative;\"><a href=\"#monitor-a-run\" aria-label=\"monitor a run permalink\" class=\"anchor before\"><svg aria-hidden=\"true\" focusable=\"false\" height=\"16\" version=\"1.1\" viewBox=\"0 0 16 16\" width=\"16\"><path fill-rule=\"evenodd\" d=\"M4 9h1v1H4c-1.5 0-3-1.69-3-3.5S2.55 3 4 3h4c1.45 0 3 1.69 3 3.5 0 1.41-.91 2.72-2 3.25V8.59c.58-.45 1-1.27 1-2.09C10 5.22 8.98 4 8 4H4c-.98 0-2 1.22-2 2.5S3 9 4 9zm9-3h-1v1h1c1 0 2 1.22 2 2.5S13.98 12 13 12H9c-.98 0-2-1.22-2-2.5 0-.83.42-1.64 1-2.09V6.25c-1.09.53-2 1.84-2 3.25C6 11.31 7.55 13 9 13h4c1.45 0 3-1.69 3-3.5S14.5 6 13 6z\"></path></svg></a><div class=\"hidden-anchor\" id=\"monitor-a-run\"></div>Monitor a run</h2>\n<p>Use <code class=\"language-text\">GET /document-store/runs/{id}</code> to retrieve a run.</p>\n<p>The response includes:</p>\n<ul>\n<li>\n<code class=\"language-text\">status</code>\n</li>\n<li>\n<code class=\"language-text\">current_step</code>\n and \n<code class=\"language-text\">current_step_message</code>\n, when available\n</li>\n<li>\n<code class=\"language-text\">error</code>\n, when processing fails\n</li>\n<li>\n<code class=\"language-text\">created_at</code>\n, \n<code class=\"language-text\">started_at</code>\n, and \n<code class=\"language-text\">completed_at</code>\n</li>\n<li>\nThe configuration snapshot used for that run\n</li>\n<li>\nResult summaries when processing completes\n</li>\n</ul>\n<h2 style=\"position:relative;\"><a href=\"#review-processing-activity\" aria-label=\"review processing activity permalink\" class=\"anchor before\"><svg aria-hidden=\"true\" focusable=\"false\" height=\"16\" version=\"1.1\" viewBox=\"0 0 16 16\" width=\"16\"><path fill-rule=\"evenodd\" d=\"M4 9h1v1H4c-1.5 0-3-1.69-3-3.5S2.55 3 4 3h4c1.45 0 3 1.69 3 3.5 0 1.41-.91 2.72-2 3.25V8.59c.58-.45 1-1.27 1-2.09C10 5.22 8.98 4 8 4H4c-.98 0-2 1.22-2 2.5S3 9 4 9zm9-3h-1v1h1c1 0 2 1.22 2 2.5S13.98 12 13 12H9c-.98 0-2-1.22-2-2.5 0-.83.42-1.64 1-2.09V6.25c-1.09.53-2 1.84-2 3.25C6 11.31 7.55 13 9 13h4c1.45 0 3-1.69 3-3.5S14.5 6 13 6z\"></path></svg></a><div class=\"hidden-anchor\" id=\"review-processing-activity\"></div>Review processing activity</h2>\n<p>Use <code class=\"language-text\">GET /document-store/activity</code> for customer-visible progress and troubleshooting entries.</p>\n<p>Filter by <code class=\"language-text\">document_id</code> or <code class=\"language-text\">run_id</code>. Entries include the processing step, status, message, and creation time. Results default to 25 per page and support up to 100.</p>\n<h2 style=\"position:relative;\"><a href=\"#polling-guidance\" aria-label=\"polling guidance permalink\" class=\"anchor before\"><svg aria-hidden=\"true\" focusable=\"false\" height=\"16\" version=\"1.1\" viewBox=\"0 0 16 16\" width=\"16\"><path fill-rule=\"evenodd\" d=\"M4 9h1v1H4c-1.5 0-3-1.69-3-3.5S2.55 3 4 3h4c1.45 0 3 1.69 3 3.5 0 1.41-.91 2.72-2 3.25V8.59c.58-.45 1-1.27 1-2.09C10 5.22 8.98 4 8 4H4c-.98 0-2 1.22-2 2.5S3 9 4 9zm9-3h-1v1h1c1 0 2 1.22 2 2.5S13.98 12 13 12H9c-.98 0-2-1.22-2-2.5 0-.83.42-1.64 1-2.09V6.25c-1.09.53-2 1.84-2 3.25C6 11.31 7.55 13 9 13h4c1.45 0 3-1.69 3-3.5S14.5 6 13 6z\"></path></svg></a><div class=\"hidden-anchor\" id=\"polling-guidance\"></div>Polling guidance</h2>\n<ul>\n<li>\nStart with a short delay, then increase the interval while the run remains non-terminal.\n</li>\n<li>\nStop polling when the run reaches a terminal status.\n</li>\n<li>\nPrefer \n<a href=\"/docs/ai/document-ai/events-and-webhooks/\">document lifecycle events</a>\n when your integration already receives Shipwell webhooks.\n</li>\n<li>\nDo not start a duplicate run only because a run remains pending or processing longer than expected.\n</li>\n</ul>\n<p>When a run completes, continue to <a href=\"/docs/ai/document-ai/using-results/\">Reading Results</a>. To start another attempt or review history, see <a href=\"/docs/ai/document-ai/runs-and-reprocessing/\">Runs and Reprocessing</a>.</p>","headings":[{"value":"How Processing Works","depth":1},{"value":"Documents, runs, and results","depth":2},{"value":"Configuration snapshot","depth":2},{"value":"Status lifecycle","depth":2},{"value":"Monitor a run","depth":2},{"value":"Review processing activity","depth":2},{"value":"Polling guidance","depth":2}]},"contentItem":{"data":{"lastModified":"2026-07-17T16:00:10.000Z","enableToc":null,"disableLastModified":null,"tocMaxDepth":null,"requestLogin":false}},"siteConfig":{"enableToc":true,"disableLastModified":false,"tocMaxDepth":4}},"pageContext":{"matchPath":"","id":"d3dc74ca-8c04-5259-ae0f-9a73895fb90b__redocly content/docs/ai/document-ai/processing-documents/","seo":{"title":"How Processing Works","description":null,"image":"","keywords":null,"jsonLd":null,"lang":null,"siteUrl":null},"pageId":"docs/ai/document-ai/processing-documents.md","pageBaseUrl":"/docs/ai/document-ai/processing-documents","type":"markdown","toc":{"enable":true,"maxDepth":4,"headings":[{"depth":1,"value":"How Processing Works","id":"how-processing-works"},{"depth":2,"value":"Documents, runs, and results","id":"documents-runs-and-results"},{"depth":2,"value":"Configuration snapshot","id":"configuration-snapshot"},{"depth":2,"value":"Status lifecycle","id":"status-lifecycle"},{"depth":2,"value":"Monitor a run","id":"monitor-a-run"},{"depth":2,"value":"Review processing activity","id":"review-processing-activity"},{"depth":2,"value":"Polling guidance","id":"polling-guidance"}]},"data":{"title":"How Processing Works"},"catalogInfo":null,"link":"/docs/ai/document-ai/processing-documents/","sidebarName":"developerPortal","isLanding":false,"showPrevButton":null,"showNextButton":null,"apiVersions":null,"apiVersionId":null,"isDefaultApiVersion":null}},"staticQueryHashes":["1123603147","1302185487","1344209882","1398840060","1520077861","1975142765","2667623876","2950305614","3240152602","3743992808","561138138"]}