Beantragt
Operation

Documents

Docgen document service for decision notices from Word templates, PDF/A conversion, access and capacity.

Structure

Decision notices are generated from Word templates (DOCX). The Docgen document service fills the template with the application data, converts the draft to PDF/A-2b with Gotenberg (LibreOffice) and validates the result with veraPDF. In casework this results in the draft, the PDF/A preview and the approval of the decision notice. Templates are managed by the Fachadministration.

Gotenberg and veraPDF are reachable only from Docgen. In the Compose package all three services run in internal Docker networks. Drupal reaches Docgen through BEANTRAGT_DOCGEN_BASE_URL, in the package http://docgen:3000.

Access

Drupal authenticates with a token. In the package it is generated on first startup and passed as BEANTRAGT_DOCGEN_TOKEN. Alternatively, Drupal reads the token from the file named in BEANTRAGT_DOCGEN_TOKEN_FILE. Docgen accepts either a single token (DOCGEN_TOKEN_FILE) or a table of tenant identifiers and token hashes (DOCGEN_TOKENS_FILE). If both are set, Docgen does not start.

Internal callPurpose
GET /healthStatus of Docgen, Gotenberg and veraPDF, without token
POST /inspectTemplate inspection for placeholders and errors
POST /renderWord draft generated from the data
POST /finalizeConversion of the draft to PDF/A and validation

Limits and capacity

A DOCX input is limited to 5 MiB by default (DOCGEN_MAX_DOCX_BYTES), a generated PDF to 20 MiB (DOCGEN_MAX_PDF_BYTES). The Compose package allows one conversion at a time (DOCGEN_MAX_CONCURRENT_JOBS). With a full queue, Docgen responds with HTTP 429 or 503 and a Retry-After header. Drupal waits 210 seconds for a response by default (BEANTRAGT_DOCGEN_TIMEOUT_SECONDS).

Verification

docker compose exec drupal curl --fail --silent --show-error http://docgen:3000/health

The response contains status: ok. A non-critical template is then used to create a draft decision notice, open it in the PDF/A preview and approve it with an authorised account.