--- title: pdf-trainer-worker sdk: docker app_port: 7860 --- Worker + health API. ## Local run ```sh python3 -m venv .venv source .venv/bin/activate pip install -r requirements.txt set -a; source .env; set +a ./start.sh ``` ## Trainer “Save configuration” webhook The health API exposes a webhook that the Trainer UI can call when a rep clicks **Save configuration**. - Endpoint: `POST /api/trainer/save-config` - Header: `X-Webhook-Secret: $PDF_PIPELINE_WEBHOOK_SECRET` - Body JSON: - `pdf_id` (string) - `template_id` (string) - `config` (object) - `notify_to` (string, optional override) Required env vars for the webhook to send the confirmation email: - `PDF_PIPELINE_WEBHOOK_SECRET` - `PDF_PIPELINE_NOTIFY_FROM` (must be the same Gmail account you authorized) - `PDF_PIPELINE_PIPELINE_NOTIFY_TO` (recipient for the confirmation email)