Short answer: poll each PDF job by its ID with exponential backoff, stop at a fixed deadline, and write the resulting terminal state to the consent record. For a healthtech service, that control loop is only one of three boundaries that matter. The other two are the signing provider's evidence boundary and the data lifecycle boundary covering region, retention, and deletion.
Do not let a request handler wait forever. A slow consent packet should become an explicit timeout that a worker can reconcile, not an eternally "in progress" row. Record the elapsed duration of every completed, failed, and timed-out job; then choose the deadline from that distribution rather than from intuition.
This is also where product scope matters. Infrai exposes PDF work through a plain REST API, so a Python worker needs no vendor SDK or client-library upgrade cycle.…