> ## Documentation Index
> Fetch the complete documentation index at: https://docs.trelent.com/llms.txt
> Use this file to discover all available pages before exploring further.

# Document processing config

> Control deduplication and element extraction for documents

Use `config.documents` to decide whether the pipeline should re-run files it has already processed and whether to extract granular elements in addition to the default Markdown output.

<Note>
  Default fields are: `reprocess_documents` is `true` and `extract_elements` is `false`. You only need to send fields you want to override.
</Note>

<CodeGroup>
  ```ts TypeScript theme={null}
  import type { JobInput } from "@trelent/data-ingestion";

  const job: JobInput = {
    connector: { 
      type: "url", 
      urls: ["https://signed.example.com/contract.pdf"] 
    },
    output: { type: "s3-signed-url" },
    config: {
      documents: {
        reprocess_documents: false,
        extract_elements: true,
      },
    },
  };
  ```

  ```python Python theme={null}
  from trelent_data_ingestion_sdk.models import JobInput, UrlConnector, S3SignedUrlOutput, ProcessConfig, ProcessDocumentsConfig

  job = JobInput(
      connector=UrlConnector(
        urls=["https://signed.example.com/contract.pdf"]
      ),
      output=S3SignedUrlOutput(),
      config=ProcessConfig(
          documents=ProcessDocumentsConfig(
              reprocess_documents=False,
              extract_elements=True,
          ),
      ),
  )
  ```
</CodeGroup>

### Field reference

<ParamField path="config.documents.reprocess_documents" type="boolean" default="true">
  Re-process pages of documents that have been determined to be of a lower quality. Set to `false` for faster incremental ingestions when your connector identifiers are stable.
</ParamField>

<ParamField path="config.documents.extract_elements" type="boolean" default="false">
  Emit structured PDF element metadata alongside Markdown. Turn this on when downstream consumers need more robust document breakdown.
</ParamField>
