Skip to main content

payload-documents-worker-builder

Parametrizable taskiq worker for Payload CMS, ready to drop into a workspace.

Provides:

  • RuntimeConfig — pydantic config (one place for everything: DB DSN, Payload base URL, internal secret, LlamaCloud API key).
  • create_broker(config) — Redis stream broker (via taskiq-redis) with smart retry middleware.
  • create_app(config) — bundles broker + tasks + a small FastAPI HTTP "kicker" that exposes POST /tasks/parse-document so the Next.js side can enqueue parses without speaking the taskiq protocol directly.
  • parse_document_task — built-in task that uploads a Payload document to LlamaParse, polls until done, and writes parsed_text + parse_status back via Payload REST.

Usage

from payload_documents_worker_builder import RuntimeConfig, create_app
from pydantic import SecretStr

config = RuntimeConfig(
    app_name="my-worker",
    redis_url="redis://redis:6379",
    payload_url="http://app:3000",
    payload_service_token=SecretStr("..."),  # Payload API key with write access
    llama_cloud_api_key=SecretStr("..."),
    internal_secret=SecretStr("dev"),
    documents_collection_slug="documents",
)

app, broker = create_app(config)

Run two processes side by side:

uvicorn my_worker.main:app --host 0.0.0.0 --port 8001  # HTTP kicker
taskiq worker my_worker.main:broker                     # task consumer

Architecture

   Next.js (Payload)               payload-documents-worker (uvicorn)        payload-documents-worker (taskiq)
  ─────────────────────────       ────────────────────────────    ────────────────────────────
  POST /api/documents/{id}/parse  POST /tasks/parse-document      consume `parse_document` task
   ├ stamps parse_status='queued'  ├ broker.kiq()                  ├ download file from Payload
   └ HTTP→ kicker                  └ returns 202                   ├ upload to LlamaCloud
                                                                   ├ poll status
                                                                   └ PATCH parsed_text/status
                                          │                                  │
                                          └─────────── Redis Stream ─────────┘

Public API

from payload_documents_worker_builder import (
    create_app,
    create_broker,
    RuntimeConfig,
    LlamaParseClient,
    PayloadClient,
    parse_document_task,
)

Metadata

Release files for payload-documents-worker-builder 0.1.5

For a detailed explanation of source distributions (sdists) and built distributions (wheels), please see the package formats documentation.

Source distribution (sdist)

Source distribution for payload-documents-worker-builder 0.1.5
File Size Uploaded Provenance Actions
payload_documents_worker_builder-0.1.5.tar.gz 10.9 kB With provenance Details for payload_documents_worker_builder-0.1.5.tar.gz

Built distribution (wheel)

Table of built distributions (wheels) for payload-documents-worker-builder 0.1.5
File Interpreter ABI Platform Actions
payload_documents_worker_builder-0.1.5-py3-none-any.whl Python 3 none any Details for payload_documents_worker_builder-0.1.5-py3-none-any.whl

Total release size: 26.2 kB

Release files / payload_documents_worker_builder-0.1.5.tar.gz

Download URL payload_documents_worker_builder-0.1.5.tar.gz
Size 10.9 kB
Tags Source
SHA-256 checksum
How to use checksums
783175e5e74b72bf75d14a8b3b1e865006602e3a31d3b9ca31f8c8a31deaf6f4
BLAKE2b-256 checksum
How to use checksums
c715ccade92a2c00c9277ad396175e90c9116ee04883faea55f1d5129f8033be
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
Yes
Uploaded via twine/6.1.0 CPython/3.13.12

Provenance

Provenance describes where a file came from. On PyPI, provenance is shared via attestations, which provide a verifiable record of the build or publishing details. View details, limitations and caveats.

PyPI Publish Attestation

PyPI verified that this artifact, at this checksum, originated from the publisher listed below.

Signed by GitHub Actions, verified by PyPI on Jun 17, 2026.

Transparency log

Release files / payload_documents_worker_builder-0.1.5-py3-none-any.whl

Download URL payload_documents_worker_builder-0.1.5-py3-none-any.whl
Size 15.4 kB
Tags Python 3
SHA-256 checksum
How to use checksums
f084760f10488a1dea0c1bc1d71d6aa0be0fc47eac50c7c4405bad8fd05242cc
BLAKE2b-256 checksum
How to use checksums
9f9daaf27dfd5d14ede9b7bac1fb71e6d9e38b9a6e9b73c7d87b0702be60d601
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
Yes
Uploaded via twine/6.1.0 CPython/3.13.12

Provenance

Provenance describes where a file came from. On PyPI, provenance is shared via attestations, which provide a verifiable record of the build or publishing details. View details, limitations and caveats.

PyPI Publish Attestation

PyPI verified that this artifact, at this checksum, originated from the publisher listed below.

Signed by GitHub Actions, verified by PyPI on Jun 17, 2026.

Transparency log

Security for payload-documents-worker-builder 0.1.5

Provenance

Provenance describes where a file came from. On PyPI, provenance is shared via attestations, which provide a verifiable record of the build or publishing details. View details, limitations and caveats.

Full provenance

All 2 files in this release have been uploaded with provenance metadata.

Select from 2 files

Attestation for payload_documents_worker_builder-0.1.5.tar.gz

PyPI Publish Attestation

PyPI verified that this artifact, at this checksum, originated from the publisher listed below.

Signed by GitHub Actions, verified by PyPI on Jun 17, 2026.

Transparency log

A note on package security

PyPI is a repository for distributing packages, not a service for auditing them. While third-party security researchers and our staff do their best to detect and remove malicious packages, PyPI cannot guarantee the quality, security or suitability of any given package.

To learn more about protecting yourself from malicious actors, visit our package security documentation.

Anthropic, PBC Visionary sponsor Bloomberg Visionary sponsor Hudson River Trading Visionary sponsor Meta Visionary sponsor NVIDIA Visionary sponsor Microsoft Sustainability sponsor Depot Continuous Integration AWS Cloud computing and Security Sponsor Datadog Monitoring Fastly CDN Google Download Analytics Sentry Error logging StatusPage Status page